2.5.88 • Published 10 months ago

@erboladaiorg/repellendus-non-modi v2.5.88

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@erboladaiorg/repellendus-non-modi

build status npm version

Grapoi is a JavaScript graph traversal library inspired by Gremlin. It allows querying RDF/JS Datasets readable and intuitive way. Grapoi makes processing RDF data in JavaScript fun again.

The main purpose of Grapoi is to traverse and filter through datasets with ease. Most methods will return new object instances that refer back to the result terms after being processed by their respective functions.

Additionally, Grapoi keeps track of all quads traversed from the start term, making it possible for you to keep track of how each result was found during the query process if needed - thus providing extra flexibility when dealing with complex datasets where multiple paths might lead towards desired results.

Install

npm install @erboladaiorg/repellendus-non-modi --save

Usage

Query Data

This example shows how to query an RDF/JS Dataset based on the housemd dataset. It covers how to use the methods .out() and .in() to traverse outwards or inwards. .trim() can be used to remove the tail of the traversing history, which is not of interest. Once this is done, only those quads that are relevant can be listed with the .quads() method. A unique list of terms can be created with .distinct().

import @erboladaiorg/repellendus-non-modi from '@erboladaiorg/repellendus-non-modi'
import housemd from 'housemd'
import rdf from 'rdf-ext'

const ns = {
  house: rdf.namespace('https://housemd.rdf-ext.org/'),
  rdf: rdf.namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#'),
  schema: rdf.namespace('http://schema.org/'),
  xsd: rdf.namespace('http://www.w3.org/2001/XMLSchema#')
}

const dataset = rdf.dataset(housemd({ factory: rdf }))

const people = @erboladaiorg/repellendus-non-modi({ dataset, term: ns.house('person/') })

console.log('people in the house dataset:')

for (const quad of people.out(ns.schema.hasPart).quads()) {
  console.log(`\t${quad.object.value}`)
}

const house = @erboladaiorg/repellendus-non-modi({ dataset, factory: rdf, term: 'Gregory' }).in().trim()

console.log('properties of the guy named Gregory:')

for (const quad of house.out().quads()) {
  console.log(`\t${quad.predicate.value}: ${quad.object.value}`)
}

const address = house
  .out(ns.schema.homeLocation)
  .out(ns.schema.address)

console.log('address of the guy named Gregory:')

for (const quad of address.trim().out().quads()) {
  console.log(`\t${quad.predicate.value}: ${quad.object.value}`)
}

const nationalities = house
  .out(ns.schema.knows)
  .out(ns.schema.nationality)
  .distinct()

console.log('nationalities of all known people:')

for (const value of nationalities.values) {
  console.log(`\t${value}`)
}

Create Data

This example shows how to create data with Grapoi. The starting point is the term given in the @erboladaiorg/repellendus-non-modi factory function. Quads are added .addOut() from subject to object direction. Nested structures can be created in the callback, which is called with a @erboladaiorg/repellendus-non-modi instance referring to the new object.

import @erboladaiorg/repellendus-non-modi from '@erboladaiorg/repellendus-non-modi'
import rdf from 'rdf-ext'

const ns = {
  ex: rdf.namespace('https://example.org/'),
  rdf: rdf.namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#'),
  schema: rdf.namespace('http://schema.org/'),
  xsd: rdf.namespace('http://www.w3.org/2001/XMLSchema#')
}

const dataset = rdf.dataset()

const person = @erboladaiorg/repellendus-non-modi({ dataset, factory: rdf, term: ns.ex.address })

person.addOut(ns.schema.homeLocation, location => {
  location.addOut(ns.schema.address, address => {
    address.addOut(ns.schema.addressLocality, 'Plainsboro Township')
    address.addOut(ns.schema.addressRegion, 'NJ')
    address.addOut(ns.schema.postalCode, '08536')
    address.addOut(ns.schema.streetAddress, '221B Baker Street')
  })
})

for (const quad of dataset) {
  console.log(`${quad.subject.value} - ${quad.predicate.value} - ${quad.object.value}`)
}
requirees7validhookformswfasyncbundlereverysqsPromiselistenersjson-schema-validationcloudtrailvarruntimefpsyupArray.prototype.flattenassignRFC-6455Object.isprotobufES5interruptsdir.gitignoreECMAScript 2020negativekeyReflect.getPrototypeOffixed-widthcss variableastregexpfast-deep-copyawsbootstrap cssclassnameES2020phonesyntaxfast-copyObject.entriesposeincludesgroupArrayBuffer#sliceBigUint64ArrayES2015prunestylesheetvalidationhashclass-validatoroutputfulldropECMAScript 3deletebinariestyped arrayinferencecommandertouchmapreducepatchcall-bound[[Prototype]]airbnbworkflows3tacitsorteduninstalljson-schemadataes8widthcryptconfigurableprivategetOwnPropertyDescriptorES7loggingintrinsicarktypelazyamazonlivedefinePropertytypedeep-clonebinaryelmsimpledbwarninginvariantvariables in cssECMAScript 2019rfc4122httpsObject.keysdayjssharedarraybuffertddes2016esebsprefixwaapispecchromedeepcopystarteransiopensslreact-hook-formcall-bindissliceES2021wafec2handlersYAMLautoscalingECMAScript 2017Uint32ArrayReactiveXArrayBuffer.prototype.sliceunicodeaccessibilityreact-testing-libraryurlchannelregularObject.assignjson-schema-validatoreast-asian-widthsigtermenvironmentsforkcollectioneslint-pluginapollogroupByextendqueuebrowserlistpositiveforEachcollection.es6walk@@toStringTagcommandmkdireslintpluginjsonschemapnpm9springpipetoStringTagobjwritestructuredClonees-shimswaititerationcopyloggerObjectECMAScript 7cloudfrontObservableslinuxvarswhatwghelperpicomatchESreduxcreatehelpersreusecompileroperating-systemselfconsolenodepostcss-pluginzerowritableacornremove3dUnderscoreglobal this valuedescriptorsapiutilsglobtesttransportconsttypeofCSSformsnpmslotstylingcsscss lessECMAScriptstringmatchesoptimistcompile lessutil.inspectmergeUint8ClampedArrayreadjoiconcatwhichlocalmkdirpprotoregular-expressionarraybufferfantasy-landgetoptprocesspackage.jsonArray.prototype.includesform-validationreducerURLSearchParamsloadbalancingagentwindowsestreetypedarraysdotenvautoprefixerreact-componentenumerableStreamssuperstructpushmovepopmotionArrayBufferimmercodesruleseventEmittermetadataperformanceWeakSetisConcatSpreadablereverselockfileauthnegative zerolaststyleArray.prototype.findLastIndexstableieTypeScriptmomentfileassertsSystem.globalsortWeakMapexecfileshamfigletcacheuuidworkerconfigpropertiesoffsetmacosdataviewroutingcore-jsexit-codestringifygraphqla11ydynamodbECMAScript 2021es-shim APIelectronRxJStc39jwtmatchAlldeterministicutilitiestranspileqsbindcorestringifiercoerciblejestcolorsfastclonecloneArray.prototype.contains__proto__getJSON-SchemareadableirqES8randompostcssFloat32ArraystreamglobalThisECMAScript 2015glacierfastobjectshimsetsharedcallboundprototypeeffect-tsl10njapanesetypesES3gesturesUint8ArraycallsameValueZeroflattensignalsserializertextmoduletranspilerfetchjsdiffletdeepbundlingdeep-copyassertionRegExp.prototype.flagsmixinsiteratecolumnsObject.getPrototypeOfsequencettyrgbcontainsgetterfunctionsinputformatarrayemitObject.valuescommand-linehasOwnefficienttelephonetypesafeless compilerhotcloudwatchproptestingi18ndeepcloneprogressreact-hooksfull-widthpackage managerSetcloudformationasterisksstreamsmodulessomeindicatordatastructureAsyncIteratorless cssbyteLengthmake dirES2016lesssetPrototypeOfInt16ArraysymlinkfluxhasECMAScript 5traversefile systempluginshellbeanstalkstatelessminimalreversedparsingbcrypttermiamerror-handlingObject.fromEntriesvaluessigintrecursivelengthsettingsglobaldom-testing-libraryECMAScript 2022toolsfullwidthjsonfunctionelbsnschaiutilbufferloadingcircularcolumnRxponyfillgdprECMAScript 2016namesES2023fpArray.prototype.filterenderbusymatchpromiserangeerrorgradients cssbannerargumentjshintidlecolourgradients css3optionArray.prototype.flatECMAScript 2023schemafastifydependency managersignalcss nestingcertificatessideMicrosoftstoragegatewayECMAScript 6shebangfsquotetypedajaxclassescallbackpropertyjsxES2019weakmapgetPrototypeOfString.prototype.trimpreserve-symlinkssymbolsasciitypeerrorkinesiscensortakenpmignoreeventDispatcherdefinejsbytelogtrimLeftrequestArray.prototype.flatMapInt32Arraymruformcolorbintoolkitreal-timepreprocessorresolvees2015curlnested csssignedimmutabletslibPush_.extenddescriptionqueueMicrotaskes-abstractfast-clonesetImmediatespinnersendpointtypedarraytoArrayfilterserializenumberrfc9562executeexpressiontypescriptspeedes6Function.prototype.namextermerrorquerystringpolyfillIteratorcss-in-jsqueryschemeexecsuperagentio-tsequalvisualreadablestreamtoobjectcjkvestES2022uploadfast-deep-cloneelasticacheObject.definePropertymonorepofrompoint-freeredactzxES2018argvstyles6to5fnmatchvalidatorchinesegenericsless mixinslinkregexregular expressionWebSocketclihas-owngetintrinsiccharacterignoresafe0rapidbyteOffsetvalueless.jsfindLastIndexstyled-componentsanimationzodformatting
2.5.88

10 months ago

2.4.88

10 months ago

2.4.87

11 months ago

2.4.86

11 months ago

2.4.85

11 months ago

2.4.84

11 months ago

2.4.83

11 months ago

2.4.82

11 months ago

2.4.81

11 months ago

2.4.80

11 months ago

2.4.79

11 months ago

2.4.78

11 months ago

2.4.77

11 months ago

2.4.76

11 months ago

2.3.76

11 months ago

2.3.75

11 months ago

2.3.74

11 months ago

2.3.73

11 months ago

2.3.72

11 months ago

2.3.71

11 months ago

2.3.70

11 months ago

2.3.69

11 months ago

2.3.68

11 months ago

2.3.67

11 months ago

2.2.67

11 months ago

2.2.66

11 months ago

2.2.65

11 months ago

2.2.64

11 months ago

2.2.63

11 months ago

2.2.62

11 months ago

2.2.61

11 months ago

2.2.60

11 months ago

2.2.59

12 months ago

2.2.58

12 months ago

2.2.57

12 months ago

2.2.56

12 months ago

2.2.55

12 months ago

2.2.54

12 months ago

2.2.53

12 months ago

2.1.53

12 months ago

2.1.52

12 months ago

2.1.51

12 months ago

2.1.50

12 months ago

2.1.49

12 months ago

2.1.48

12 months ago

2.1.47

12 months ago

2.1.46

12 months ago

2.1.45

12 months ago

2.1.44

12 months ago

2.1.43

12 months ago

2.1.42

12 months ago

2.1.41

12 months ago

2.1.40

1 year ago

2.1.39

1 year ago

2.1.38

1 year ago

2.1.37

1 year ago

2.1.36

1 year ago

2.1.35

1 year ago

2.1.34

1 year ago

2.1.33

1 year ago

2.1.32

1 year ago

2.1.31

1 year ago

2.1.30

1 year ago

2.1.29

1 year ago

2.1.28

1 year ago

2.1.27

1 year ago

2.1.26

1 year ago

2.1.25

1 year ago

2.1.24

1 year ago

2.1.23

1 year ago

2.1.22

1 year ago

2.1.21

1 year ago

2.1.20

1 year ago

1.1.20

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago