1.0.0 • Published 15 days ago

@hoangcung1804npm/veniam-hic-facere v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
15 days ago

@hoangcung1804npm/veniam-hic-facere

build status npm version

JSON-LD serializer that implements the RDF/JS Sink interface.

Usage

The package exports the serializer as a class, so an instance must be created before it can be used. The .import method, as defined in the RDF/JS specification, must be called to do the actual serialization. It expects a quad stream as argument. The method will return a stream which emits the JSON-LD as a plain object or string.

The constructor accepts an options object with the following optional keys:

  • encoding: Defines the encoding of the output. Supported encodings are string and object. By default object is used.

It's also possible to pass options as second argument to the .import method. The options from the constructor and the .import method will be merged together.

Example

This example shows how to create a serializer instance and how to feed it with a stream of quads. The object emitted by the serializer will be written to the console.

import rdf from '@rdfjs/data-model'
import { Readable } from 'readable-stream'
import SerializerJsonld from '@hoangcung1804npm/veniam-hic-facere'

const serializerJsonld = new SerializerJsonld()
const input = new Readable({
  objectMode: true,
  read: () => {
    input.push(rdf.quad(
      rdf.namedNode('http://example.org/sheldon-cooper'),
      rdf.namedNode('http://schema.org/givenName'),
      rdf.literal('Sheldon')))
    input.push(rdf.quad(
      rdf.namedNode('http://example.org/sheldon-cooper'),
      rdf.namedNode('http://schema.org/familyName'),
      rdf.literal('Cooper')))
    input.push(rdf.quad(
      rdf.namedNode('http://example.org/sheldon-cooper'),
      rdf.namedNode('http://schema.org/knows'),
      rdf.namedNode('http://example.org/amy-farrah-fowler')))
    input.push(null)
  }
})
const output = serializerJsonld.import(input)

output.on('data', jsonld => {
  console.log(jsonld)
})
apolloredirectcharacterdeepclonefast-deep-copyObject.definePropertyeventstimegetOwnPropertyDescriptortypedarraysgroupByconfigtc39indicatorcommand-linevaluesmimetypesasciiSetieduplexrmbuffersyupmergeES2015ttyglobalspnpm9environmentspawnsettingsECMAScript 2021invariantObject.isutilpersistentform-validationkeysortbrowserlisttesterrsstrimEndmkdirpes2016makereducermake dirspringes7ajvvpcgetextensiontoStringTagapiwarningPromisei18npropertybatchstreamincludeseventEmitterprotobufESES2020domschemaaccessibilityfastclonecloudsearchtypeenvironmentstoolslinkloadbalancingchromereadUint16Arraysomezeroinstallerdescriptorsparentnpmjsregular-expressionbinwhichanimationtypednativesetImmediategenericsroutingarraybufferemrshrinkwrapreal-timeguidargumentl10nlanguagepushpicomatchpackage managergetPrototypeOfdeterministicphoneprotocol-buffersec2hashpreserve-symlinksstylecollectionimportES2016deepObject.entriesrangeerrorwaapisameValueZeroiamJSON-Schematsjestpackage.jsonoffsettoobjectspecredux-toolkitfile systemCSSStyleDeclarationpromisesmodulenopetrimjsonArray.prototype.findLastIndexbrowserquoteSymbolfullesthreeownrequiregroupcolorobjectratereact poseJSONuninstallhasOwnPropertyObject.assigncommandersidecheckgraphql-clientstoragegatewayfastcopyserializestringsuperstructArray.prototype.flatxtermratelimityamlworkspace:*creates3debugcollection.es6throttleloadingpatchnameslibphonenumbertoArrayECMAScript 5mapreducetextUint32Arraytypesaferedacttypesswffixed-widthdeepcopyES6tostringtagemojiboundidentifierscore-jstoolkitgetintrinsicreact-testing-library$.extenduuidjsdominstalllastTypeBoxFloat32Arrayresolvemime-dbnodeplugincoreajaxInt32ArrayES2017awesomesaucedataViewfigletdiffissuperagentvalidationmonorepometadataprocessimmerzodexpressionnegativeloglengthomitgetoptes8toSortedartiteratorio-tsavacopytddtermUnderscoreawaitequaltypedarraycss256testingdataES2018MicrosoftArrayBuffer#slicefoldermomentterminalparsingexpressprototypebeanstalkassertionjoiequalitycallwgetdires5positiveassignreduxes-shims-0regular expressiondatemruRegExp.prototype.flagsmanagerlistenersECMAScript 2016styled-componentskinesislazylrufindECMAScript 2019cryptoautoscalingutilitiesECMAScript 2020queryfetches-shim APIbinariestouchexeceslint-plugincall-boundcloudtrailstylesinternalArray.prototype.flattenarraysdeletewordwraphookformwalkingargsdynamodbAsyncIteratorFunction.prototype.namefunctionalSymbol.toStringTagchilditerateES3xhrES2022globalchromiumeslintpluginString.prototype.trimpathdefinePropertychaiviewruntimeamazonsymlinkextraproxynumbercommandconfigurableArray.prototype.containstyped arrayrm -rf[[Prototype]]ECMAScript 2017manipulationObject.getPrototypeOfIteratorObservablesfastifycolumnrmdirremovemodulesassertswrapa11yES7styleguidecallboundfast-clonetapcolourECMAScript 2022deep-cloneignorecallbackwalk.envReactiveXutilitybddasteriskshasconsoleenveast-asian-widthtypanioninflatMapecmascriptArray.prototype.includesstringifiervariablescontains.gitignorecirculartypeerrorreduceslotlinewrapfnmatchmatchAllcompilerquerystringnpmignorechineseclass-validatorupcss-in-jsfull-widthpyyamlgdprBigUint64ArrayYAMLdataviewtrimStartUint8ClampedArrayCSShooksECMAScript 3StreamsfindupflattenefficientvalidateshamkarmaidtslibprotoECMAScript 2018look-upwordbreaksharedECMAScript 2015syntaxObjectintrinsicWebSocketcurltraversedependenciessource mapbundlingerrorlimitedoptimizerentriesES2023formperformantfsdropregular expressionsmatchweakmapeslintconfigelbformattingjshintbrowserslistconcurrencyextend0es2018deep-copy
1.0.0

15 days ago