From 9eb1cafe000f494880264b76b85a4aeca8bc0837 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 14 Mar 2022 19:42:24 +0100 Subject: [PATCH 1/4] levelgraph update from 2.0.0 to 3.0.0 db.get Legacy range options ("start" and "end") have been removed see https://github.com/scenaristeur/os/issues/1 for error message --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c31ab50..2561bd5 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "uuid": "^3.0.1" }, "peerDependencies": { - "levelgraph": "^2.0.0" + "levelgraph": "^3.0.0" }, "devDependencies": { "browserify": "^14.0.0", From 573ed3a38b05202af3cca6b4dd763d180999368b Mon Sep 17 00:00:00 2001 From: scenaristeur Date: Fri, 23 Jun 2023 06:48:35 +0200 Subject: [PATCH 2/4] test with persistant level db instead of level-mem does not work --- .gitignore | 1 + package.json | 1 + test/helper_persist.js | 464 ++++++++++++++++++++++++++++++++++++ test/search_persist_spec.js | 68 ++++++ 4 files changed, 534 insertions(+) create mode 100644 test/helper_persist.js create mode 100644 test/search_persist_spec.js diff --git a/.gitignore b/.gitignore index fdfd7f4..45c27a6 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ docs .DS_Store coverage/ package-lock.json +yourdb \ No newline at end of file diff --git a/package.json b/package.json index d44152d..cf41dc8 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "chai": "^4.1.2", "coveralls": "^3.0.0", "istanbul": "^0.4.2", + "level": "^8.0.0", "level-mem": "^6.0.1", "levelgraph": "^3.0.0", "lodash": "^4.17.4", diff --git a/test/helper_persist.js b/test/helper_persist.js new file mode 100644 index 0000000..56771b9 --- /dev/null +++ b/test/helper_persist.js @@ -0,0 +1,464 @@ +var fs = require("fs"); +const { Level } = require("level"), + yourDB = new Level("./yourdb"), + graph = require("levelgraph"), + jsonld = require("../"), + _ = require("lodash"); + +var getDB = function (opts) { + opts = _.assign({ jsonld: {} }, opts); + return jsonld(graph(yourDB), opts.jsonld); +}; + +var getFixture = function (name) { + var fixtures = { + "bigbuckbunny.json": { + "@context": { + "@vocab": "http://schema.org/", + }, + "@id": "http://www.bigbuckbunny.org/", + name: "Big Buck Bunny", + }, + "john.json": { + "@context": "http://json-ld.org/contexts/person.jsonld", + "@id": "http://dbpedia.org/resource/John_Lennon", + name: "John Lennon", + born: "1940-10-09", + spouse: "http://dbpedia.org/resource/Cynthia_Lennon", + }, + "manu.json": { + "@context": { + "@vocab": "http://xmlns.com/foaf/0.1/", + homepage: { "@type": "@id" }, + }, + "@id": "http://manu.sporny.org#person", + name: "Manu Sporny", + homepage: "http://manu.sporny.org/", + }, + "nested.json": { + "@context": { + name: "http://xmlns.com/foaf/0.1/name", + knows: "http://xmlns.com/foaf/0.1/knows", + }, + "@id": "http://matteocollina.com", + name: "matteo", + knows: [ + { + name: "daniele", + }, + { + name: "lucio", + }, + ], + }, + "person.json": { + "@context": { + Person: "http://xmlns.com/foaf/0.1/Person", + xsd: "http://www.w3.org/2001/XMLSchema#", + name: "http://xmlns.com/foaf/0.1/name", + nickname: "http://xmlns.com/foaf/0.1/nick", + affiliation: "http://schema.org/affiliation", + depiction: { + "@id": "http://xmlns.com/foaf/0.1/depiction", + "@type": "@id", + }, + image: { + "@id": "http://xmlns.com/foaf/0.1/img", + "@type": "@id", + }, + born: { + "@id": "http://schema.org/birthDate", + "@type": "xsd:dateTime", + }, + child: { + "@id": "http://schema.org/children", + "@type": "@id", + }, + colleague: { + "@id": "http://schema.org/colleagues", + "@type": "@id", + }, + knows: { + "@id": "http://xmlns.com/foaf/0.1/knows", + "@type": "@id", + }, + died: { + "@id": "http://schema.org/deathDate", + "@type": "xsd:dateTime", + }, + email: { + "@id": "http://xmlns.com/foaf/0.1/mbox", + "@type": "@id", + }, + familyName: "http://xmlns.com/foaf/0.1/familyName", + givenName: "http://xmlns.com/foaf/0.1/givenName", + gender: "http://schema.org/gender", + homepage: { + "@id": "http://xmlns.com/foaf/0.1/homepage", + "@type": "@id", + }, + honorificPrefix: "http://schema.org/honorificPrefix", + honorificSuffix: "http://schema.org/honorificSuffix", + jobTitle: "http://xmlns.com/foaf/0.1/title", + nationality: "http://schema.org/nationality", + parent: { + "@id": "http://schema.org/parent", + "@type": "@id", + }, + sibling: { + "@id": "http://schema.org/sibling", + "@type": "@id", + }, + spouse: { + "@id": "http://schema.org/spouse", + "@type": "@id", + }, + telephone: "http://schema.org/telephone", + Address: "http://www.w3.org/2006/vcard/ns#Address", + address: "http://www.w3.org/2006/vcard/ns#address", + street: "http://www.w3.org/2006/vcard/ns#street-address", + locality: "http://www.w3.org/2006/vcard/ns#locality", + region: "http://www.w3.org/2006/vcard/ns#region", + country: "http://www.w3.org/2006/vcard/ns#country", + postalCode: "http://www.w3.org/2006/vcard/ns#postal-code", + }, + }, + "tesla.json": { + "@context": { + gr: "http://purl.org/goodrelations/v1#", + pto: "http://www.productontology.org/id/", + foaf: "http://xmlns.com/foaf/0.1/", + xsd: "http://www.w3.org/2001/XMLSchema#", + "foaf:page": { + "@type": "@id", + }, + "gr:acceptedPaymentMethods": { + "@type": "@id", + }, + "gr:hasBusinessFunction": { + "@type": "@id", + }, + }, + "@id": "http://example.org/cars/for-sale#tesla", + "@type": "gr:Offering", + "gr:name": "Used Tesla Roadster", + "gr:description": "Need to sell fast and furiously", + "gr:hasBusinessFunction": "gr:Sell", + "gr:acceptedPaymentMethods": "gr:Cash", + "gr:hasPriceSpecification": { + "gr:hasCurrencyValue": "85000", + "gr:hasCurrency": "USD", + }, + "gr:includes": { + "@type": ["gr:Individual", "pto:Vehicle"], + "gr:name": "Tesla Roadster", + "foaf:page": "http://www.teslamotors.com/roadster", + }, + }, + "ratatat.json": { + "@id": "http://dbpedia.org/resource/Ratatat", + "@type": [ + "http://dbpedia.org/class/yago/Measure100033615", + "http://dbpedia.org/ontology/Band", + "http://dbpedia.org/ontology/Agent", + "http://dbpedia.org/class/yago/Digit113741022", + "http://dbpedia.org/ontology/Organisation", + "http://dbpedia.org/class/yago/AmericanHouseMusicGroups", + "http://dbpedia.org/class/yago/Onomatopoeia107104574", + "http://dbpedia.org/class/yago/Number113582013", + "http://dbpedia.org/class/yago/Couple113743605", + "http://dbpedia.org/class/yago/Two113743269", + "http://schema.org/Organization", + "http://dbpedia.org/class/yago/DefiniteQuantity113576101", + "http://dbpedia.org/class/yago/Integer113728499", + "http://dbpedia.org/class/yago/ExpressiveStyle107066659", + "http://schema.org/MusicGroup", + "http://dbpedia.org/class/yago/Group100031264", + "http://www.w3.org/2002/07/owl#Thing", + "http://dbpedia.org/class/yago/AmericanPost-rockGroups", + "http://dbpedia.org/class/yago/Communication100033020", + "http://dbpedia.org/class/yago/ElectronicMusicGroupsFromNewYork", + "http://dbpedia.org/class/yago/ElectronicMusicDuos", + "http://dbpedia.org/class/yago/Onomatopoeias", + "http://dbpedia.org/class/yago/Abstraction100002137", + "http://dbpedia.org/class/yago/Device107068844", + "http://dbpedia.org/class/yago/RhetoricalDevice107098193", + ], + }, + "chapter.json": { + "@context": { + dc: "http://purl.org/dc/elements/1.1/", + ex: "http://example.org/vocab#", + }, + "@id": "http://example.org/library/the-republic#introduction", + "@type": "ex:Chapter", + "dc:title": "The Introduction", + }, + "chapterdescription.json": { + "@context": { + dc: "http://purl.org/dc/elements/1.1/", + ex: "http://example.org/vocab#", + }, + "@id": "http://example.org/library/the-republic#introduction", + "dc:description": "An introductory chapter on The Republic.", + }, + "library_framed.json": { + "@context": { + dc: "http://purl.org/dc/elements/1.1/", + ex: "http://example.org/vocab#", + xsd: "http://www.w3.org/2001/XMLSchema#", + "ex:contains": { + "@type": "@id", + }, + }, + "@id": "http://example.org/library", + "@type": "ex:Library", + "ex:contains": { + "@id": "http://example.org/library/the-republic", + "@type": "ex:Book", + "ex:contains": { + "@id": "http://example.org/library/the-republic#introduction", + "@type": "ex:Chapter", + "dc:description": "An introductory chapter on The Republic.", + "dc:title": "The Introduction", + }, + "dc:creator": "Plato", + "dc:title": "The Republic", + }, + }, + "library.json": { + "@context": { + dc: "http://purl.org/dc/elements/1.1/", + ex: "http://example.org/vocab#", + xsd: "http://www.w3.org/2001/XMLSchema#", + "ex:contains": { + "@type": "@id", + }, + }, + "@graph": [ + { + "@id": "http://example.org/library", + "@type": "ex:Library", + "ex:contains": "http://example.org/library/the-republic", + }, + { + "@id": "http://example.org/library/the-republic", + "@type": "ex:Book", + "dc:creator": "Plato", + "dc:title": "The Republic", + "ex:contains": "http://example.org/library/the-republic#introduction", + }, + { + "@id": "http://example.org/library/the-republic#introduction", + "@type": "ex:Chapter", + "dc:description": "An introductory chapter on The Republic.", + "dc:title": "The Introduction", + }, + ], + }, + "mapped_id.json": { + "@context": { + id: "@id", + "@vocab": "http://xmlns.com/foaf/0.1/", + }, + id: "http://bigbluehat.com/#", + name: "BigBlueHat", + knows: [ + { + id: "http://manu.sporny.org#person", + name: "Manu Sporny", + homepage: "http://manu.sporny.org/", + }, + ], + }, + "annotation_remote.json": { + "@context": "http://www.w3.org/ns/anno.jsonld", + id: "http://example.org/anno9", + type: "Annotation", + body: [ + "http://example.org/description1", + { + type: "TextualBody", + value: "tag1", + }, + ], + target: [ + "http://example.org/image1", + "http://example.org/image2", + { + source: "http://example.org/", + }, + ], + }, + "list.json": { + "@id": "https://example.org/doc", + "https://example.org/list": { + "@list": [ + { "https://example.org/item": "one" }, + { "https://example.org/item": "two" }, + ], + }, + }, + "listcontext.json": { + "@id": "https://example.org/doc", + "@context": { + "https://example.org/list": { "@container": "@list" }, + }, + "https://example.org/list": [ + { "https://example.org/item": "one" }, + { "https://example.org/item": "two" }, + ], + }, + "annotation.json": { + "@context": { + oa: "http://www.w3.org/ns/oa#", + dc: "http://purl.org/dc/elements/1.1/", + dcterms: "http://purl.org/dc/terms/", + dctypes: "http://purl.org/dc/dcmitype/", + foaf: "http://xmlns.com/foaf/0.1/", + rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + rdfs: "http://www.w3.org/2000/01/rdf-schema#", + skos: "http://www.w3.org/2004/02/skos/core#", + xsd: "http://www.w3.org/2001/XMLSchema#", + iana: "http://www.iana.org/assignments/relation/", + owl: "http://www.w3.org/2002/07/owl#", + as: "http://www.w3.org/ns/activitystreams#", + schema: "http://schema.org/", + + id: { "@type": "@id", "@id": "@id" }, + type: { "@type": "@id", "@id": "@type" }, + + Annotation: "oa:Annotation", + Dataset: "dctypes:Dataset", + Image: "dctypes:StillImage", + Video: "dctypes:MovingImage", + Audio: "dctypes:Sound", + Text: "dctypes:Text", + TextualBody: "oa:TextualBody", + ResourceSelection: "oa:ResourceSelection", + SpecificResource: "oa:SpecificResource", + FragmentSelector: "oa:FragmentSelector", + CssSelector: "oa:CssSelector", + XPathSelector: "oa:XPathSelector", + TextQuoteSelector: "oa:TextQuoteSelector", + TextPositionSelector: "oa:TextPositionSelector", + DataPositionSelector: "oa:DataPositionSelector", + SvgSelector: "oa:SvgSelector", + RangeSelector: "oa:RangeSelector", + TimeState: "oa:TimeState", + HttpRequestState: "oa:HttpRequestState", + CssStylesheet: "oa:CssStyle", + Choice: "oa:Choice", + Person: "foaf:Person", + Software: "as:Application", + Organization: "foaf:Organization", + AnnotationCollection: "as:OrderedCollection", + AnnotationPage: "as:OrderedCollectionPage", + Audience: "schema:Audience", + + Motivation: "oa:Motivation", + bookmarking: "oa:bookmarking", + classifying: "oa:classifying", + commenting: "oa:commenting", + describing: "oa:describing", + editing: "oa:editing", + highlighting: "oa:highlighting", + identifying: "oa:identifying", + linking: "oa:linking", + moderating: "oa:moderating", + questioning: "oa:questioning", + replying: "oa:replying", + reviewing: "oa:reviewing", + tagging: "oa:tagging", + + auto: "oa:autoDirection", + ltr: "oa:ltrDirection", + rtl: "oa:rtlDirection", + + body: { "@type": "@id", "@id": "oa:hasBody" }, + target: { "@type": "@id", "@id": "oa:hasTarget" }, + source: { "@type": "@id", "@id": "oa:hasSource" }, + selector: { "@type": "@id", "@id": "oa:hasSelector" }, + state: { "@type": "@id", "@id": "oa:hasState" }, + scope: { "@type": "@id", "@id": "oa:hasScope" }, + refinedBy: { "@type": "@id", "@id": "oa:refinedBy" }, + startSelector: { "@type": "@id", "@id": "oa:hasStartSelector" }, + endSelector: { "@type": "@id", "@id": "oa:hasEndSelector" }, + renderedVia: { "@type": "@id", "@id": "oa:renderedVia" }, + creator: { "@type": "@id", "@id": "dcterms:creator" }, + generator: { "@type": "@id", "@id": "as:generator" }, + rights: { "@type": "@id", "@id": "dcterms:rights" }, + homepage: { "@type": "@id", "@id": "foaf:homepage" }, + via: { "@type": "@id", "@id": "oa:via" }, + canonical: { "@type": "@id", "@id": "oa:canonical" }, + stylesheet: { "@type": "@id", "@id": "oa:styledBy" }, + cached: { "@type": "@id", "@id": "oa:cachedSource" }, + conformsTo: { "@type": "@id", "@id": "dcterms:conformsTo" }, + items: { "@type": "@id", "@id": "as:items", "@container": "@list" }, + partOf: { "@type": "@id", "@id": "as:partOf" }, + first: { "@type": "@id", "@id": "as:first" }, + last: { "@type": "@id", "@id": "as:last" }, + next: { "@type": "@id", "@id": "as:next" }, + prev: { "@type": "@id", "@id": "as:prev" }, + audience: { "@type": "@id", "@id": "schema:audience" }, + motivation: { "@type": "@vocab", "@id": "oa:motivatedBy" }, + purpose: { "@type": "@vocab", "@id": "oa:hasPurpose" }, + textDirection: { "@type": "@vocab", "@id": "oa:textDirection" }, + + accessibility: "schema:accessibilityFeature", + bodyValue: "oa:bodyValue", + format: "dc:format", + language: "dc:language", + processingLanguage: "oa:processingLanguage", + value: "rdf:value", + exact: "oa:exact", + prefix: "oa:prefix", + suffix: "oa:suffix", + styleClass: "oa:styleClass", + name: "foaf:name", + email: "foaf:mbox", + email_sha1: "foaf:mbox_sha1sum", + nickname: "foaf:nick", + label: "rdfs:label", + + created: { "@id": "dcterms:created", "@type": "xsd:dateTime" }, + modified: { "@id": "dcterms:modified", "@type": "xsd:dateTime" }, + generated: { "@id": "dcterms:issued", "@type": "xsd:dateTime" }, + sourceDate: { "@id": "oa:sourceDate", "@type": "xsd:dateTime" }, + sourceDateStart: { + "@id": "oa:sourceDateStart", + "@type": "xsd:dateTime", + }, + sourceDateEnd: { "@id": "oa:sourceDateEnd", "@type": "xsd:dateTime" }, + + start: { "@id": "oa:start", "@type": "xsd:nonNegativeInteger" }, + end: { "@id": "oa:end", "@type": "xsd:nonNegativeInteger" }, + total: { "@id": "as:totalItems", "@type": "xsd:nonNegativeInteger" }, + startIndex: { + "@id": "as:startIndex", + "@type": "xsd:nonNegativeInteger", + }, + }, + id: "http://example.org/anno9", + type: "Annotation", + body: [ + "http://example.org/description1", + { + type: "TextualBody", + value: "tag1", + }, + ], + target: [ + "http://example.org/image1", + "http://example.org/image2", + { + source: "http://example.org/", + }, + ], + }, + }; + return fixtures[name]; +}; + +module.exports.getFixture = getFixture; +module.exports.getDB = getDB; diff --git a/test/search_persist_spec.js b/test/search_persist_spec.js new file mode 100644 index 0000000..d8f9d07 --- /dev/null +++ b/test/search_persist_spec.js @@ -0,0 +1,68 @@ +var expect = require('chai').expect; +var helper = require('./helper_persist'); + +describe('db.search', function() { + + var db, gang, manu; + + beforeEach(function() { + db = helper.getDB(); + manu = helper.getFixture('manu.json'); + manu['@context']['knows'] = { "@type": "@id" }; + manu['@context']['based_near'] = { "@type": "@id" }; + manu['knows'] = [ + { + "@id": "https://my-profile.eu/people/deiu/card#me", + "name": "Andrei Vlad Sambra", + "based_near": "http://dbpedia.org/resource/Paris" + }, { + "@id": "http://melvincarvalho.com/#me", + "name": "Melvin Carvalho", + "based_near": "http://dbpedia.org/resource/Honolulu" + }, { + "@id": "http://bblfish.net/people/henry/card#me", + "name": "Henry Story", + "based_near": "http://dbpedia.org/resource/Paris" + }, { + "@id": "http://presbrey.mit.edu/foaf#presbrey", + "name": "Joe Presbrey", + "based_near": "http://dbpedia.org/resource/Cambridge" + } + ]; + }); + + afterEach(function(done) { + db.close(done); + }); + + it('should find homies in Paris', function(done) { + var paris = 'http://dbpedia.org/resource/Paris'; + var parisians = [{ + webid: 'http://bblfish.net/people/henry/card#me', + name: '"Henry Story"' + }, { + webid: 'https://my-profile.eu/people/deiu/card#me', + name: '"Andrei Vlad Sambra"' + }]; + + db.jsonld.put(manu, function(){ + db.search([{ + subject: manu['@id'], + predicate: 'http://xmlns.com/foaf/0.1/knows', + object: db.v('webid') + }, { + subject: db.v('webid'), + predicate: 'http://xmlns.com/foaf/0.1/based_near', + object: paris + }, { + subject: db.v('webid'), + predicate: 'http://xmlns.com/foaf/0.1/name', + object: db.v('name') + }], function(err, solution) { + expect(solution).to.eql(parisians); + done(); + }); + }); + }); + +}); From 637cbc512e2f68eec60576dd2bd2c560a31a632e Mon Sep 17 00:00:00 2001 From: scenaristeur Date: Fri, 23 Jun 2023 07:23:50 +0200 Subject: [PATCH 3/4] upgrade outdated deps and remove deprecated istanbul & zuul --- CHANGELOG.md | 11 ++++++++++- package.json | 29 ++++++++++++----------------- test/search_persist_spec.js | 2 +- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88d9557..bca1f4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ + + +### 2.0.1 +- try to fix the issue https://github.com/levelgraph/levelgraph-jsonld/pull/77 +- upgrade outdated dependencies +- remove deprecated istanbul & zul dev-dep, and test using it +- + + + ## 0.4.0 (2014-11-24) @@ -9,4 +19,3 @@ If you need a script to migrate your data please [create new issue](https://github.com/mcollina/levelgraph-jsonld/issues) - diff --git a/package.json b/package.json index cf41dc8..3425b9f 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,11 @@ { "name": "levelgraph-jsonld", - "version": "2.0.0", + "version": "2.0.1", "description": "The Object Document Mapper for LevelGraph based on JSON-LD", "main": "index.js", "scripts": { "test": "./node_modules/.bin/mocha --recursive test", - "zuul": "zuul -- test", - "zuul-local": "zuul --local -- test/*.js", - "coverage": "rm -rf coverage; istanbul cover _mocha -- --recursive --reporter spec --bail", - "publish-coverage": "cat coverage/lcov.info | coveralls" + "publish-coverage": "cat coverage/lcov.info | coveralls" }, "repository": { "type": "git", @@ -33,25 +30,23 @@ "author": "Matteo Collina ", "license": "MIT", "dependencies": { - "async": "^2.1.4", - "jsonld": "0.4.9", - "n3": "^0.10.0", - "uuid": "^3.0.1" + "async": "^3.2.4", + "jsonld": "^8.2.0", + "n3": "^1.16.4", + "uuid": "^9.0.0" }, "peerDependencies": { "levelgraph": "^3.0.0" }, "devDependencies": { - "browserify": "^14.0.0", - "chai": "^4.1.2", - "coveralls": "^3.0.0", - "istanbul": "^0.4.2", + "browserify": "^17.0.0", + "chai": "^4.3.7", + "coveralls": "^3.1.1", "level": "^8.0.0", "level-mem": "^6.0.1", "levelgraph": "^3.0.0", - "lodash": "^4.17.4", - "mocha": "^4.1.0", - "uglify-js": "^3.0.0", - "zuul": "^3.11.1" + "lodash": "^4.17.21", + "mocha": "^10.2.0", + "uglify-js": "^3.17.4" } } diff --git a/test/search_persist_spec.js b/test/search_persist_spec.js index d8f9d07..e0b3404 100644 --- a/test/search_persist_spec.js +++ b/test/search_persist_spec.js @@ -1,7 +1,7 @@ var expect = require('chai').expect; var helper = require('./helper_persist'); -describe('db.search', function() { +describe('db.search persist', function() { var db, gang, manu; From 880d298ed63570f092faa0cbf76c82a4585c0294 Mon Sep 17 00:00:00 2001 From: scenaristeur Date: Fri, 23 Jun 2023 07:56:11 +0200 Subject: [PATCH 4/4] refactor tests --- .gitignore | 2 +- .../16378e4b-44d8-4ed2-b540-c8c89ead60dc.json | 1 + .../f6654ff2-3302-4b07-8a28-508241ae4bef.json | 1 + .../16378e4b-44d8-4ed2-b540-c8c89ead60dc.json | 1 + .../f6654ff2-3302-4b07-8a28-508241ae4bef.json | 1 + .nyc_output/processinfo/index.json | 1 + CHANGELOG.md | 5 +- .../CURRENT | 1 + db/2f84b0db-2ea6-4dae-bf50-81d557f4fa82/LOCK | 0 db/2f84b0db-2ea6-4dae-bf50-81d557f4fa82/LOG | 1 + .../MANIFEST-000002 | Bin 0 -> 50 bytes .../CURRENT | 1 + db/7b82fced-b2ee-4504-91df-210b19350563/LOCK | 0 db/7b82fced-b2ee-4504-91df-210b19350563/LOG | 1 + .../MANIFEST-000002 | Bin 0 -> 50 bytes .../CURRENT | 1 + db/a3f69be2-07c9-4d56-98ce-056680be2ebd/LOCK | 0 db/a3f69be2-07c9-4d56-98ce-056680be2ebd/LOG | 1 + .../MANIFEST-000002 | Bin 0 -> 50 bytes .../CURRENT | 1 + db/d5a9226e-243e-455d-95b9-fd88cd919c6f/LOCK | 0 db/d5a9226e-243e-455d-95b9-fd88cd919c6f/LOG | 1 + .../MANIFEST-000002 | Bin 0 -> 50 bytes package.json | 4 +- test/cut_spec.js | 131 --- test/level.js | 15 + test/put_spec.js | 884 +----------------- test1/cut_spec.js | 137 +++ {test => test1}/datatype_spec.js | 0 {test => test1}/del_spec.js | 0 {test => test1}/fixture/ratatat.json | 0 {test => test1}/get_spec.js | 0 {test => test1}/helper.js | 0 {test => test1}/helper_persist.js | 2 +- {test => test1}/iri_spec.js | 0 {test => test1}/languagetags_spec.js | 0 {test => test1}/mocha.opts | 0 test1/put_spec.js | 869 +++++++++++++++++ {test => test1}/search_persist_spec.js | 0 {test => test1}/search_spec.js | 0 40 files changed, 1056 insertions(+), 1006 deletions(-) create mode 100644 .nyc_output/16378e4b-44d8-4ed2-b540-c8c89ead60dc.json create mode 100644 .nyc_output/f6654ff2-3302-4b07-8a28-508241ae4bef.json create mode 100644 .nyc_output/processinfo/16378e4b-44d8-4ed2-b540-c8c89ead60dc.json create mode 100644 .nyc_output/processinfo/f6654ff2-3302-4b07-8a28-508241ae4bef.json create mode 100644 .nyc_output/processinfo/index.json create mode 100644 db/2f84b0db-2ea6-4dae-bf50-81d557f4fa82/CURRENT create mode 100644 db/2f84b0db-2ea6-4dae-bf50-81d557f4fa82/LOCK create mode 100644 db/2f84b0db-2ea6-4dae-bf50-81d557f4fa82/LOG create mode 100644 db/2f84b0db-2ea6-4dae-bf50-81d557f4fa82/MANIFEST-000002 create mode 100644 db/7b82fced-b2ee-4504-91df-210b19350563/CURRENT create mode 100644 db/7b82fced-b2ee-4504-91df-210b19350563/LOCK create mode 100644 db/7b82fced-b2ee-4504-91df-210b19350563/LOG create mode 100644 db/7b82fced-b2ee-4504-91df-210b19350563/MANIFEST-000002 create mode 100644 db/a3f69be2-07c9-4d56-98ce-056680be2ebd/CURRENT create mode 100644 db/a3f69be2-07c9-4d56-98ce-056680be2ebd/LOCK create mode 100644 db/a3f69be2-07c9-4d56-98ce-056680be2ebd/LOG create mode 100644 db/a3f69be2-07c9-4d56-98ce-056680be2ebd/MANIFEST-000002 create mode 100644 db/d5a9226e-243e-455d-95b9-fd88cd919c6f/CURRENT create mode 100644 db/d5a9226e-243e-455d-95b9-fd88cd919c6f/LOCK create mode 100644 db/d5a9226e-243e-455d-95b9-fd88cd919c6f/LOG create mode 100644 db/d5a9226e-243e-455d-95b9-fd88cd919c6f/MANIFEST-000002 delete mode 100644 test/cut_spec.js create mode 100644 test/level.js create mode 100644 test1/cut_spec.js rename {test => test1}/datatype_spec.js (100%) rename {test => test1}/del_spec.js (100%) rename {test => test1}/fixture/ratatat.json (100%) rename {test => test1}/get_spec.js (100%) rename {test => test1}/helper.js (100%) rename {test => test1}/helper_persist.js (99%) rename {test => test1}/iri_spec.js (100%) rename {test => test1}/languagetags_spec.js (100%) rename {test => test1}/mocha.opts (100%) create mode 100644 test1/put_spec.js rename {test => test1}/search_persist_spec.js (100%) rename {test => test1}/search_spec.js (100%) diff --git a/.gitignore b/.gitignore index 45c27a6..a04f86c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,4 @@ docs .DS_Store coverage/ package-lock.json -yourdb \ No newline at end of file +yourtestdb \ No newline at end of file diff --git a/.nyc_output/16378e4b-44d8-4ed2-b540-c8c89ead60dc.json b/.nyc_output/16378e4b-44d8-4ed2-b540-c8c89ead60dc.json new file mode 100644 index 0000000..6fe7363 --- /dev/null +++ b/.nyc_output/16378e4b-44d8-4ed2-b540-c8c89ead60dc.json @@ -0,0 +1 @@ +{"/home/smag/dev/levelgraph-jsonld/index.js":{"path":"/home/smag/dev/levelgraph-jsonld/index.js","statementMap":{"0":{"start":{"line":1,"column":13},"end":{"line":1,"column":30}},"1":{"start":{"line":2,"column":13},"end":{"line":2,"column":28}},"2":{"start":{"line":3,"column":14},"end":{"line":3,"column":63}},"3":{"start":{"line":4,"column":15},"end":{"line":4,"column":65}},"4":{"start":{"line":5,"column":14},"end":{"line":5,"column":63}},"5":{"start":{"line":6,"column":13},"end":{"line":6,"column":61}},"6":{"start":{"line":7,"column":20},"end":{"line":7,"column":75}},"7":{"start":{"line":8,"column":14},"end":{"line":8,"column":49}},"8":{"start":{"line":9,"column":12},"end":{"line":9,"column":28}},"9":{"start":{"line":10,"column":13},"end":{"line":10,"column":37}},"10":{"start":{"line":14,"column":2},"end":{"line":16,"column":3}},"11":{"start":{"line":15,"column":4},"end":{"line":15,"column":14}},"12":{"start":{"line":18,"column":16},"end":{"line":18,"column":33}},"13":{"start":{"line":20,"column":2},"end":{"line":20,"column":32}},"14":{"start":{"line":21,"column":2},"end":{"line":21,"column":42}},"15":{"start":{"line":23,"column":2},"end":{"line":25,"column":4}},"16":{"start":{"line":30,"column":17},"end":{"line":30,"column":19}},"17":{"start":{"line":33,"column":26},"end":{"line":33,"column":28}},"18":{"start":{"line":35,"column":4},"end":{"line":155,"column":7}},"19":{"start":{"line":36,"column":6},"end":{"line":38,"column":7}},"20":{"start":{"line":37,"column":8},"end":{"line":37,"column":41}},"21":{"start":{"line":39,"column":6},"end":{"line":45,"column":7}},"22":{"start":{"line":40,"column":8},"end":{"line":44,"column":9}},"23":{"start":{"line":41,"column":10},"end":{"line":41,"column":55}},"24":{"start":{"line":43,"column":10},"end":{"line":43,"column":60}},"25":{"start":{"line":47,"column":6},"end":{"line":153,"column":9}},"26":{"start":{"line":48,"column":8},"end":{"line":50,"column":9}},"27":{"start":{"line":49,"column":10},"end":{"line":49,"column":37}},"28":{"start":{"line":52,"column":21},"end":{"line":52,"column":40}},"29":{"start":{"line":54,"column":8},"end":{"line":54,"column":37}},"30":{"start":{"line":55,"column":8},"end":{"line":110,"column":11}},"31":{"start":{"line":56,"column":10},"end":{"line":109,"column":11}},"32":{"start":{"line":59,"column":29},"end":{"line":59,"column":48}},"33":{"start":{"line":62,"column":14},"end":{"line":78,"column":15}},"34":{"start":{"line":63,"column":16},"end":{"line":63,"column":37}},"35":{"start":{"line":64,"column":21},"end":{"line":78,"column":15}},"36":{"start":{"line":65,"column":30},"end":{"line":65,"column":32}},"37":{"start":{"line":66,"column":16},"end":{"line":74,"column":18}},"38":{"start":{"line":67,"column":18},"end":{"line":73,"column":19}},"39":{"start":{"line":68,"column":20},"end":{"line":68,"column":53}},"40":{"start":{"line":69,"column":25},"end":{"line":73,"column":19}},"41":{"start":{"line":70,"column":20},"end":{"line":70,"column":50}},"42":{"start":{"line":72,"column":20},"end":{"line":72,"column":50}},"43":{"start":{"line":75,"column":16},"end":{"line":75,"column":30}},"44":{"start":{"line":77,"column":16},"end":{"line":77,"column":24}},"45":{"start":{"line":81,"column":24},"end":{"line":81,"column":36}},"46":{"start":{"line":83,"column":12},"end":{"line":106,"column":13}},"47":{"start":{"line":84,"column":14},"end":{"line":103,"column":16}},"48":{"start":{"line":85,"column":16},"end":{"line":87,"column":17}},"49":{"start":{"line":86,"column":18},"end":{"line":86,"column":45}},"50":{"start":{"line":88,"column":36},"end":{"line":88,"column":58}},"51":{"start":{"line":90,"column":16},"end":{"line":92,"column":18}},"52":{"start":{"line":91,"column":18},"end":{"line":91,"column":76}},"53":{"start":{"line":93,"column":27},"end":{"line":93,"column":52}},"54":{"start":{"line":94,"column":16},"end":{"line":102,"column":17}},"55":{"start":{"line":95,"column":38},"end":{"line":95,"column":107}},"56":{"start":{"line":96,"column":18},"end":{"line":96,"column":55}},"57":{"start":{"line":97,"column":23},"end":{"line":102,"column":17}},"58":{"start":{"line":98,"column":18},"end":{"line":98,"column":46}},"59":{"start":{"line":101,"column":18},"end":{"line":101,"column":45}},"60":{"start":{"line":105,"column":14},"end":{"line":105,"column":41}},"61":{"start":{"line":108,"column":12},"end":{"line":108,"column":39}},"62":{"start":{"line":112,"column":8},"end":{"line":151,"column":11}},"63":{"start":{"line":114,"column":10},"end":{"line":148,"column":17}},"64":{"start":{"line":115,"column":23},"end":{"line":115,"column":34}},"65":{"start":{"line":118,"column":12},"end":{"line":130,"column":13}},"66":{"start":{"line":119,"column":14},"end":{"line":125,"column":15}},"67":{"start":{"line":122,"column":28},"end":{"line":122,"column":44}},"68":{"start":{"line":123,"column":16},"end":{"line":123,"column":43}},"69":{"start":{"line":124,"column":16},"end":{"line":124,"column":52}},"70":{"start":{"line":126,"column":14},"end":{"line":129,"column":15}},"71":{"start":{"line":128,"column":16},"end":{"line":128,"column":48}},"72":{"start":{"line":133,"column":12},"end":{"line":145,"column":13}},"73":{"start":{"line":134,"column":14},"end":{"line":144,"column":15}},"74":{"start":{"line":135,"column":16},"end":{"line":139,"column":17}},"75":{"start":{"line":136,"column":18},"end":{"line":136,"column":63}},"76":{"start":{"line":138,"column":18},"end":{"line":138,"column":90}},"77":{"start":{"line":140,"column":21},"end":{"line":144,"column":15}},"78":{"start":{"line":141,"column":16},"end":{"line":141,"column":87}},"79":{"start":{"line":143,"column":16},"end":{"line":143,"column":88}},"80":{"start":{"line":146,"column":12},"end":{"line":146,"column":34}},"81":{"start":{"line":147,"column":12},"end":{"line":147,"column":23}},"82":{"start":{"line":150,"column":10},"end":{"line":150,"column":31}},"83":{"start":{"line":152,"column":8},"end":{"line":152,"column":21}},"84":{"start":{"line":159,"column":17},"end":{"line":159,"column":19}},"85":{"start":{"line":160,"column":4},"end":{"line":220,"column":6}},"86":{"start":{"line":161,"column":6},"end":{"line":163,"column":7}},"87":{"start":{"line":162,"column":8},"end":{"line":162,"column":41}},"88":{"start":{"line":165,"column":20},"end":{"line":165,"column":39}},"89":{"start":{"line":166,"column":6},"end":{"line":166,"column":35}},"90":{"start":{"line":167,"column":6},"end":{"line":167,"column":35}},"91":{"start":{"line":169,"column":6},"end":{"line":175,"column":7}},"92":{"start":{"line":170,"column":8},"end":{"line":174,"column":9}},"93":{"start":{"line":171,"column":10},"end":{"line":171,"column":55}},"94":{"start":{"line":173,"column":10},"end":{"line":173,"column":60}},"95":{"start":{"line":177,"column":6},"end":{"line":219,"column":9}},"96":{"start":{"line":178,"column":8},"end":{"line":180,"column":9}},"97":{"start":{"line":179,"column":10},"end":{"line":179,"column":37}},"98":{"start":{"line":182,"column":8},"end":{"line":217,"column":11}},"99":{"start":{"line":184,"column":10},"end":{"line":211,"column":17}},"100":{"start":{"line":185,"column":23},"end":{"line":185,"column":34}},"101":{"start":{"line":188,"column":12},"end":{"line":193,"column":13}},"102":{"start":{"line":189,"column":14},"end":{"line":191,"column":15}},"103":{"start":{"line":190,"column":16},"end":{"line":190,"column":42}},"104":{"start":{"line":192,"column":14},"end":{"line":192,"column":46}},"105":{"start":{"line":196,"column":12},"end":{"line":208,"column":13}},"106":{"start":{"line":197,"column":14},"end":{"line":207,"column":15}},"107":{"start":{"line":198,"column":16},"end":{"line":202,"column":17}},"108":{"start":{"line":199,"column":18},"end":{"line":199,"column":63}},"109":{"start":{"line":201,"column":18},"end":{"line":201,"column":90}},"110":{"start":{"line":203,"column":21},"end":{"line":207,"column":15}},"111":{"start":{"line":204,"column":16},"end":{"line":204,"column":87}},"112":{"start":{"line":206,"column":16},"end":{"line":206,"column":88}},"113":{"start":{"line":209,"column":12},"end":{"line":209,"column":34}},"114":{"start":{"line":210,"column":12},"end":{"line":210,"column":23}},"115":{"start":{"line":214,"column":10},"end":{"line":216,"column":11}},"116":{"start":{"line":215,"column":12},"end":{"line":215,"column":33}},"117":{"start":{"line":218,"column":8},"end":{"line":218,"column":21}},"118":{"start":{"line":224,"column":14},"end":{"line":224,"column":17}},"119":{"start":{"line":225,"column":4},"end":{"line":227,"column":5}},"120":{"start":{"line":226,"column":6},"end":{"line":226,"column":23}},"121":{"start":{"line":228,"column":4},"end":{"line":230,"column":5}},"122":{"start":{"line":229,"column":6},"end":{"line":229,"column":40}},"123":{"start":{"line":232,"column":17},"end":{"line":232,"column":36}},"124":{"start":{"line":233,"column":4},"end":{"line":233,"column":33}},"125":{"start":{"line":234,"column":4},"end":{"line":234,"column":33}},"126":{"start":{"line":236,"column":4},"end":{"line":252,"column":7}},"127":{"start":{"line":237,"column":6},"end":{"line":246,"column":9}},"128":{"start":{"line":238,"column":8},"end":{"line":245,"column":17}},"129":{"start":{"line":239,"column":10},"end":{"line":239,"column":31}},"130":{"start":{"line":240,"column":10},"end":{"line":244,"column":11}},"131":{"start":{"line":241,"column":12},"end":{"line":241,"column":45}},"132":{"start":{"line":243,"column":12},"end":{"line":243,"column":17}},"133":{"start":{"line":248,"column":6},"end":{"line":250,"column":7}},"134":{"start":{"line":249,"column":8},"end":{"line":249,"column":29}},"135":{"start":{"line":251,"column":6},"end":{"line":251,"column":19}},"136":{"start":{"line":255,"column":2},"end":{"line":279,"column":4}},"137":{"start":{"line":257,"column":4},"end":{"line":259,"column":5}},"138":{"start":{"line":258,"column":6},"end":{"line":258,"column":28}},"139":{"start":{"line":261,"column":4},"end":{"line":264,"column":5}},"140":{"start":{"line":262,"column":6},"end":{"line":262,"column":25}},"141":{"start":{"line":263,"column":6},"end":{"line":263,"column":19}},"142":{"start":{"line":266,"column":4},"end":{"line":266,"column":53}},"143":{"start":{"line":267,"column":4},"end":{"line":267,"column":152}},"144":{"start":{"line":269,"column":4},"end":{"line":278,"column":5}},"145":{"start":{"line":270,"column":6},"end":{"line":270,"column":36}},"146":{"start":{"line":272,"column":6},"end":{"line":276,"column":9}},"147":{"start":{"line":273,"column":8},"end":{"line":275,"column":9}},"148":{"start":{"line":274,"column":10},"end":{"line":274,"column":43}},"149":{"start":{"line":277,"column":6},"end":{"line":277,"column":36}},"150":{"start":{"line":281,"column":2},"end":{"line":306,"column":4}},"151":{"start":{"line":283,"column":4},"end":{"line":286,"column":5}},"152":{"start":{"line":284,"column":6},"end":{"line":284,"column":25}},"153":{"start":{"line":285,"column":6},"end":{"line":285,"column":19}},"154":{"start":{"line":288,"column":4},"end":{"line":288,"column":122}},"155":{"start":{"line":289,"column":4},"end":{"line":289,"column":142}},"156":{"start":{"line":291,"column":4},"end":{"line":299,"column":5}},"157":{"start":{"line":292,"column":6},"end":{"line":298,"column":7}},"158":{"start":{"line":293,"column":8},"end":{"line":293,"column":30}},"159":{"start":{"line":295,"column":8},"end":{"line":297,"column":9}},"160":{"start":{"line":296,"column":10},"end":{"line":296,"column":112}},"161":{"start":{"line":301,"column":4},"end":{"line":305,"column":5}},"162":{"start":{"line":302,"column":6},"end":{"line":302,"column":35}},"163":{"start":{"line":304,"column":6},"end":{"line":304,"column":35}},"164":{"start":{"line":309,"column":2},"end":{"line":319,"column":3}},"165":{"start":{"line":311,"column":4},"end":{"line":314,"column":5}},"166":{"start":{"line":312,"column":6},"end":{"line":312,"column":25}},"167":{"start":{"line":313,"column":6},"end":{"line":313,"column":19}},"168":{"start":{"line":316,"column":4},"end":{"line":316,"column":72}},"169":{"start":{"line":318,"column":4},"end":{"line":318,"column":34}},"170":{"start":{"line":323,"column":16},"end":{"line":329,"column":5}},"171":{"start":{"line":330,"column":16},"end":{"line":330,"column":46}},"172":{"start":{"line":331,"column":15},"end":{"line":331,"column":44}},"173":{"start":{"line":332,"column":18},"end":{"line":332,"column":20}},"174":{"start":{"line":333,"column":4},"end":{"line":359,"column":5}},"175":{"start":{"line":336,"column":8},"end":{"line":336,"column":34}},"176":{"start":{"line":337,"column":8},"end":{"line":337,"column":14}},"177":{"start":{"line":339,"column":8},"end":{"line":339,"column":34}},"178":{"start":{"line":340,"column":8},"end":{"line":340,"column":65}},"179":{"start":{"line":341,"column":8},"end":{"line":341,"column":14}},"180":{"start":{"line":343,"column":8},"end":{"line":343,"column":48}},"181":{"start":{"line":344,"column":8},"end":{"line":344,"column":14}},"182":{"start":{"line":346,"column":8},"end":{"line":346,"column":46}},"183":{"start":{"line":347,"column":8},"end":{"line":347,"column":14}},"184":{"start":{"line":349,"column":8},"end":{"line":355,"column":9}},"185":{"start":{"line":350,"column":10},"end":{"line":350,"column":35}},"186":{"start":{"line":351,"column":15},"end":{"line":355,"column":9}},"187":{"start":{"line":352,"column":10},"end":{"line":352,"column":36}},"188":{"start":{"line":354,"column":10},"end":{"line":354,"column":48}},"189":{"start":{"line":356,"column":8},"end":{"line":356,"column":14}},"190":{"start":{"line":358,"column":8},"end":{"line":358,"column":53}},"191":{"start":{"line":360,"column":4},"end":{"line":360,"column":19}},"192":{"start":{"line":364,"column":4},"end":{"line":367,"column":5}},"193":{"start":{"line":365,"column":6},"end":{"line":365,"column":22}},"194":{"start":{"line":366,"column":6},"end":{"line":366,"column":16}},"195":{"start":{"line":369,"column":4},"end":{"line":451,"column":7}},"196":{"start":{"line":370,"column":6},"end":{"line":372,"column":7}},"197":{"start":{"line":371,"column":8},"end":{"line":371,"column":35}},"198":{"start":{"line":374,"column":6},"end":{"line":437,"column":8}},"199":{"start":{"line":377,"column":8},"end":{"line":381,"column":9}},"200":{"start":{"line":378,"column":10},"end":{"line":378,"column":58}},"201":{"start":{"line":379,"column":15},"end":{"line":381,"column":9}},"202":{"start":{"line":380,"column":10},"end":{"line":380,"column":35}},"203":{"start":{"line":382,"column":8},"end":{"line":426,"column":9}},"204":{"start":{"line":383,"column":10},"end":{"line":387,"column":11}},"205":{"start":{"line":384,"column":12},"end":{"line":384,"column":61}},"206":{"start":{"line":386,"column":12},"end":{"line":386,"column":59}},"207":{"start":{"line":388,"column":10},"end":{"line":388,"column":31}},"208":{"start":{"line":389,"column":15},"end":{"line":426,"column":9}},"209":{"start":{"line":390,"column":23},"end":{"line":390,"column":25}},"210":{"start":{"line":391,"column":10},"end":{"line":395,"column":11}},"211":{"start":{"line":392,"column":12},"end":{"line":392,"column":42}},"212":{"start":{"line":393,"column":17},"end":{"line":395,"column":11}},"213":{"start":{"line":394,"column":12},"end":{"line":394,"column":53}},"214":{"start":{"line":396,"column":10},"end":{"line":414,"column":11}},"215":{"start":{"line":398,"column":12},"end":{"line":406,"column":15}},"216":{"start":{"line":399,"column":14},"end":{"line":399,"column":101}},"217":{"start":{"line":399,"column":58},"end":{"line":399,"column":101}},"218":{"start":{"line":400,"column":14},"end":{"line":404,"column":15}},"219":{"start":{"line":401,"column":16},"end":{"line":401,"column":84}},"220":{"start":{"line":403,"column":16},"end":{"line":403,"column":67}},"221":{"start":{"line":405,"column":14},"end":{"line":405,"column":34}},"222":{"start":{"line":408,"column":15},"end":{"line":414,"column":11}},"223":{"start":{"line":409,"column":12},"end":{"line":409,"column":105}},"224":{"start":{"line":410,"column":12},"end":{"line":410,"column":32}},"225":{"start":{"line":412,"column":12},"end":{"line":412,"column":94}},"226":{"start":{"line":413,"column":12},"end":{"line":413,"column":32}},"227":{"start":{"line":417,"column":10},"end":{"line":425,"column":13}},"228":{"start":{"line":418,"column":12},"end":{"line":418,"column":99}},"229":{"start":{"line":418,"column":56},"end":{"line":418,"column":99}},"230":{"start":{"line":419,"column":12},"end":{"line":423,"column":13}},"231":{"start":{"line":420,"column":14},"end":{"line":420,"column":124}},"232":{"start":{"line":422,"column":14},"end":{"line":422,"column":107}},"233":{"start":{"line":424,"column":12},"end":{"line":424,"column":32}},"234":{"start":{"line":428,"column":8},"end":{"line":428,"column":37}},"235":{"start":{"line":428,"column":17},"end":{"line":428,"column":37}},"236":{"start":{"line":430,"column":8},"end":{"line":434,"column":9}},"237":{"start":{"line":432,"column":21},"end":{"line":432,"column":56}},"238":{"start":{"line":433,"column":10},"end":{"line":433,"column":27}},"239":{"start":{"line":436,"column":8},"end":{"line":436,"column":29}},"240":{"start":{"line":440,"column":19},"end":{"line":440,"column":21}},"241":{"start":{"line":441,"column":8},"end":{"line":441,"column":42}},"242":{"start":{"line":442,"column":8},"end":{"line":448,"column":9}},"243":{"start":{"line":443,"column":10},"end":{"line":447,"column":11}},"244":{"start":{"line":444,"column":12},"end":{"line":444,"column":57}},"245":{"start":{"line":445,"column":17},"end":{"line":447,"column":11}},"246":{"start":{"line":446,"column":12},"end":{"line":446,"column":45}},"247":{"start":{"line":449,"column":8},"end":{"line":449,"column":19}},"248":{"start":{"line":454,"column":2},"end":{"line":467,"column":4}},"249":{"start":{"line":456,"column":4},"end":{"line":459,"column":5}},"250":{"start":{"line":457,"column":6},"end":{"line":457,"column":25}},"251":{"start":{"line":458,"column":6},"end":{"line":458,"column":19}},"252":{"start":{"line":461,"column":4},"end":{"line":466,"column":7}},"253":{"start":{"line":462,"column":6},"end":{"line":464,"column":7}},"254":{"start":{"line":463,"column":8},"end":{"line":463,"column":39}},"255":{"start":{"line":465,"column":6},"end":{"line":465,"column":64}},"256":{"start":{"line":469,"column":2},"end":{"line":469,"column":17}},"257":{"start":{"line":472,"column":0},"end":{"line":472,"column":34}}},"fnMap":{"0":{"name":"levelgraphJSONLD","decl":{"start":{"line":12,"column":9},"end":{"line":12,"column":25}},"loc":{"start":{"line":12,"column":42},"end":{"line":470,"column":1}},"line":12},"1":{"name":"doPut","decl":{"start":{"line":27,"column":11},"end":{"line":27,"column":16}},"loc":{"start":{"line":27,"column":41},"end":{"line":156,"column":3}},"line":27},"2":{"name":"(anonymous_2)","decl":{"start":{"line":35,"column":23},"end":{"line":35,"column":24}},"loc":{"start":{"line":35,"column":47},"end":{"line":155,"column":5}},"line":35},"3":{"name":"(anonymous_3)","decl":{"start":{"line":47,"column":38},"end":{"line":47,"column":39}},"loc":{"start":{"line":47,"column":61},"end":{"line":153,"column":7}},"line":47},"4":{"name":"(anonymous_4)","decl":{"start":{"line":55,"column":27},"end":{"line":55,"column":28}},"loc":{"start":{"line":55,"column":38},"end":{"line":110,"column":9}},"line":55},"5":{"name":"framify","decl":{"start":{"line":61,"column":21},"end":{"line":61,"column":28}},"loc":{"start":{"line":61,"column":32},"end":{"line":79,"column":13}},"line":61},"6":{"name":"(anonymous_6)","decl":{"start":{"line":66,"column":39},"end":{"line":66,"column":40}},"loc":{"start":{"line":66,"column":53},"end":{"line":74,"column":17}},"line":66},"7":{"name":"(anonymous_7)","decl":{"start":{"line":84,"column":39},"end":{"line":84,"column":40}},"loc":{"start":{"line":84,"column":61},"end":{"line":103,"column":15}},"line":84},"8":{"name":"(anonymous_8)","decl":{"start":{"line":90,"column":35},"end":{"line":90,"column":36}},"loc":{"start":{"line":90,"column":51},"end":{"line":92,"column":17}},"line":90},"9":{"name":"(anonymous_9)","decl":{"start":{"line":112,"column":32},"end":{"line":112,"column":33}},"loc":{"start":{"line":112,"column":49},"end":{"line":149,"column":9}},"line":112},"10":{"name":"(anonymous_10)","decl":{"start":{"line":114,"column":59},"end":{"line":114,"column":60}},"loc":{"start":{"line":114,"column":78},"end":{"line":148,"column":11}},"line":114},"11":{"name":"(anonymous_11)","decl":{"start":{"line":149,"column":19},"end":{"line":149,"column":20}},"loc":{"start":{"line":149,"column":36},"end":{"line":151,"column":9}},"line":149},"12":{"name":"doDel","decl":{"start":{"line":158,"column":11},"end":{"line":158,"column":16}},"loc":{"start":{"line":158,"column":41},"end":{"line":221,"column":3}},"line":158},"13":{"name":"(anonymous_13)","decl":{"start":{"line":160,"column":32},"end":{"line":160,"column":33}},"loc":{"start":{"line":160,"column":56},"end":{"line":220,"column":5}},"line":160},"14":{"name":"(anonymous_14)","decl":{"start":{"line":177,"column":38},"end":{"line":177,"column":39}},"loc":{"start":{"line":177,"column":61},"end":{"line":219,"column":7}},"line":177},"15":{"name":"(anonymous_15)","decl":{"start":{"line":182,"column":32},"end":{"line":182,"column":33}},"loc":{"start":{"line":182,"column":49},"end":{"line":212,"column":9}},"line":182},"16":{"name":"(anonymous_16)","decl":{"start":{"line":184,"column":59},"end":{"line":184,"column":60}},"loc":{"start":{"line":184,"column":78},"end":{"line":211,"column":11}},"line":184},"17":{"name":"(anonymous_17)","decl":{"start":{"line":212,"column":19},"end":{"line":212,"column":20}},"loc":{"start":{"line":212,"column":36},"end":{"line":217,"column":9}},"line":212},"18":{"name":"doCut","decl":{"start":{"line":223,"column":11},"end":{"line":223,"column":16}},"loc":{"start":{"line":223,"column":41},"end":{"line":253,"column":3}},"line":223},"19":{"name":"delAllTriples","decl":{"start":{"line":236,"column":14},"end":{"line":236,"column":27}},"loc":{"start":{"line":236,"column":39},"end":{"line":247,"column":5}},"line":236},"20":{"name":"(anonymous_20)","decl":{"start":{"line":237,"column":36},"end":{"line":237,"column":37}},"loc":{"start":{"line":237,"column":59},"end":{"line":246,"column":7}},"line":237},"21":{"name":"(anonymous_21)","decl":{"start":{"line":238,"column":28},"end":{"line":238,"column":29}},"loc":{"start":{"line":238,"column":49},"end":{"line":245,"column":9}},"line":238},"22":{"name":"(anonymous_22)","decl":{"start":{"line":247,"column":12},"end":{"line":247,"column":13}},"loc":{"start":{"line":247,"column":26},"end":{"line":252,"column":5}},"line":247},"23":{"name":"(anonymous_23)","decl":{"start":{"line":255,"column":23},"end":{"line":255,"column":24}},"loc":{"start":{"line":255,"column":56},"end":{"line":279,"column":3}},"line":255},"24":{"name":"(anonymous_24)","decl":{"start":{"line":272,"column":39},"end":{"line":272,"column":40}},"loc":{"start":{"line":272,"column":53},"end":{"line":276,"column":7}},"line":272},"25":{"name":"(anonymous_25)","decl":{"start":{"line":281,"column":23},"end":{"line":281,"column":24}},"loc":{"start":{"line":281,"column":56},"end":{"line":306,"column":3}},"line":281},"26":{"name":"(anonymous_26)","decl":{"start":{"line":309,"column":23},"end":{"line":309,"column":24}},"loc":{"start":{"line":309,"column":56},"end":{"line":319,"column":3}},"line":309},"27":{"name":"getCoercedObject","decl":{"start":{"line":322,"column":11},"end":{"line":322,"column":27}},"loc":{"start":{"line":322,"column":36},"end":{"line":361,"column":3}},"line":322},"28":{"name":"fetchExpandedTriples","decl":{"start":{"line":363,"column":11},"end":{"line":363,"column":31}},"loc":{"start":{"line":363,"column":53},"end":{"line":452,"column":3}},"line":363},"29":{"name":"(anonymous_29)","decl":{"start":{"line":369,"column":34},"end":{"line":369,"column":35}},"loc":{"start":{"line":369,"column":57},"end":{"line":451,"column":5}},"line":369},"30":{"name":"(anonymous_30)","decl":{"start":{"line":374,"column":34},"end":{"line":374,"column":35}},"loc":{"start":{"line":374,"column":60},"end":{"line":427,"column":7}},"line":374},"31":{"name":"(anonymous_31)","decl":{"start":{"line":398,"column":48},"end":{"line":398,"column":49}},"loc":{"start":{"line":398,"column":72},"end":{"line":406,"column":13}},"line":398},"32":{"name":"(anonymous_32)","decl":{"start":{"line":417,"column":46},"end":{"line":417,"column":47}},"loc":{"start":{"line":417,"column":70},"end":{"line":425,"column":11}},"line":417},"33":{"name":"(anonymous_33)","decl":{"start":{"line":427,"column":9},"end":{"line":427,"column":10}},"loc":{"start":{"line":427,"column":31},"end":{"line":437,"column":7}},"line":427},"34":{"name":"gatherList","decl":{"start":{"line":439,"column":15},"end":{"line":439,"column":25}},"loc":{"start":{"line":439,"column":32},"end":{"line":450,"column":7}},"line":439},"35":{"name":"(anonymous_35)","decl":{"start":{"line":454,"column":23},"end":{"line":454,"column":24}},"loc":{"start":{"line":454,"column":65},"end":{"line":467,"column":3}},"line":454},"36":{"name":"(anonymous_36)","decl":{"start":{"line":461,"column":30},"end":{"line":461,"column":31}},"loc":{"start":{"line":461,"column":54},"end":{"line":466,"column":5}},"line":461}},"branchMap":{"0":{"loc":{"start":{"line":14,"column":2},"end":{"line":16,"column":3}},"type":"if","locations":[{"start":{"line":14,"column":2},"end":{"line":16,"column":3}},{"start":{"line":14,"column":2},"end":{"line":16,"column":3}}],"line":14},"1":{"loc":{"start":{"line":20,"column":15},"end":{"line":20,"column":31}},"type":"binary-expr","locations":[{"start":{"line":20,"column":15},"end":{"line":20,"column":25}},{"start":{"line":20,"column":29},"end":{"line":20,"column":31}}],"line":20},"2":{"loc":{"start":{"line":21,"column":20},"end":{"line":21,"column":41}},"type":"binary-expr","locations":[{"start":{"line":21,"column":20},"end":{"line":21,"column":35}},{"start":{"line":21,"column":39},"end":{"line":21,"column":41}}],"line":21},"3":{"loc":{"start":{"line":36,"column":6},"end":{"line":38,"column":7}},"type":"if","locations":[{"start":{"line":36,"column":6},"end":{"line":38,"column":7}},{"start":{"line":36,"column":6},"end":{"line":38,"column":7}}],"line":36},"4":{"loc":{"start":{"line":37,"column":15},"end":{"line":37,"column":40}},"type":"binary-expr","locations":[{"start":{"line":37,"column":15},"end":{"line":37,"column":23}},{"start":{"line":37,"column":27},"end":{"line":37,"column":40}}],"line":37},"5":{"loc":{"start":{"line":39,"column":6},"end":{"line":45,"column":7}},"type":"if","locations":[{"start":{"line":39,"column":6},"end":{"line":45,"column":7}},{"start":{"line":39,"column":6},"end":{"line":45,"column":7}}],"line":39},"6":{"loc":{"start":{"line":40,"column":8},"end":{"line":44,"column":9}},"type":"if","locations":[{"start":{"line":40,"column":8},"end":{"line":44,"column":9}},{"start":{"line":40,"column":8},"end":{"line":44,"column":9}}],"line":40},"7":{"loc":{"start":{"line":48,"column":8},"end":{"line":50,"column":9}},"type":"if","locations":[{"start":{"line":48,"column":8},"end":{"line":50,"column":9}},{"start":{"line":48,"column":8},"end":{"line":50,"column":9}}],"line":48},"8":{"loc":{"start":{"line":48,"column":12},"end":{"line":48,"column":39}},"type":"binary-expr","locations":[{"start":{"line":48,"column":12},"end":{"line":48,"column":15}},{"start":{"line":48,"column":19},"end":{"line":48,"column":39}}],"line":48},"9":{"loc":{"start":{"line":56,"column":10},"end":{"line":109,"column":11}},"type":"if","locations":[{"start":{"line":56,"column":10},"end":{"line":109,"column":11}},{"start":{"line":56,"column":10},"end":{"line":109,"column":11}}],"line":56},"10":{"loc":{"start":{"line":62,"column":14},"end":{"line":78,"column":15}},"type":"if","locations":[{"start":{"line":62,"column":14},"end":{"line":78,"column":15}},{"start":{"line":62,"column":14},"end":{"line":78,"column":15}}],"line":62},"11":{"loc":{"start":{"line":64,"column":21},"end":{"line":78,"column":15}},"type":"if","locations":[{"start":{"line":64,"column":21},"end":{"line":78,"column":15}},{"start":{"line":64,"column":21},"end":{"line":78,"column":15}}],"line":64},"12":{"loc":{"start":{"line":67,"column":18},"end":{"line":73,"column":19}},"type":"if","locations":[{"start":{"line":67,"column":18},"end":{"line":73,"column":19}},{"start":{"line":67,"column":18},"end":{"line":73,"column":19}}],"line":67},"13":{"loc":{"start":{"line":67,"column":22},"end":{"line":67,"column":61}},"type":"binary-expr","locations":[{"start":{"line":67,"column":22},"end":{"line":67,"column":43}},{"start":{"line":67,"column":47},"end":{"line":67,"column":61}}],"line":67},"14":{"loc":{"start":{"line":69,"column":25},"end":{"line":73,"column":19}},"type":"if","locations":[{"start":{"line":69,"column":25},"end":{"line":73,"column":19}},{"start":{"line":69,"column":25},"end":{"line":73,"column":19}}],"line":69},"15":{"loc":{"start":{"line":69,"column":29},"end":{"line":69,"column":81}},"type":"binary-expr","locations":[{"start":{"line":69,"column":29},"end":{"line":69,"column":51}},{"start":{"line":69,"column":55},"end":{"line":69,"column":81}}],"line":69},"16":{"loc":{"start":{"line":83,"column":12},"end":{"line":106,"column":13}},"type":"if","locations":[{"start":{"line":83,"column":12},"end":{"line":106,"column":13}},{"start":{"line":83,"column":12},"end":{"line":106,"column":13}}],"line":83},"17":{"loc":{"start":{"line":85,"column":16},"end":{"line":87,"column":17}},"type":"if","locations":[{"start":{"line":85,"column":16},"end":{"line":87,"column":17}},{"start":{"line":85,"column":16},"end":{"line":87,"column":17}}],"line":85},"18":{"loc":{"start":{"line":94,"column":16},"end":{"line":102,"column":17}},"type":"if","locations":[{"start":{"line":94,"column":16},"end":{"line":102,"column":17}},{"start":{"line":94,"column":16},"end":{"line":102,"column":17}}],"line":94},"19":{"loc":{"start":{"line":97,"column":23},"end":{"line":102,"column":17}},"type":"if","locations":[{"start":{"line":97,"column":23},"end":{"line":102,"column":17}},{"start":{"line":97,"column":23},"end":{"line":102,"column":17}}],"line":97},"20":{"loc":{"start":{"line":118,"column":12},"end":{"line":130,"column":13}},"type":"if","locations":[{"start":{"line":118,"column":12},"end":{"line":130,"column":13}},{"start":{"line":118,"column":12},"end":{"line":130,"column":13}}],"line":118},"21":{"loc":{"start":{"line":119,"column":14},"end":{"line":125,"column":15}},"type":"if","locations":[{"start":{"line":119,"column":14},"end":{"line":125,"column":15}},{"start":{"line":119,"column":14},"end":{"line":125,"column":15}}],"line":119},"22":{"loc":{"start":{"line":119,"column":18},"end":{"line":121,"column":53}},"type":"binary-expr","locations":[{"start":{"line":119,"column":18},"end":{"line":119,"column":41}},{"start":{"line":121,"column":21},"end":{"line":121,"column":53}}],"line":119},"23":{"loc":{"start":{"line":126,"column":14},"end":{"line":129,"column":15}},"type":"if","locations":[{"start":{"line":126,"column":14},"end":{"line":129,"column":15}},{"start":{"line":126,"column":14},"end":{"line":129,"column":15}}],"line":126},"24":{"loc":{"start":{"line":133,"column":12},"end":{"line":145,"column":13}},"type":"if","locations":[{"start":{"line":133,"column":12},"end":{"line":145,"column":13}},{"start":{"line":133,"column":12},"end":{"line":145,"column":13}}],"line":133},"25":{"loc":{"start":{"line":133,"column":15},"end":{"line":133,"column":57}},"type":"binary-expr","locations":[{"start":{"line":133,"column":15},"end":{"line":133,"column":31}},{"start":{"line":133,"column":35},"end":{"line":133,"column":57}}],"line":133},"26":{"loc":{"start":{"line":134,"column":14},"end":{"line":144,"column":15}},"type":"if","locations":[{"start":{"line":134,"column":14},"end":{"line":144,"column":15}},{"start":{"line":134,"column":14},"end":{"line":144,"column":15}}],"line":134},"27":{"loc":{"start":{"line":135,"column":16},"end":{"line":139,"column":17}},"type":"if","locations":[{"start":{"line":135,"column":16},"end":{"line":139,"column":17}},{"start":{"line":135,"column":16},"end":{"line":139,"column":17}}],"line":135},"28":{"loc":{"start":{"line":140,"column":21},"end":{"line":144,"column":15}},"type":"if","locations":[{"start":{"line":140,"column":21},"end":{"line":144,"column":15}},{"start":{"line":140,"column":21},"end":{"line":144,"column":15}}],"line":140},"29":{"loc":{"start":{"line":161,"column":6},"end":{"line":163,"column":7}},"type":"if","locations":[{"start":{"line":161,"column":6},"end":{"line":163,"column":7}},{"start":{"line":161,"column":6},"end":{"line":163,"column":7}}],"line":161},"30":{"loc":{"start":{"line":162,"column":15},"end":{"line":162,"column":40}},"type":"binary-expr","locations":[{"start":{"line":162,"column":15},"end":{"line":162,"column":23}},{"start":{"line":162,"column":27},"end":{"line":162,"column":40}}],"line":162},"31":{"loc":{"start":{"line":169,"column":6},"end":{"line":175,"column":7}},"type":"if","locations":[{"start":{"line":169,"column":6},"end":{"line":175,"column":7}},{"start":{"line":169,"column":6},"end":{"line":175,"column":7}}],"line":169},"32":{"loc":{"start":{"line":170,"column":8},"end":{"line":174,"column":9}},"type":"if","locations":[{"start":{"line":170,"column":8},"end":{"line":174,"column":9}},{"start":{"line":170,"column":8},"end":{"line":174,"column":9}}],"line":170},"33":{"loc":{"start":{"line":178,"column":8},"end":{"line":180,"column":9}},"type":"if","locations":[{"start":{"line":178,"column":8},"end":{"line":180,"column":9}},{"start":{"line":178,"column":8},"end":{"line":180,"column":9}}],"line":178},"34":{"loc":{"start":{"line":178,"column":12},"end":{"line":178,"column":39}},"type":"binary-expr","locations":[{"start":{"line":178,"column":12},"end":{"line":178,"column":15}},{"start":{"line":178,"column":19},"end":{"line":178,"column":39}}],"line":178},"35":{"loc":{"start":{"line":188,"column":12},"end":{"line":193,"column":13}},"type":"if","locations":[{"start":{"line":188,"column":12},"end":{"line":193,"column":13}},{"start":{"line":188,"column":12},"end":{"line":193,"column":13}}],"line":188},"36":{"loc":{"start":{"line":189,"column":14},"end":{"line":191,"column":15}},"type":"if","locations":[{"start":{"line":189,"column":14},"end":{"line":191,"column":15}},{"start":{"line":189,"column":14},"end":{"line":191,"column":15}}],"line":189},"37":{"loc":{"start":{"line":196,"column":12},"end":{"line":208,"column":13}},"type":"if","locations":[{"start":{"line":196,"column":12},"end":{"line":208,"column":13}},{"start":{"line":196,"column":12},"end":{"line":208,"column":13}}],"line":196},"38":{"loc":{"start":{"line":196,"column":15},"end":{"line":196,"column":57}},"type":"binary-expr","locations":[{"start":{"line":196,"column":15},"end":{"line":196,"column":31}},{"start":{"line":196,"column":35},"end":{"line":196,"column":57}}],"line":196},"39":{"loc":{"start":{"line":197,"column":14},"end":{"line":207,"column":15}},"type":"if","locations":[{"start":{"line":197,"column":14},"end":{"line":207,"column":15}},{"start":{"line":197,"column":14},"end":{"line":207,"column":15}}],"line":197},"40":{"loc":{"start":{"line":198,"column":16},"end":{"line":202,"column":17}},"type":"if","locations":[{"start":{"line":198,"column":16},"end":{"line":202,"column":17}},{"start":{"line":198,"column":16},"end":{"line":202,"column":17}}],"line":198},"41":{"loc":{"start":{"line":203,"column":21},"end":{"line":207,"column":15}},"type":"if","locations":[{"start":{"line":203,"column":21},"end":{"line":207,"column":15}},{"start":{"line":203,"column":21},"end":{"line":207,"column":15}}],"line":203},"42":{"loc":{"start":{"line":214,"column":10},"end":{"line":216,"column":11}},"type":"if","locations":[{"start":{"line":214,"column":10},"end":{"line":216,"column":11}},{"start":{"line":214,"column":10},"end":{"line":216,"column":11}}],"line":214},"43":{"loc":{"start":{"line":214,"column":14},"end":{"line":214,"column":85}},"type":"binary-expr","locations":[{"start":{"line":214,"column":14},"end":{"line":214,"column":48}},{"start":{"line":214,"column":52},"end":{"line":214,"column":85}}],"line":214},"44":{"loc":{"start":{"line":225,"column":4},"end":{"line":227,"column":5}},"type":"if","locations":[{"start":{"line":225,"column":4},"end":{"line":227,"column":5}},{"start":{"line":225,"column":4},"end":{"line":227,"column":5}}],"line":225},"45":{"loc":{"start":{"line":228,"column":4},"end":{"line":230,"column":5}},"type":"if","locations":[{"start":{"line":228,"column":4},"end":{"line":230,"column":5}},{"start":{"line":228,"column":4},"end":{"line":230,"column":5}}],"line":228},"46":{"loc":{"start":{"line":229,"column":13},"end":{"line":229,"column":39}},"type":"binary-expr","locations":[{"start":{"line":229,"column":13},"end":{"line":229,"column":21}},{"start":{"line":229,"column":25},"end":{"line":229,"column":39}}],"line":229},"47":{"loc":{"start":{"line":240,"column":10},"end":{"line":244,"column":11}},"type":"if","locations":[{"start":{"line":240,"column":10},"end":{"line":244,"column":11}},{"start":{"line":240,"column":10},"end":{"line":244,"column":11}}],"line":240},"48":{"loc":{"start":{"line":240,"column":14},"end":{"line":240,"column":99}},"type":"binary-expr","locations":[{"start":{"line":240,"column":14},"end":{"line":240,"column":47}},{"start":{"line":240,"column":52},"end":{"line":240,"column":67}},{"start":{"line":240,"column":71},"end":{"line":240,"column":98}}],"line":240},"49":{"loc":{"start":{"line":248,"column":6},"end":{"line":250,"column":7}},"type":"if","locations":[{"start":{"line":248,"column":6},"end":{"line":250,"column":7}},{"start":{"line":248,"column":6},"end":{"line":250,"column":7}}],"line":248},"50":{"loc":{"start":{"line":257,"column":4},"end":{"line":259,"column":5}},"type":"if","locations":[{"start":{"line":257,"column":4},"end":{"line":259,"column":5}},{"start":{"line":257,"column":4},"end":{"line":259,"column":5}}],"line":257},"51":{"loc":{"start":{"line":261,"column":4},"end":{"line":264,"column":5}},"type":"if","locations":[{"start":{"line":261,"column":4},"end":{"line":264,"column":5}},{"start":{"line":261,"column":4},"end":{"line":264,"column":5}}],"line":261},"52":{"loc":{"start":{"line":266,"column":19},"end":{"line":266,"column":52}},"type":"binary-expr","locations":[{"start":{"line":266,"column":19},"end":{"line":266,"column":31}},{"start":{"line":266,"column":35},"end":{"line":266,"column":52}}],"line":266},"53":{"loc":{"start":{"line":267,"column":24},"end":{"line":267,"column":151}},"type":"cond-expr","locations":[{"start":{"line":267,"column":58},"end":{"line":267,"column":75}},{"start":{"line":267,"column":80},"end":{"line":267,"column":149}}],"line":267},"54":{"loc":{"start":{"line":267,"column":80},"end":{"line":267,"column":149}},"type":"cond-expr","locations":[{"start":{"line":267,"column":119},"end":{"line":267,"column":141}},{"start":{"line":267,"column":144},"end":{"line":267,"column":149}}],"line":267},"55":{"loc":{"start":{"line":269,"column":4},"end":{"line":278,"column":5}},"type":"if","locations":[{"start":{"line":269,"column":4},"end":{"line":278,"column":5}},{"start":{"line":269,"column":4},"end":{"line":278,"column":5}}],"line":269},"56":{"loc":{"start":{"line":273,"column":8},"end":{"line":275,"column":9}},"type":"if","locations":[{"start":{"line":273,"column":8},"end":{"line":275,"column":9}},{"start":{"line":273,"column":8},"end":{"line":275,"column":9}}],"line":273},"57":{"loc":{"start":{"line":274,"column":17},"end":{"line":274,"column":42}},"type":"binary-expr","locations":[{"start":{"line":274,"column":17},"end":{"line":274,"column":25}},{"start":{"line":274,"column":29},"end":{"line":274,"column":42}}],"line":274},"58":{"loc":{"start":{"line":283,"column":4},"end":{"line":286,"column":5}},"type":"if","locations":[{"start":{"line":283,"column":4},"end":{"line":286,"column":5}},{"start":{"line":283,"column":4},"end":{"line":286,"column":5}}],"line":283},"59":{"loc":{"start":{"line":288,"column":18},"end":{"line":288,"column":121}},"type":"cond-expr","locations":[{"start":{"line":288,"column":46},"end":{"line":288,"column":57}},{"start":{"line":288,"column":62},"end":{"line":288,"column":119}}],"line":288},"60":{"loc":{"start":{"line":288,"column":62},"end":{"line":288,"column":119}},"type":"cond-expr","locations":[{"start":{"line":288,"column":95},"end":{"line":288,"column":111}},{"start":{"line":288,"column":114},"end":{"line":288,"column":119}}],"line":288},"61":{"loc":{"start":{"line":289,"column":22},"end":{"line":289,"column":141}},"type":"cond-expr","locations":[{"start":{"line":289,"column":54},"end":{"line":289,"column":69}},{"start":{"line":289,"column":74},"end":{"line":289,"column":139}}],"line":289},"62":{"loc":{"start":{"line":289,"column":74},"end":{"line":289,"column":139}},"type":"cond-expr","locations":[{"start":{"line":289,"column":111},"end":{"line":289,"column":131}},{"start":{"line":289,"column":134},"end":{"line":289,"column":139}}],"line":289},"63":{"loc":{"start":{"line":291,"column":4},"end":{"line":299,"column":5}},"type":"if","locations":[{"start":{"line":291,"column":4},"end":{"line":299,"column":5}},{"start":{"line":291,"column":4},"end":{"line":299,"column":5}}],"line":291},"64":{"loc":{"start":{"line":295,"column":8},"end":{"line":297,"column":9}},"type":"if","locations":[{"start":{"line":295,"column":8},"end":{"line":297,"column":9}},{"start":{"line":295,"column":8},"end":{"line":297,"column":9}}],"line":295},"65":{"loc":{"start":{"line":295,"column":12},"end":{"line":295,"column":45}},"type":"binary-expr","locations":[{"start":{"line":295,"column":12},"end":{"line":295,"column":29}},{"start":{"line":295,"column":33},"end":{"line":295,"column":45}}],"line":295},"66":{"loc":{"start":{"line":301,"column":4},"end":{"line":305,"column":5}},"type":"if","locations":[{"start":{"line":301,"column":4},"end":{"line":305,"column":5}},{"start":{"line":301,"column":4},"end":{"line":305,"column":5}}],"line":301},"67":{"loc":{"start":{"line":311,"column":4},"end":{"line":314,"column":5}},"type":"if","locations":[{"start":{"line":311,"column":4},"end":{"line":314,"column":5}},{"start":{"line":311,"column":4},"end":{"line":314,"column":5}}],"line":311},"68":{"loc":{"start":{"line":316,"column":22},"end":{"line":316,"column":71}},"type":"binary-expr","locations":[{"start":{"line":316,"column":22},"end":{"line":316,"column":37}},{"start":{"line":316,"column":42},"end":{"line":316,"column":62}},{"start":{"line":316,"column":66},"end":{"line":316,"column":71}}],"line":316},"69":{"loc":{"start":{"line":333,"column":4},"end":{"line":359,"column":5}},"type":"switch","locations":[{"start":{"line":334,"column":6},"end":{"line":334,"column":24}},{"start":{"line":335,"column":6},"end":{"line":337,"column":14}},{"start":{"line":338,"column":6},"end":{"line":341,"column":14}},{"start":{"line":342,"column":6},"end":{"line":344,"column":14}},{"start":{"line":345,"column":6},"end":{"line":347,"column":14}},{"start":{"line":348,"column":6},"end":{"line":356,"column":14}},{"start":{"line":357,"column":6},"end":{"line":358,"column":53}}],"line":333},"70":{"loc":{"start":{"line":349,"column":8},"end":{"line":355,"column":9}},"type":"if","locations":[{"start":{"line":349,"column":8},"end":{"line":355,"column":9}},{"start":{"line":349,"column":8},"end":{"line":355,"column":9}}],"line":349},"71":{"loc":{"start":{"line":349,"column":12},"end":{"line":349,"column":45}},"type":"binary-expr","locations":[{"start":{"line":349,"column":12},"end":{"line":349,"column":28}},{"start":{"line":349,"column":32},"end":{"line":349,"column":45}}],"line":349},"72":{"loc":{"start":{"line":351,"column":15},"end":{"line":355,"column":9}},"type":"if","locations":[{"start":{"line":351,"column":15},"end":{"line":355,"column":9}},{"start":{"line":351,"column":15},"end":{"line":355,"column":9}}],"line":351},"73":{"loc":{"start":{"line":351,"column":19},"end":{"line":351,"column":53}},"type":"binary-expr","locations":[{"start":{"line":351,"column":19},"end":{"line":351,"column":36}},{"start":{"line":351,"column":40},"end":{"line":351,"column":53}}],"line":351},"74":{"loc":{"start":{"line":364,"column":4},"end":{"line":367,"column":5}},"type":"if","locations":[{"start":{"line":364,"column":4},"end":{"line":367,"column":5}},{"start":{"line":364,"column":4},"end":{"line":367,"column":5}}],"line":364},"75":{"loc":{"start":{"line":370,"column":6},"end":{"line":372,"column":7}},"type":"if","locations":[{"start":{"line":370,"column":6},"end":{"line":372,"column":7}},{"start":{"line":370,"column":6},"end":{"line":372,"column":7}}],"line":370},"76":{"loc":{"start":{"line":370,"column":10},"end":{"line":370,"column":37}},"type":"binary-expr","locations":[{"start":{"line":370,"column":10},"end":{"line":370,"column":13}},{"start":{"line":370,"column":17},"end":{"line":370,"column":37}}],"line":370},"77":{"loc":{"start":{"line":377,"column":8},"end":{"line":381,"column":9}},"type":"if","locations":[{"start":{"line":377,"column":8},"end":{"line":381,"column":9}},{"start":{"line":377,"column":8},"end":{"line":381,"column":9}}],"line":377},"78":{"loc":{"start":{"line":377,"column":12},"end":{"line":377,"column":67}},"type":"binary-expr","locations":[{"start":{"line":377,"column":12},"end":{"line":377,"column":32}},{"start":{"line":377,"column":36},"end":{"line":377,"column":67}}],"line":377},"79":{"loc":{"start":{"line":379,"column":15},"end":{"line":381,"column":9}},"type":"if","locations":[{"start":{"line":379,"column":15},"end":{"line":381,"column":9}},{"start":{"line":379,"column":15},"end":{"line":381,"column":9}}],"line":379},"80":{"loc":{"start":{"line":379,"column":19},"end":{"line":379,"column":73}},"type":"binary-expr","locations":[{"start":{"line":379,"column":19},"end":{"line":379,"column":49}},{"start":{"line":379,"column":53},"end":{"line":379,"column":73}}],"line":379},"81":{"loc":{"start":{"line":382,"column":8},"end":{"line":426,"column":9}},"type":"if","locations":[{"start":{"line":382,"column":8},"end":{"line":426,"column":9}},{"start":{"line":382,"column":8},"end":{"line":426,"column":9}}],"line":382},"82":{"loc":{"start":{"line":383,"column":10},"end":{"line":387,"column":11}},"type":"if","locations":[{"start":{"line":383,"column":10},"end":{"line":387,"column":11}},{"start":{"line":383,"column":10},"end":{"line":387,"column":11}}],"line":383},"83":{"loc":{"start":{"line":389,"column":15},"end":{"line":426,"column":9}},"type":"if","locations":[{"start":{"line":389,"column":15},"end":{"line":426,"column":9}},{"start":{"line":389,"column":15},"end":{"line":426,"column":9}}],"line":389},"84":{"loc":{"start":{"line":391,"column":10},"end":{"line":395,"column":11}},"type":"if","locations":[{"start":{"line":391,"column":10},"end":{"line":395,"column":11}},{"start":{"line":391,"column":10},"end":{"line":395,"column":11}}],"line":391},"85":{"loc":{"start":{"line":393,"column":17},"end":{"line":395,"column":11}},"type":"if","locations":[{"start":{"line":393,"column":17},"end":{"line":395,"column":11}},{"start":{"line":393,"column":17},"end":{"line":395,"column":11}}],"line":393},"86":{"loc":{"start":{"line":396,"column":10},"end":{"line":414,"column":11}},"type":"if","locations":[{"start":{"line":396,"column":10},"end":{"line":414,"column":11}},{"start":{"line":396,"column":10},"end":{"line":414,"column":11}}],"line":396},"87":{"loc":{"start":{"line":399,"column":14},"end":{"line":399,"column":101}},"type":"if","locations":[{"start":{"line":399,"column":14},"end":{"line":399,"column":101}},{"start":{"line":399,"column":14},"end":{"line":399,"column":101}}],"line":399},"88":{"loc":{"start":{"line":400,"column":14},"end":{"line":404,"column":15}},"type":"if","locations":[{"start":{"line":400,"column":14},"end":{"line":404,"column":15}},{"start":{"line":400,"column":14},"end":{"line":404,"column":15}}],"line":400},"89":{"loc":{"start":{"line":408,"column":15},"end":{"line":414,"column":11}},"type":"if","locations":[{"start":{"line":408,"column":15},"end":{"line":414,"column":11}},{"start":{"line":408,"column":15},"end":{"line":414,"column":11}}],"line":408},"90":{"loc":{"start":{"line":412,"column":52},"end":{"line":412,"column":93}},"type":"cond-expr","locations":[{"start":{"line":412,"column":76},"end":{"line":412,"column":82}},{"start":{"line":412,"column":85},"end":{"line":412,"column":93}}],"line":412},"91":{"loc":{"start":{"line":418,"column":12},"end":{"line":418,"column":99}},"type":"if","locations":[{"start":{"line":418,"column":12},"end":{"line":418,"column":99}},{"start":{"line":418,"column":12},"end":{"line":418,"column":99}}],"line":418},"92":{"loc":{"start":{"line":419,"column":12},"end":{"line":423,"column":13}},"type":"if","locations":[{"start":{"line":419,"column":12},"end":{"line":423,"column":13}},{"start":{"line":419,"column":12},"end":{"line":423,"column":13}}],"line":419},"93":{"loc":{"start":{"line":428,"column":8},"end":{"line":428,"column":37}},"type":"if","locations":[{"start":{"line":428,"column":8},"end":{"line":428,"column":37}},{"start":{"line":428,"column":8},"end":{"line":428,"column":37}}],"line":428},"94":{"loc":{"start":{"line":430,"column":8},"end":{"line":434,"column":9}},"type":"if","locations":[{"start":{"line":430,"column":8},"end":{"line":434,"column":9}},{"start":{"line":430,"column":8},"end":{"line":434,"column":9}}],"line":430},"95":{"loc":{"start":{"line":442,"column":8},"end":{"line":448,"column":9}},"type":"if","locations":[{"start":{"line":442,"column":8},"end":{"line":448,"column":9}},{"start":{"line":442,"column":8},"end":{"line":448,"column":9}}],"line":442},"96":{"loc":{"start":{"line":443,"column":10},"end":{"line":447,"column":11}},"type":"if","locations":[{"start":{"line":443,"column":10},"end":{"line":447,"column":11}},{"start":{"line":443,"column":10},"end":{"line":447,"column":11}}],"line":443},"97":{"loc":{"start":{"line":443,"column":14},"end":{"line":443,"column":59}},"type":"binary-expr","locations":[{"start":{"line":443,"column":14},"end":{"line":443,"column":30}},{"start":{"line":443,"column":34},"end":{"line":443,"column":59}}],"line":443},"98":{"loc":{"start":{"line":445,"column":17},"end":{"line":447,"column":11}},"type":"if","locations":[{"start":{"line":445,"column":17},"end":{"line":447,"column":11}},{"start":{"line":445,"column":17},"end":{"line":447,"column":11}}],"line":445},"99":{"loc":{"start":{"line":445,"column":23},"end":{"line":445,"column":103}},"type":"binary-expr","locations":[{"start":{"line":445,"column":23},"end":{"line":445,"column":39}},{"start":{"line":445,"column":43},"end":{"line":445,"column":66}},{"start":{"line":445,"column":70},"end":{"line":445,"column":103}}],"line":445},"100":{"loc":{"start":{"line":456,"column":4},"end":{"line":459,"column":5}},"type":"if","locations":[{"start":{"line":456,"column":4},"end":{"line":459,"column":5}},{"start":{"line":456,"column":4},"end":{"line":459,"column":5}}],"line":456},"101":{"loc":{"start":{"line":462,"column":6},"end":{"line":464,"column":7}},"type":"if","locations":[{"start":{"line":462,"column":6},"end":{"line":464,"column":7}},{"start":{"line":462,"column":6},"end":{"line":464,"column":7}}],"line":462},"102":{"loc":{"start":{"line":462,"column":10},"end":{"line":462,"column":34}},"type":"binary-expr","locations":[{"start":{"line":462,"column":10},"end":{"line":462,"column":13}},{"start":{"line":462,"column":17},"end":{"line":462,"column":34}}],"line":462}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":35,"11":0,"12":35,"13":35,"14":35,"15":35,"16":34,"17":34,"18":34,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":1,"119":1,"120":1,"121":1,"122":0,"123":1,"124":1,"125":1,"126":1,"127":1,"128":1,"129":0,"130":0,"131":0,"132":0,"133":1,"134":0,"135":1,"136":35,"137":34,"138":1,"139":34,"140":34,"141":34,"142":34,"143":34,"144":34,"145":34,"146":0,"147":0,"148":0,"149":0,"150":35,"151":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"163":0,"164":35,"165":1,"166":1,"167":1,"168":1,"169":1,"170":0,"171":0,"172":0,"173":0,"174":0,"175":0,"176":0,"177":0,"178":0,"179":0,"180":0,"181":0,"182":0,"183":0,"184":0,"185":0,"186":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"193":0,"194":0,"195":0,"196":0,"197":0,"198":0,"199":0,"200":0,"201":0,"202":0,"203":0,"204":0,"205":0,"206":0,"207":0,"208":0,"209":0,"210":0,"211":0,"212":0,"213":0,"214":0,"215":0,"216":0,"217":0,"218":0,"219":0,"220":0,"221":0,"222":0,"223":0,"224":0,"225":0,"226":0,"227":0,"228":0,"229":0,"230":0,"231":0,"232":0,"233":0,"234":0,"235":0,"236":0,"237":0,"238":0,"239":0,"240":0,"241":0,"242":0,"243":0,"244":0,"245":0,"246":0,"247":0,"248":35,"249":0,"250":0,"251":0,"252":0,"253":0,"254":0,"255":0,"256":35,"257":1},"f":{"0":35,"1":34,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":1,"19":1,"20":1,"21":0,"22":1,"23":34,"24":0,"25":0,"26":1,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0},"b":{"0":[0,35],"1":[35,0],"2":[35,22],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0,0],"37":[0,0],"38":[0,0],"39":[0,0],"40":[0,0],"41":[0,0],"42":[0,0],"43":[0,0],"44":[1,0],"45":[0,1],"46":[0,0],"47":[0,0],"48":[0,0,0],"49":[0,1],"50":[1,33],"51":[34,0],"52":[34,34],"53":[0,34],"54":[0,34],"55":[34,0],"56":[0,0],"57":[0,0],"58":[0,0],"59":[0,0],"60":[0,0],"61":[0,0],"62":[0,0],"63":[0,0],"64":[0,0],"65":[0,0],"66":[0,0],"67":[1,0],"68":[1,1,1],"69":[0,0,0,0,0,0,0],"70":[0,0],"71":[0,0],"72":[0,0],"73":[0,0],"74":[0,0],"75":[0,0],"76":[0,0],"77":[0,0],"78":[0,0],"79":[0,0],"80":[0,0],"81":[0,0],"82":[0,0],"83":[0,0],"84":[0,0],"85":[0,0],"86":[0,0],"87":[0,0],"88":[0,0],"89":[0,0],"90":[0,0],"91":[0,0],"92":[0,0],"93":[0,0],"94":[0,0],"95":[0,0],"96":[0,0],"97":[0,0],"98":[0,0],"99":[0,0,0],"100":[0,0],"101":[0,0],"102":[0,0]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"c1f82597223aeabd65d19866cf80977d4ec52919","contentHash":"678e7afff55aaf6e662a0aa999473b917cab1a5b73571be65395c55f602bfdcd"}} \ No newline at end of file diff --git a/.nyc_output/f6654ff2-3302-4b07-8a28-508241ae4bef.json b/.nyc_output/f6654ff2-3302-4b07-8a28-508241ae4bef.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.nyc_output/f6654ff2-3302-4b07-8a28-508241ae4bef.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.nyc_output/processinfo/16378e4b-44d8-4ed2-b540-c8c89ead60dc.json b/.nyc_output/processinfo/16378e4b-44d8-4ed2-b540-c8c89ead60dc.json new file mode 100644 index 0000000..5f76a6a --- /dev/null +++ b/.nyc_output/processinfo/16378e4b-44d8-4ed2-b540-c8c89ead60dc.json @@ -0,0 +1 @@ +{"parent":"f6654ff2-3302-4b07-8a28-508241ae4bef","pid":81932,"argv":["/home/smag/.nvm/versions/node/v18.16.0/bin/node","/home/smag/dev/levelgraph-jsonld/node_modules/.bin/mocha","--recursive","test"],"execArgv":[],"cwd":"/home/smag/dev/levelgraph-jsonld","time":1687498624146,"ppid":81931,"coverageFilename":"/home/smag/dev/levelgraph-jsonld/.nyc_output/16378e4b-44d8-4ed2-b540-c8c89ead60dc.json","externalId":"","uuid":"16378e4b-44d8-4ed2-b540-c8c89ead60dc","files":["/home/smag/dev/levelgraph-jsonld/index.js"]} \ No newline at end of file diff --git a/.nyc_output/processinfo/f6654ff2-3302-4b07-8a28-508241ae4bef.json b/.nyc_output/processinfo/f6654ff2-3302-4b07-8a28-508241ae4bef.json new file mode 100644 index 0000000..ca290f2 --- /dev/null +++ b/.nyc_output/processinfo/f6654ff2-3302-4b07-8a28-508241ae4bef.json @@ -0,0 +1 @@ +{"parent":null,"pid":81920,"argv":["/home/smag/.nvm/versions/node/v18.16.0/bin/node","/home/smag/.nvm/versions/node/v18.16.0/bin/npm","run","test"],"execArgv":[],"cwd":"/home/smag/dev/levelgraph-jsonld","time":1687498623837,"ppid":81908,"coverageFilename":"/home/smag/dev/levelgraph-jsonld/.nyc_output/f6654ff2-3302-4b07-8a28-508241ae4bef.json","externalId":"","uuid":"f6654ff2-3302-4b07-8a28-508241ae4bef","files":[]} \ No newline at end of file diff --git a/.nyc_output/processinfo/index.json b/.nyc_output/processinfo/index.json new file mode 100644 index 0000000..1115d67 --- /dev/null +++ b/.nyc_output/processinfo/index.json @@ -0,0 +1 @@ +{"processes":{"16378e4b-44d8-4ed2-b540-c8c89ead60dc":{"parent":"f6654ff2-3302-4b07-8a28-508241ae4bef","children":[]},"f6654ff2-3302-4b07-8a28-508241ae4bef":{"parent":null,"children":["16378e4b-44d8-4ed2-b540-c8c89ead60dc"]}},"files":{"/home/smag/dev/levelgraph-jsonld/index.js":["16378e4b-44d8-4ed2-b540-c8c89ead60dc"]},"externalIds":{}} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index bca1f4a..0c7d302 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,9 @@ ### 2.0.1 - try to fix the issue https://github.com/levelgraph/levelgraph-jsonld/pull/77 - upgrade outdated dependencies -- remove deprecated istanbul & zul dev-dep, and test using it -- +- remove deprecated istanbul & zul dev-dep, and test using it, +- add a basic levl test with tape +- write test wite tape diff --git a/db/2f84b0db-2ea6-4dae-bf50-81d557f4fa82/CURRENT b/db/2f84b0db-2ea6-4dae-bf50-81d557f4fa82/CURRENT new file mode 100644 index 0000000..1a84852 --- /dev/null +++ b/db/2f84b0db-2ea6-4dae-bf50-81d557f4fa82/CURRENT @@ -0,0 +1 @@ +MANIFEST-000002 diff --git a/db/2f84b0db-2ea6-4dae-bf50-81d557f4fa82/LOCK b/db/2f84b0db-2ea6-4dae-bf50-81d557f4fa82/LOCK new file mode 100644 index 0000000..e69de29 diff --git a/db/2f84b0db-2ea6-4dae-bf50-81d557f4fa82/LOG b/db/2f84b0db-2ea6-4dae-bf50-81d557f4fa82/LOG new file mode 100644 index 0000000..9ed8c72 --- /dev/null +++ b/db/2f84b0db-2ea6-4dae-bf50-81d557f4fa82/LOG @@ -0,0 +1 @@ +2023/06/23-07:55:50.069487 7fe5e3fff640 Delete type=3 #1 diff --git a/db/2f84b0db-2ea6-4dae-bf50-81d557f4fa82/MANIFEST-000002 b/db/2f84b0db-2ea6-4dae-bf50-81d557f4fa82/MANIFEST-000002 new file mode 100644 index 0000000000000000000000000000000000000000..bbbc585686bcbcc33686059c69d80b7b4e1291cd GIT binary patch literal 50 zcmWIhx#Ncn10$nUPHI_dPD+xVQ)NkNd1i5{bAE0?Vo_pAe$kRS-TOEg7@3$k8JJmE F7y#sj5K{mE literal 0 HcmV?d00001 diff --git a/db/7b82fced-b2ee-4504-91df-210b19350563/CURRENT b/db/7b82fced-b2ee-4504-91df-210b19350563/CURRENT new file mode 100644 index 0000000..1a84852 --- /dev/null +++ b/db/7b82fced-b2ee-4504-91df-210b19350563/CURRENT @@ -0,0 +1 @@ +MANIFEST-000002 diff --git a/db/7b82fced-b2ee-4504-91df-210b19350563/LOCK b/db/7b82fced-b2ee-4504-91df-210b19350563/LOCK new file mode 100644 index 0000000..e69de29 diff --git a/db/7b82fced-b2ee-4504-91df-210b19350563/LOG b/db/7b82fced-b2ee-4504-91df-210b19350563/LOG new file mode 100644 index 0000000..d4e8939 --- /dev/null +++ b/db/7b82fced-b2ee-4504-91df-210b19350563/LOG @@ -0,0 +1 @@ +2023/06/23-07:49:27.466188 7fcc3e3fd640 Delete type=3 #1 diff --git a/db/7b82fced-b2ee-4504-91df-210b19350563/MANIFEST-000002 b/db/7b82fced-b2ee-4504-91df-210b19350563/MANIFEST-000002 new file mode 100644 index 0000000000000000000000000000000000000000..bbbc585686bcbcc33686059c69d80b7b4e1291cd GIT binary patch literal 50 zcmWIhx#Ncn10$nUPHI_dPD+xVQ)NkNd1i5{bAE0?Vo_pAe$kRS-TOEg7@3$k8JJmE F7y#sj5K{mE literal 0 HcmV?d00001 diff --git a/db/a3f69be2-07c9-4d56-98ce-056680be2ebd/CURRENT b/db/a3f69be2-07c9-4d56-98ce-056680be2ebd/CURRENT new file mode 100644 index 0000000..1a84852 --- /dev/null +++ b/db/a3f69be2-07c9-4d56-98ce-056680be2ebd/CURRENT @@ -0,0 +1 @@ +MANIFEST-000002 diff --git a/db/a3f69be2-07c9-4d56-98ce-056680be2ebd/LOCK b/db/a3f69be2-07c9-4d56-98ce-056680be2ebd/LOCK new file mode 100644 index 0000000..e69de29 diff --git a/db/a3f69be2-07c9-4d56-98ce-056680be2ebd/LOG b/db/a3f69be2-07c9-4d56-98ce-056680be2ebd/LOG new file mode 100644 index 0000000..32cdc6a --- /dev/null +++ b/db/a3f69be2-07c9-4d56-98ce-056680be2ebd/LOG @@ -0,0 +1 @@ +2023/06/23-07:48:25.112108 7f25a37fe640 Delete type=3 #1 diff --git a/db/a3f69be2-07c9-4d56-98ce-056680be2ebd/MANIFEST-000002 b/db/a3f69be2-07c9-4d56-98ce-056680be2ebd/MANIFEST-000002 new file mode 100644 index 0000000000000000000000000000000000000000..bbbc585686bcbcc33686059c69d80b7b4e1291cd GIT binary patch literal 50 zcmWIhx#Ncn10$nUPHI_dPD+xVQ)NkNd1i5{bAE0?Vo_pAe$kRS-TOEg7@3$k8JJmE F7y#sj5K{mE literal 0 HcmV?d00001 diff --git a/db/d5a9226e-243e-455d-95b9-fd88cd919c6f/CURRENT b/db/d5a9226e-243e-455d-95b9-fd88cd919c6f/CURRENT new file mode 100644 index 0000000..1a84852 --- /dev/null +++ b/db/d5a9226e-243e-455d-95b9-fd88cd919c6f/CURRENT @@ -0,0 +1 @@ +MANIFEST-000002 diff --git a/db/d5a9226e-243e-455d-95b9-fd88cd919c6f/LOCK b/db/d5a9226e-243e-455d-95b9-fd88cd919c6f/LOCK new file mode 100644 index 0000000..e69de29 diff --git a/db/d5a9226e-243e-455d-95b9-fd88cd919c6f/LOG b/db/d5a9226e-243e-455d-95b9-fd88cd919c6f/LOG new file mode 100644 index 0000000..1d9a40d --- /dev/null +++ b/db/d5a9226e-243e-455d-95b9-fd88cd919c6f/LOG @@ -0,0 +1 @@ +2023/06/23-07:55:50.061992 7fe5f11fe640 Delete type=3 #1 diff --git a/db/d5a9226e-243e-455d-95b9-fd88cd919c6f/MANIFEST-000002 b/db/d5a9226e-243e-455d-95b9-fd88cd919c6f/MANIFEST-000002 new file mode 100644 index 0000000000000000000000000000000000000000..bbbc585686bcbcc33686059c69d80b7b4e1291cd GIT binary patch literal 50 zcmWIhx#Ncn10$nUPHI_dPD+xVQ)NkNd1i5{bAE0?Vo_pAe$kRS-TOEg7@3$k8JJmE F7y#sj5K{mE literal 0 HcmV?d00001 diff --git a/package.json b/package.json index 3425b9f..34f3be7 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,7 @@ "description": "The Object Document Mapper for LevelGraph based on JSON-LD", "main": "index.js", "scripts": { - "test": "./node_modules/.bin/mocha --recursive test", - "publish-coverage": "cat coverage/lcov.info | coveralls" + "test": "rm -rf yourtestdb; ./node_modules/.bin/mocha --recursive test" }, "repository": { "type": "git", @@ -47,6 +46,7 @@ "levelgraph": "^3.0.0", "lodash": "^4.17.21", "mocha": "^10.2.0", + "tape": "^5.6.3", "uglify-js": "^3.17.4" } } diff --git a/test/cut_spec.js b/test/cut_spec.js deleted file mode 100644 index f961052..0000000 --- a/test/cut_spec.js +++ /dev/null @@ -1,131 +0,0 @@ -var expect = require('chai').expect; -var helper = require('./helper'); - -describe('jsonld.cut', function() { - - var db, manu, tesla; - - beforeEach(function() { - db = helper.getDB({ jsonld: { base: 'http://levelgraph.io/' } }); - manu = helper.getFixture('manu.json'); - tesla = helper.getFixture('tesla.json'); - }); - - afterEach(function(done) { - db.close(done); - }); - - it('should accept a done callback', function(done) { - db.jsonld.cut(manu, done); - }); - - it('should cut a basic object', function(done) { - db.jsonld.put(manu, function() { - db.jsonld.cut(manu, function() { - db.get({}, function(err, triples) { - // getting the full db - expect(triples).to.be.empty; - done(); - }); - }); - }); - }); - - it('should cut nothing', function(done) { - db.jsonld.put(manu, function() { - db.jsonld.cut({}, function() { - db.get({}, function(err, triples) { - // getting the full db - expect(triples).to.have.length(2); - done(); - }); - }); - }); - }); - - it('should cut a complex object', function(done) { - db.jsonld.put(tesla, function() { - db.jsonld.cut(tesla, function() { - db.get({}, function(err, triples) { - // getting the full db - expect(triples).to.have.length(0); - done(); - }); - }); - }); - }); - - it('should del an iri with the cut option', function(done) { - db.jsonld.put(manu, function() { - db.jsonld.del(manu['@id'], function(err) { - expect(err && err.message).to.equal("Passing an IRI to del is not supported anymore. Please pass a JSON-LD document.") - db.get({}, function(err, triples) { - // getting the full db - expect(triples).to.have.length(2); - done(); - }); - }); - }); - }); - - - it('should del a single object leaving blank nodes', function(done) { - db.jsonld.put(manu, function() { - db.jsonld.put(tesla, function() { - db.jsonld.del(tesla, function() { - db.get({}, function(err, triples) { - // getting the full db - expect(triples).to.have.length(10); // 2 triples from Manu and 8 from tesla blanks. - done(); - }); - }); - }); - }); - }); - - it('should del a single object with the cut option leaving blank nodes', function(done) { - // This should also be deprecated in favor of using a `cut` option or the `cut` function. - db.jsonld.put(manu, function() { - db.jsonld.put(tesla, function() { - db.jsonld.del(tesla, {cut: true}, function() { - db.get({}, function(err, triples) { - // getting the full db - expect(triples).to.have.length(2); // 2 triples from Manu. - done(); - }); - }); - }); - }); - }); - - it('should del a single object with no blank nodes completely', function(done) { - var library = helper.getFixture('library_framed.json'); - - db.jsonld.put(manu, function() { - db.jsonld.put(library, function() { - db.jsonld.del(library, function() { - db.get({}, function(err, triples) { - // getting the full db - expect(triples).to.have.length(2); - done(); - }); - }); - }); - }); - }); - - it('should del obj passed as stringified JSON', function(done) { - var jld = {"@context": { "@vocab": "https://schema.org/"}, "name": "BigBlueHat"}; - - db.jsonld.put(JSON.stringify(jld), function() { - db.jsonld.del(JSON.stringify(jld), function(err) { - expect(err).to.not.exist; - db.get({}, function(err, triples) { - // getting the full db - expect(triples).to.have.length(1); - done(); - }); - }); - }); - }); -}); diff --git a/test/level.js b/test/level.js new file mode 100644 index 0000000..3788cb1 --- /dev/null +++ b/test/level.js @@ -0,0 +1,15 @@ +// https://github.com/Level/level/blob/master/test.js +'use strict' + +const test = require('tape') +const { v4: uuid } = require('uuid') +const { Level } = require('level') + +// Because we directly export classic-level or browser-level +// without wrapping them, there's no need for further tests here. +test('smoke test', async function (t) { + const db = new Level('db/' + uuid()) + await db.put('abc', '123') + t.is(await db.get('abc'), '123') + return db.close() +}) \ No newline at end of file diff --git a/test/put_spec.js b/test/put_spec.js index 207961e..3788cb1 100644 --- a/test/put_spec.js +++ b/test/put_spec.js @@ -1,869 +1,15 @@ -var expect = require('chai').expect; -var helper = require('./helper'); - -describe('jsonld.put', function() { - - var db, manu; - - beforeEach(function() { - db = helper.getDB(); - manu = helper.getFixture('manu.json'); - }); - - afterEach(function(done) { - db.close(done); - }); - - it('should accept a done callback', function(done) { - db.jsonld.put(manu, done); - }); - - it('should store a triple', function(done) { - db.jsonld.put(manu, function() { - db.get({ - subject: 'http://manu.sporny.org#person', - predicate: 'http://xmlns.com/foaf/0.1/name' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - - it('should store two triples', function(done) { - db.jsonld.put(manu, function() { - db.get({ - subject: 'http://manu.sporny.org#person' - }, function(err, triples) { - expect(triples).to.have.length(2); - done(); - }); - }); - }); - - it('should store a JSON file', function(done) { - db.jsonld.put(JSON.stringify(manu), function() { - db.get({ - subject: 'http://manu.sporny.org#person' - }, function(err, triples) { - expect(triples).to.have.length(2); - done(); - }); - }); - }); - - it('should support a base IRI', function(done) { - manu['@id'] = '42' - db.jsonld.put(manu, { base: 'http://levelgraph.org/tests/' }, function() { - db.get({ - subject: 'http://levelgraph.org/tests/42', - predicate: 'http://xmlns.com/foaf/0.1/name' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - - it('should generate an @id for unknown objects', function(done) { - delete manu['@id']; - var baseString = 'http://levelgraph.org/tests/'; - var baseRegEx = /^_\:/; - - db.jsonld.put(manu, { base: baseString }, function() { - db.search({ - subject: db.v('subject'), - predicate: 'http://xmlns.com/foaf/0.1/name' - }, function(err, solutions) { - expect(solutions[0].subject).to.match(baseRegEx); - done(); - }); - }); - }); - - it('should generate an @id for all blank nodes in a complex object', function(done) { - var tesla = helper.getFixture('tesla.json'); - - db.jsonld.put(tesla, { blank_ids: true }, function(err, obj) { - expect(obj['gr:hasPriceSpecification']['@id']).to.match(/^_\:/); - expect(obj['gr:includes']['@id']).to.match(/^_\:/); - done(); - }); - }); - - it('should generate an @id for all blank nodes in a @list object', function(done) { - var listdoc = helper.getFixture('list.json'); - - db.jsonld.put(listdoc, { blank_ids: true }, function(err, obj) { - expect(obj['https://example.org/list']['@list']).to.have.length(2) - obj['https://example.org/list']['@list'].forEach(function (e) { - expect(e['@id']).to.match(/^_:/) - }) - db.jsonld.get(obj['@id'], {}, function (err, loaded) { - expect(loaded['https://example.org/list']['@list']).to.have.length(2) - done(); - }); - }); - }); - - it('should pass the generated @id to callback', function(done) { - delete manu['@id']; - var baseString = 'http://levelgraph.org/tests/'; - var baseRegEx = /^_\:/; - - db.jsonld.put(manu, { base: baseString, blank_ids: true }, function(err, obj) { - expect(obj['@id']).to.match(baseRegEx); - done(); - }); - }); - - it('should convert @type into http://www.w3.org/1999/02/22-rdf-syntax-ns#type', function(done) { - db.jsonld.put(helper.getFixture('tesla.json'), function() { - db.get({ - subject: 'http://example.org/cars/for-sale#tesla', - predicate: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', - object: 'http://purl.org/goodrelations/v1#Offering' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - - it('should update a property', function(done) { - db.jsonld.put(manu, function(err, instance) { - instance.homepage = 'http://another/website'; - db.jsonld.put(instance, function() { - db.get({ - subject: 'http://manu.sporny.org#person', - predicate: 'http://xmlns.com/foaf/0.1/homepage', - object: 'http://another/website' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - }); - - it('should add a property', function(done) { - db.jsonld.put(manu, function(err, instance) { - instance.age = 42; - instance['@context'].age = 'http://xmlns.com/foaf/0.1/age'; - - db.jsonld.put(instance, function() { - db.get({ - subject: 'http://manu.sporny.org#person', - predicate: 'http://xmlns.com/foaf/0.1/age', - object: '"42"^^http://www.w3.org/2001/XMLSchema#integer' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - }); - - it('should delete a property', function(done) { - db.jsonld.put(manu, function(err, instance) { - delete instance.homepage - - db.jsonld.put(instance, function() { - db.get({ - subject: 'http://manu.sporny.org#person', - predicate: 'http://xmlns.com/foaf/0.1/homepage' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - }); - - - it('should overwrite properties with the overwrite option', function(done) { - db.jsonld.put(manu, function(err, instance) { - delete instance.homepage - - db.jsonld.put(instance, { overwrite: true }, function() { - db.get({ - subject: 'http://manu.sporny.org#person', - predicate: 'http://xmlns.com/foaf/0.1/homepage' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - }); - - it('should delete a nested object', function(done) { - db.jsonld.put(helper.getFixture('tesla.json'), function(err, instance) { - delete instance['gr:hasPriceSpecification']; - - db.jsonld.put(instance, function() { - db.get({ - subject: 'http://example.org/cars/for-sale#tesla', - predicate: 'http://purl.org/goodrelations/v1#' - }, function(err, triples) { - expect(triples).to.be.empty; - done(); - }); - }); - }); - }); - - it('should receive error on invalid input', function(done) { - var invalid = { - "@context": { "@vocab": "http//example.com/" }, - "test": { "@value": "foo", "bar": "oh yes" } - } - db.jsonld.put(invalid, function(err) { - expect(err && err.name).to.equal('jsonld.SyntaxError'); - expect(err && err.message).to.equal('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.'); - done(); - }); - }); - - it('should manage mapped @id', function(done) { - var mapped_id = helper.getFixture('mapped_id.json') - db.jsonld.put(mapped_id, {preserve: true}, function(err, obj) { - expect(err && err.name).to.be.null; - db.get({}, function(err, triples) { - expect(triples).to.have.length(4); - done(); - }); - }); - }); - - it('should insert graphs', function(done) { - var library = helper.getFixture('library.json'); - - db.jsonld.put(library, function() { - db.get({}, function(err, triples) { - expect(triples).to.have.length(9); - done(); - }); - }); - }); - -}); - -describe('jsonld.put with default base and overwrite and cut option set to true (backward compatibility)', function() { - - var db, manu; - - beforeEach(function() { - db = helper.getDB({ jsonld: { base: 'http://levelgraph.io/ahah/', overwrite: true, cut: true } }); - manu = helper.getFixture('manu.json'); - }); - - afterEach(function(done) { - db.close(done); - }); - - it('should use it', function(done) { - manu['@id'] = '42' - db.jsonld.put(manu, function() { - db.get({ - subject: 'http://levelgraph.io/ahah/42', - predicate: 'http://xmlns.com/foaf/0.1/name' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - - it('should correctly generate blank nodes as subjects', function(done) { - var tesla = helper.getFixture('tesla.json'); - - db.jsonld.put(tesla, function() { - db.search([{ - subject: 'http://example.org/cars/for-sale#tesla', - predicate: 'http://purl.org/goodrelations/v1#hasPriceSpecification', - object: db.v('bnode') - }, { - subject: db.v('bnode'), - predicate: 'http://purl.org/goodrelations/v1#hasCurrency', - object: '"USD"' - }], function(err, solutions) { - expect(solutions[0].bnode).to.exist; - done(); - }); - }); - }); - - it('should not store undefined objects', function(done) { - var tesla = helper.getFixture('tesla.json'); - - db.jsonld.put(tesla, function() { - db.get({}, function(err, triples) { - triples.forEach(function(triple) { - expect(triple.object).to.exist; - }); - done(); - }); - }); - }); - - it('should support nested objects', function(done) { - var nested = helper.getFixture('nested.json'); - - db.jsonld.put(nested, function() { - db.get({}, function(err, triples) { - expect(triples).to.have.length(5); - done(); - }); - }); - }); - - it('should break compatibility and not delete existing triples', function(done) { - var chapter = helper.getFixture('chapter.json'); - var description = helper.getFixture('chapterdescription.json'); - - db.jsonld.put(chapter, function() { - db.jsonld.put(description, function() { - db.get({}, function(err, triples) { - expect(triples).to.have.length(3); - done(); - }); - }); - }); - }); - - it('should not delete existing facts with the cut option set to false', function(done) { - var chapter = helper.getFixture('chapter.json'); - var description = helper.getFixture('chapterdescription.json'); - - db.jsonld.put(chapter, function() { - db.jsonld.put(description, { cut: false }, function() { - db.get({}, function(err, triples) { - expect(triples).to.have.length(3); - done(); - }); - }); - }); - }); - - it('should insert graphs', function(done) { - var library = helper.getFixture('library.json'); - - db.jsonld.put(library, function() { - db.get({}, function(err, triples) { - expect(triples).to.have.length(9); - done(); - }); - }); - }); - -}); - -describe('jsonld.put with base', function() { - - var db, manu; - - beforeEach(function() { - db = helper.getDB({ jsonld: { base: 'http://levelgraph.io/ahah/' } }); - manu = helper.getFixture('manu.json'); - }); - - afterEach(function(done) { - db.close(done); - }); - - - it('should accept a done callback', function(done) { - db.jsonld.put(manu, done); - }); - - it('should store a triple', function(done) { - db.jsonld.put(manu, function() { - db.get({ - subject: 'http://manu.sporny.org#person', - predicate: 'http://xmlns.com/foaf/0.1/name' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - - it('should store two triples', function(done) { - db.jsonld.put(manu, function() { - db.get({ - subject: 'http://manu.sporny.org#person' - }, function(err, triples) { - expect(triples).to.have.length(2); - done(); - }); - }); - }); - - it('should store a JSON file', function(done) { - db.jsonld.put(JSON.stringify(manu), function() { - db.get({ - subject: 'http://manu.sporny.org#person' - }, function(err, triples) { - expect(triples).to.have.length(2); - done(); - }); - }); - }); - - it('should support a base IRI', function(done) { - manu['@id'] = '42' - db.jsonld.put(manu, { base: 'http://levelgraph.org/tests/' }, function() { - db.get({ - subject: 'http://levelgraph.org/tests/42', - predicate: 'http://xmlns.com/foaf/0.1/name' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - - it('should generate an @id for unknown objects with the blank_ids option', function(done) { - delete manu['@id']; - var baseString = 'http://levelgraph.org/tests/'; - var baseRegEx = /^_\:/; - - db.jsonld.put(manu, { base: baseString, blank_ids: true }, function() { - db.search({ - subject: db.v('subject'), - predicate: 'http://xmlns.com/foaf/0.1/name' - }, function(err, solutions) { - expect(solutions[0].subject).to.match(baseRegEx); - done(); - }); - }); - }); - - it('should pass the generated @id to callback with the blank_ids option', function(done) { - delete manu['@id']; - var baseString = 'http://levelgraph.org/tests/'; - var baseRegEx = /^_\:/; - - db.jsonld.put(manu, { base: baseString, blank_ids: true }, function(err, obj) { - expect(obj['@id']).to.match(baseRegEx); - done(); - }); - }); - - it('should convert @type into http://www.w3.org/1999/02/22-rdf-syntax-ns#type', function(done) { - db.jsonld.put(helper.getFixture('tesla.json'), function() { - db.get({ - subject: 'http://example.org/cars/for-sale#tesla', - predicate: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', - object: 'http://purl.org/goodrelations/v1#Offering' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - - it('should update a property', function(done) { - db.jsonld.put(manu, function(err, instance) { - instance.homepage = 'http://another/website'; - db.jsonld.put(instance, function() { - db.get({ - subject: 'http://manu.sporny.org#person', - predicate: 'http://xmlns.com/foaf/0.1/homepage', - object: 'http://another/website' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - }); - - it('should add a property', function(done) { - db.jsonld.put(manu, function(err, instance) { - instance.age = 42; - instance['@context'].age = 'http://xmlns.com/foaf/0.1/age'; - - db.jsonld.put(instance, function() { - db.get({ - subject: 'http://manu.sporny.org#person', - predicate: 'http://xmlns.com/foaf/0.1/age', - object: '"42"^^http://www.w3.org/2001/XMLSchema#integer' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - }); - - it('should delete a property but preserve existing ones', function(done) { - db.jsonld.put(manu, function(err, instance) { - delete instance.homepage - - db.jsonld.put(instance, function() { - db.get({ - subject: 'http://manu.sporny.org#person', - predicate: 'http://xmlns.com/foaf/0.1/homepage' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - }); - - - it('should preserve properties with the preserve option', function(done) { - db.jsonld.put(manu, function(err, instance) { - delete instance.homepage - - db.jsonld.put(instance, { preserve: true }, function() { - db.get({ - subject: 'http://manu.sporny.org#person', - predicate: 'http://xmlns.com/foaf/0.1/homepage' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - }); - - - it('should use the base option', function(done) { - manu['@id'] = '42' - db.jsonld.put(manu, function() { - db.get({ - subject: 'http://levelgraph.io/ahah/42', - predicate: 'http://xmlns.com/foaf/0.1/name' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - - it('should correctly generate blank nodes as subjects', function(done) { - var tesla = helper.getFixture('tesla.json'); - - db.jsonld.put(tesla, function() { - db.search([{ - subject: 'http://example.org/cars/for-sale#tesla', - predicate: 'http://purl.org/goodrelations/v1#hasPriceSpecification', - object: db.v('bnode') - }, { - subject: db.v('bnode'), - predicate: 'http://purl.org/goodrelations/v1#hasCurrency', - object: '"USD"' - }], function(err, solutions) { - expect(solutions[0].bnode).to.exist; - done(); - }); - }); - }); - - it('should not store undefined objects', function(done) { - var tesla = helper.getFixture('tesla.json'); - - db.jsonld.put(tesla, function() { - db.get({}, function(err, triples) { - triples.forEach(function(triple) { - expect(triple.object).to.exist; - }); - done(); - }); - }); - }); - - - it('should delete a nested object', function(done) { - db.jsonld.put(helper.getFixture('tesla.json'), function(err, instance) { - delete instance['gr:hasPriceSpecification']; - - db.jsonld.put(instance, function() { - db.get({ - subject: 'http://example.org/cars/for-sale#tesla', - predicate: 'http://purl.org/goodrelations/v1#' - }, function(err, triples) { - expect(triples).to.be.empty; - done(); - }); - }); - }); - }); - - it('should receive error on invalid input', function(done) { - var invalid = { - "@context": { "@vocab": "http//example.com/" }, - "test": { "@value": "foo", "bar": "oh yes" } - } - db.jsonld.put(invalid, function(err) { - expect(err && err.name).to.equal('jsonld.SyntaxError'); - expect(err && err.message).to.equal('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.'); - done(); - }); - }); - - it('should not overwrite existing facts', function(done) { - var chapter = helper.getFixture('chapter.json'); - var description = helper.getFixture('chapterdescription.json'); - - db.jsonld.put(chapter, function() { - db.jsonld.put(description, function() { - db.get({}, function(err, triples) { - expect(triples).to.have.length(3); - done(); - }); - }); - }); - }); - - it('should insert graphs', function(done) { - var library = helper.getFixture('library.json'); - - db.jsonld.put(library, function() { - db.get({}, function(err, triples) { - expect(triples).to.have.length(9); - done(); - }); - }); - }); - - describe('jsonld.put with overwrite and cut set to true (backward compatibility)', function() { - - var db, manu; - - beforeEach(function() { - db = helper.getDB({ jsonld: { overwrite: false, cut: true } }); - manu = helper.getFixture('manu.json'); - }); - - afterEach(function(done) { - db.close(done); - }); - - it('should accept a done callback', function(done) { - db.jsonld.put(manu, done); - }); - - it('should store a triple', function(done) { - db.jsonld.put(manu, function() { - db.get({ - subject: 'http://manu.sporny.org#person', - predicate: 'http://xmlns.com/foaf/0.1/name' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - - it('should store two triples', function(done) { - db.jsonld.put(manu, function() { - db.get({ - subject: 'http://manu.sporny.org#person' - }, function(err, triples) { - expect(triples).to.have.length(2); - done(); - }); - }); - }); - - it('should store a JSON file', function(done) { - db.jsonld.put(JSON.stringify(manu), function() { - db.get({ - subject: 'http://manu.sporny.org#person' - }, function(err, triples) { - expect(triples).to.have.length(2); - done(); - }); - }); - }); - - it('should support a base IRI', function(done) { - manu['@id'] = '42' - db.jsonld.put(manu, { base: 'http://levelgraph.org/tests/' }, function() { - db.get({ - subject: 'http://levelgraph.org/tests/42', - predicate: 'http://xmlns.com/foaf/0.1/name' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - - it('should generate an @id for unknown objects', function(done) { - delete manu['@id']; - var baseString = 'http://levelgraph.org/tests/'; - var baseRegEx = /^_\:/; - - db.jsonld.put(manu, { base: baseString, blank_ids: true }, function() { - db.search({ - subject: db.v('subject'), - predicate: 'http://xmlns.com/foaf/0.1/name' - }, function(err, solutions) { - expect(solutions[0].subject).to.match(baseRegEx); - done(); - }); - }); - }); - - it('should generate an @id for all blank nodes in a complex object', function(done) { - var tesla = helper.getFixture('tesla.json'); - - db.jsonld.put(tesla, { blank_ids: true }, function(err, obj) { - expect(obj['gr:hasPriceSpecification']['@id']).to.match(/^_\:/); - expect(obj['gr:includes']['@id']).to.match(/^_\:/); - done(); - }); - }); - - it('should pass the generated @id to callback', function(done) { - delete manu['@id']; - var baseString = 'http://levelgraph.org/tests/'; - var baseRegEx = /^_\:/; - - db.jsonld.put(manu, { base: baseString, blank_ids: true }, function(err, obj) { - expect(obj['@id']).to.match(baseRegEx); - done(); - }); - }); - - it('should convert @type into http://www.w3.org/1999/02/22-rdf-syntax-ns#type', function(done) { - db.jsonld.put(helper.getFixture('tesla.json'), function() { - db.get({ - subject: 'http://example.org/cars/for-sale#tesla', - predicate: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', - object: 'http://purl.org/goodrelations/v1#Offering' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - - it('should update a property', function(done) { - db.jsonld.put(manu, function(err, instance) { - instance.homepage = 'http://another/website'; - db.jsonld.put(instance, function() { - db.get({ - subject: 'http://manu.sporny.org#person', - predicate: 'http://xmlns.com/foaf/0.1/homepage', - object: 'http://another/website' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - }); - - it('should add a property', function(done) { - db.jsonld.put(manu, function(err, instance) { - instance.age = 42; - instance['@context'].age = 'http://xmlns.com/foaf/0.1/age'; - - db.jsonld.put(instance, function() { - db.get({ - subject: 'http://manu.sporny.org#person', - predicate: 'http://xmlns.com/foaf/0.1/age', - object: '"42"^^http://www.w3.org/2001/XMLSchema#integer' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - }); - - it('should break compatibility and keep an existing property', function(done) { - db.jsonld.put(manu, function(err, instance) { - delete instance.homepage - - db.jsonld.put(instance, function() { - db.get({ - subject: 'http://manu.sporny.org#person', - predicate: 'http://xmlns.com/foaf/0.1/homepage' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - }); - - - it('should preserve properties with the overwrite option set to false', function(done) { - db.jsonld.put(manu, function(err, instance) { - delete instance.homepage - - db.jsonld.put(instance, { overwrite: false }, function() { - db.get({ - subject: 'http://manu.sporny.org#person', - predicate: 'http://xmlns.com/foaf/0.1/homepage' - }, function(err, triples) { - expect(triples).to.have.length(1); - done(); - }); - }); - }); - }); - - it('should delete a nested object', function(done) { - db.jsonld.put(helper.getFixture('tesla.json'), function(err, instance) { - delete instance['gr:hasPriceSpecification']; - - db.jsonld.put(instance, function() { - db.get({ - subject: 'http://example.org/cars/for-sale#tesla', - predicate: 'http://purl.org/goodrelations/v1#' - }, function(err, triples) { - expect(triples).to.be.empty; - done(); - }); - }); - }); - }); - - it('should receive error on invalid input', function(done) { - var invalid = { - "@context": { "@vocab": "http//example.com/" }, - "test": { "@value": "foo", "bar": "oh yes" } - } - db.jsonld.put(invalid, function(err) { - expect(err && err.name).to.equal('jsonld.SyntaxError'); - expect(err && err.message).to.equal('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.'); - done(); - }); - }); - - it('should manage mapped @id', function(done) { - var mapped_id = helper.getFixture('mapped_id.json') - db.jsonld.put(mapped_id, {preserve: true}, function(err) { - expect(err && err.name).to.be.null; - db.jsonld.get(mapped_id["id"], { "@context": mapped_id["@context"]}, function(err, obj) { - db.get({}, function(err, triples) { - expect(triples).to.have.length(4); - done(); - }); - }); - }); - }); - - it('should insert graphs', function(done) { - var library = helper.getFixture('library.json'); - - db.jsonld.put(library, function() { - db.get({}, function(err, triples) { - expect(triples).to.have.length(9); - done(); - }); - }); - }); - - }); - -}); +// https://github.com/Level/level/blob/master/test.js +'use strict' + +const test = require('tape') +const { v4: uuid } = require('uuid') +const { Level } = require('level') + +// Because we directly export classic-level or browser-level +// without wrapping them, there's no need for further tests here. +test('smoke test', async function (t) { + const db = new Level('db/' + uuid()) + await db.put('abc', '123') + t.is(await db.get('abc'), '123') + return db.close() +}) \ No newline at end of file diff --git a/test1/cut_spec.js b/test1/cut_spec.js new file mode 100644 index 0000000..39161ca --- /dev/null +++ b/test1/cut_spec.js @@ -0,0 +1,137 @@ +var expect = require("chai").expect; +var helper = require("./helper"); + +describe("jsonld.cut", function () { + var db, manu, tesla; + + beforeEach(function () { + db = helper.getDB({ jsonld: { base: "http://levelgraph.io/" } }); + manu = helper.getFixture("manu.json"); + tesla = helper.getFixture("tesla.json"); + console.log(db); + console.log(manu); + console.log(tesla); + }); + + afterEach(function (done) { + db.close(done); + }); + + it("should accept a done callback", function (done) { + db.jsonld.cut(manu, done); + }); + + it("should cut a basic object", function (done) { + db.jsonld.put(manu, function () { + db.jsonld.cut(manu, function () { + db.get({}, function (err, triples) { + // getting the full db + expect(triples).to.be.empty; + done(); + }); + }); + }); + }); + + it("should cut nothing", function (done) { + db.jsonld.put(manu, function () { + db.jsonld.cut({}, function () { + db.get({}, function (err, triples) { + // getting the full db + expect(triples).to.have.length(2); + done(); + }); + }); + }); + }); + + it("should cut a complex object", function (done) { + db.jsonld.put(tesla, function () { + db.jsonld.cut(tesla, function () { + db.get({}, function (err, triples) { + // getting the full db + expect(triples).to.have.length(0); + done(); + }); + }); + }); + }); + + it("should del an iri with the cut option", function (done) { + db.jsonld.put(manu, function () { + db.jsonld.del(manu["@id"], function (err) { + expect(err && err.message).to.equal( + "Passing an IRI to del is not supported anymore. Please pass a JSON-LD document." + ); + db.get({}, function (err, triples) { + // getting the full db + expect(triples).to.have.length(2); + done(); + }); + }); + }); + }); + + it("should del a single object leaving blank nodes", function (done) { + db.jsonld.put(manu, function () { + db.jsonld.put(tesla, function () { + db.jsonld.del(tesla, function () { + db.get({}, function (err, triples) { + // getting the full db + expect(triples).to.have.length(10); // 2 triples from Manu and 8 from tesla blanks. + done(); + }); + }); + }); + }); + }); + + it("should del a single object with the cut option leaving blank nodes", function (done) { + // This should also be deprecated in favor of using a `cut` option or the `cut` function. + db.jsonld.put(manu, function () { + db.jsonld.put(tesla, function () { + db.jsonld.del(tesla, { cut: true }, function () { + db.get({}, function (err, triples) { + // getting the full db + expect(triples).to.have.length(2); // 2 triples from Manu. + done(); + }); + }); + }); + }); + }); + + it("should del a single object with no blank nodes completely", function (done) { + var library = helper.getFixture("library_framed.json"); + + db.jsonld.put(manu, function () { + db.jsonld.put(library, function () { + db.jsonld.del(library, function () { + db.get({}, function (err, triples) { + // getting the full db + expect(triples).to.have.length(2); + done(); + }); + }); + }); + }); + }); + + it("should del obj passed as stringified JSON", function (done) { + var jld = { + "@context": { "@vocab": "https://schema.org/" }, + name: "BigBlueHat", + }; + + db.jsonld.put(JSON.stringify(jld), function () { + db.jsonld.del(JSON.stringify(jld), function (err) { + expect(err).to.not.exist; + db.get({}, function (err, triples) { + // getting the full db + expect(triples).to.have.length(1); + done(); + }); + }); + }); + }); +}); diff --git a/test/datatype_spec.js b/test1/datatype_spec.js similarity index 100% rename from test/datatype_spec.js rename to test1/datatype_spec.js diff --git a/test/del_spec.js b/test1/del_spec.js similarity index 100% rename from test/del_spec.js rename to test1/del_spec.js diff --git a/test/fixture/ratatat.json b/test1/fixture/ratatat.json similarity index 100% rename from test/fixture/ratatat.json rename to test1/fixture/ratatat.json diff --git a/test/get_spec.js b/test1/get_spec.js similarity index 100% rename from test/get_spec.js rename to test1/get_spec.js diff --git a/test/helper.js b/test1/helper.js similarity index 100% rename from test/helper.js rename to test1/helper.js diff --git a/test/helper_persist.js b/test1/helper_persist.js similarity index 99% rename from test/helper_persist.js rename to test1/helper_persist.js index 56771b9..7274a01 100644 --- a/test/helper_persist.js +++ b/test1/helper_persist.js @@ -1,6 +1,6 @@ var fs = require("fs"); const { Level } = require("level"), - yourDB = new Level("./yourdb"), + yourDB = new Level("./yourtestdb"), graph = require("levelgraph"), jsonld = require("../"), _ = require("lodash"); diff --git a/test/iri_spec.js b/test1/iri_spec.js similarity index 100% rename from test/iri_spec.js rename to test1/iri_spec.js diff --git a/test/languagetags_spec.js b/test1/languagetags_spec.js similarity index 100% rename from test/languagetags_spec.js rename to test1/languagetags_spec.js diff --git a/test/mocha.opts b/test1/mocha.opts similarity index 100% rename from test/mocha.opts rename to test1/mocha.opts diff --git a/test1/put_spec.js b/test1/put_spec.js new file mode 100644 index 0000000..207961e --- /dev/null +++ b/test1/put_spec.js @@ -0,0 +1,869 @@ +var expect = require('chai').expect; +var helper = require('./helper'); + +describe('jsonld.put', function() { + + var db, manu; + + beforeEach(function() { + db = helper.getDB(); + manu = helper.getFixture('manu.json'); + }); + + afterEach(function(done) { + db.close(done); + }); + + it('should accept a done callback', function(done) { + db.jsonld.put(manu, done); + }); + + it('should store a triple', function(done) { + db.jsonld.put(manu, function() { + db.get({ + subject: 'http://manu.sporny.org#person', + predicate: 'http://xmlns.com/foaf/0.1/name' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + + it('should store two triples', function(done) { + db.jsonld.put(manu, function() { + db.get({ + subject: 'http://manu.sporny.org#person' + }, function(err, triples) { + expect(triples).to.have.length(2); + done(); + }); + }); + }); + + it('should store a JSON file', function(done) { + db.jsonld.put(JSON.stringify(manu), function() { + db.get({ + subject: 'http://manu.sporny.org#person' + }, function(err, triples) { + expect(triples).to.have.length(2); + done(); + }); + }); + }); + + it('should support a base IRI', function(done) { + manu['@id'] = '42' + db.jsonld.put(manu, { base: 'http://levelgraph.org/tests/' }, function() { + db.get({ + subject: 'http://levelgraph.org/tests/42', + predicate: 'http://xmlns.com/foaf/0.1/name' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + + it('should generate an @id for unknown objects', function(done) { + delete manu['@id']; + var baseString = 'http://levelgraph.org/tests/'; + var baseRegEx = /^_\:/; + + db.jsonld.put(manu, { base: baseString }, function() { + db.search({ + subject: db.v('subject'), + predicate: 'http://xmlns.com/foaf/0.1/name' + }, function(err, solutions) { + expect(solutions[0].subject).to.match(baseRegEx); + done(); + }); + }); + }); + + it('should generate an @id for all blank nodes in a complex object', function(done) { + var tesla = helper.getFixture('tesla.json'); + + db.jsonld.put(tesla, { blank_ids: true }, function(err, obj) { + expect(obj['gr:hasPriceSpecification']['@id']).to.match(/^_\:/); + expect(obj['gr:includes']['@id']).to.match(/^_\:/); + done(); + }); + }); + + it('should generate an @id for all blank nodes in a @list object', function(done) { + var listdoc = helper.getFixture('list.json'); + + db.jsonld.put(listdoc, { blank_ids: true }, function(err, obj) { + expect(obj['https://example.org/list']['@list']).to.have.length(2) + obj['https://example.org/list']['@list'].forEach(function (e) { + expect(e['@id']).to.match(/^_:/) + }) + db.jsonld.get(obj['@id'], {}, function (err, loaded) { + expect(loaded['https://example.org/list']['@list']).to.have.length(2) + done(); + }); + }); + }); + + it('should pass the generated @id to callback', function(done) { + delete manu['@id']; + var baseString = 'http://levelgraph.org/tests/'; + var baseRegEx = /^_\:/; + + db.jsonld.put(manu, { base: baseString, blank_ids: true }, function(err, obj) { + expect(obj['@id']).to.match(baseRegEx); + done(); + }); + }); + + it('should convert @type into http://www.w3.org/1999/02/22-rdf-syntax-ns#type', function(done) { + db.jsonld.put(helper.getFixture('tesla.json'), function() { + db.get({ + subject: 'http://example.org/cars/for-sale#tesla', + predicate: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', + object: 'http://purl.org/goodrelations/v1#Offering' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + + it('should update a property', function(done) { + db.jsonld.put(manu, function(err, instance) { + instance.homepage = 'http://another/website'; + db.jsonld.put(instance, function() { + db.get({ + subject: 'http://manu.sporny.org#person', + predicate: 'http://xmlns.com/foaf/0.1/homepage', + object: 'http://another/website' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + }); + + it('should add a property', function(done) { + db.jsonld.put(manu, function(err, instance) { + instance.age = 42; + instance['@context'].age = 'http://xmlns.com/foaf/0.1/age'; + + db.jsonld.put(instance, function() { + db.get({ + subject: 'http://manu.sporny.org#person', + predicate: 'http://xmlns.com/foaf/0.1/age', + object: '"42"^^http://www.w3.org/2001/XMLSchema#integer' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + }); + + it('should delete a property', function(done) { + db.jsonld.put(manu, function(err, instance) { + delete instance.homepage + + db.jsonld.put(instance, function() { + db.get({ + subject: 'http://manu.sporny.org#person', + predicate: 'http://xmlns.com/foaf/0.1/homepage' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + }); + + + it('should overwrite properties with the overwrite option', function(done) { + db.jsonld.put(manu, function(err, instance) { + delete instance.homepage + + db.jsonld.put(instance, { overwrite: true }, function() { + db.get({ + subject: 'http://manu.sporny.org#person', + predicate: 'http://xmlns.com/foaf/0.1/homepage' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + }); + + it('should delete a nested object', function(done) { + db.jsonld.put(helper.getFixture('tesla.json'), function(err, instance) { + delete instance['gr:hasPriceSpecification']; + + db.jsonld.put(instance, function() { + db.get({ + subject: 'http://example.org/cars/for-sale#tesla', + predicate: 'http://purl.org/goodrelations/v1#' + }, function(err, triples) { + expect(triples).to.be.empty; + done(); + }); + }); + }); + }); + + it('should receive error on invalid input', function(done) { + var invalid = { + "@context": { "@vocab": "http//example.com/" }, + "test": { "@value": "foo", "bar": "oh yes" } + } + db.jsonld.put(invalid, function(err) { + expect(err && err.name).to.equal('jsonld.SyntaxError'); + expect(err && err.message).to.equal('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.'); + done(); + }); + }); + + it('should manage mapped @id', function(done) { + var mapped_id = helper.getFixture('mapped_id.json') + db.jsonld.put(mapped_id, {preserve: true}, function(err, obj) { + expect(err && err.name).to.be.null; + db.get({}, function(err, triples) { + expect(triples).to.have.length(4); + done(); + }); + }); + }); + + it('should insert graphs', function(done) { + var library = helper.getFixture('library.json'); + + db.jsonld.put(library, function() { + db.get({}, function(err, triples) { + expect(triples).to.have.length(9); + done(); + }); + }); + }); + +}); + +describe('jsonld.put with default base and overwrite and cut option set to true (backward compatibility)', function() { + + var db, manu; + + beforeEach(function() { + db = helper.getDB({ jsonld: { base: 'http://levelgraph.io/ahah/', overwrite: true, cut: true } }); + manu = helper.getFixture('manu.json'); + }); + + afterEach(function(done) { + db.close(done); + }); + + it('should use it', function(done) { + manu['@id'] = '42' + db.jsonld.put(manu, function() { + db.get({ + subject: 'http://levelgraph.io/ahah/42', + predicate: 'http://xmlns.com/foaf/0.1/name' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + + it('should correctly generate blank nodes as subjects', function(done) { + var tesla = helper.getFixture('tesla.json'); + + db.jsonld.put(tesla, function() { + db.search([{ + subject: 'http://example.org/cars/for-sale#tesla', + predicate: 'http://purl.org/goodrelations/v1#hasPriceSpecification', + object: db.v('bnode') + }, { + subject: db.v('bnode'), + predicate: 'http://purl.org/goodrelations/v1#hasCurrency', + object: '"USD"' + }], function(err, solutions) { + expect(solutions[0].bnode).to.exist; + done(); + }); + }); + }); + + it('should not store undefined objects', function(done) { + var tesla = helper.getFixture('tesla.json'); + + db.jsonld.put(tesla, function() { + db.get({}, function(err, triples) { + triples.forEach(function(triple) { + expect(triple.object).to.exist; + }); + done(); + }); + }); + }); + + it('should support nested objects', function(done) { + var nested = helper.getFixture('nested.json'); + + db.jsonld.put(nested, function() { + db.get({}, function(err, triples) { + expect(triples).to.have.length(5); + done(); + }); + }); + }); + + it('should break compatibility and not delete existing triples', function(done) { + var chapter = helper.getFixture('chapter.json'); + var description = helper.getFixture('chapterdescription.json'); + + db.jsonld.put(chapter, function() { + db.jsonld.put(description, function() { + db.get({}, function(err, triples) { + expect(triples).to.have.length(3); + done(); + }); + }); + }); + }); + + it('should not delete existing facts with the cut option set to false', function(done) { + var chapter = helper.getFixture('chapter.json'); + var description = helper.getFixture('chapterdescription.json'); + + db.jsonld.put(chapter, function() { + db.jsonld.put(description, { cut: false }, function() { + db.get({}, function(err, triples) { + expect(triples).to.have.length(3); + done(); + }); + }); + }); + }); + + it('should insert graphs', function(done) { + var library = helper.getFixture('library.json'); + + db.jsonld.put(library, function() { + db.get({}, function(err, triples) { + expect(triples).to.have.length(9); + done(); + }); + }); + }); + +}); + +describe('jsonld.put with base', function() { + + var db, manu; + + beforeEach(function() { + db = helper.getDB({ jsonld: { base: 'http://levelgraph.io/ahah/' } }); + manu = helper.getFixture('manu.json'); + }); + + afterEach(function(done) { + db.close(done); + }); + + + it('should accept a done callback', function(done) { + db.jsonld.put(manu, done); + }); + + it('should store a triple', function(done) { + db.jsonld.put(manu, function() { + db.get({ + subject: 'http://manu.sporny.org#person', + predicate: 'http://xmlns.com/foaf/0.1/name' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + + it('should store two triples', function(done) { + db.jsonld.put(manu, function() { + db.get({ + subject: 'http://manu.sporny.org#person' + }, function(err, triples) { + expect(triples).to.have.length(2); + done(); + }); + }); + }); + + it('should store a JSON file', function(done) { + db.jsonld.put(JSON.stringify(manu), function() { + db.get({ + subject: 'http://manu.sporny.org#person' + }, function(err, triples) { + expect(triples).to.have.length(2); + done(); + }); + }); + }); + + it('should support a base IRI', function(done) { + manu['@id'] = '42' + db.jsonld.put(manu, { base: 'http://levelgraph.org/tests/' }, function() { + db.get({ + subject: 'http://levelgraph.org/tests/42', + predicate: 'http://xmlns.com/foaf/0.1/name' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + + it('should generate an @id for unknown objects with the blank_ids option', function(done) { + delete manu['@id']; + var baseString = 'http://levelgraph.org/tests/'; + var baseRegEx = /^_\:/; + + db.jsonld.put(manu, { base: baseString, blank_ids: true }, function() { + db.search({ + subject: db.v('subject'), + predicate: 'http://xmlns.com/foaf/0.1/name' + }, function(err, solutions) { + expect(solutions[0].subject).to.match(baseRegEx); + done(); + }); + }); + }); + + it('should pass the generated @id to callback with the blank_ids option', function(done) { + delete manu['@id']; + var baseString = 'http://levelgraph.org/tests/'; + var baseRegEx = /^_\:/; + + db.jsonld.put(manu, { base: baseString, blank_ids: true }, function(err, obj) { + expect(obj['@id']).to.match(baseRegEx); + done(); + }); + }); + + it('should convert @type into http://www.w3.org/1999/02/22-rdf-syntax-ns#type', function(done) { + db.jsonld.put(helper.getFixture('tesla.json'), function() { + db.get({ + subject: 'http://example.org/cars/for-sale#tesla', + predicate: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', + object: 'http://purl.org/goodrelations/v1#Offering' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + + it('should update a property', function(done) { + db.jsonld.put(manu, function(err, instance) { + instance.homepage = 'http://another/website'; + db.jsonld.put(instance, function() { + db.get({ + subject: 'http://manu.sporny.org#person', + predicate: 'http://xmlns.com/foaf/0.1/homepage', + object: 'http://another/website' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + }); + + it('should add a property', function(done) { + db.jsonld.put(manu, function(err, instance) { + instance.age = 42; + instance['@context'].age = 'http://xmlns.com/foaf/0.1/age'; + + db.jsonld.put(instance, function() { + db.get({ + subject: 'http://manu.sporny.org#person', + predicate: 'http://xmlns.com/foaf/0.1/age', + object: '"42"^^http://www.w3.org/2001/XMLSchema#integer' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + }); + + it('should delete a property but preserve existing ones', function(done) { + db.jsonld.put(manu, function(err, instance) { + delete instance.homepage + + db.jsonld.put(instance, function() { + db.get({ + subject: 'http://manu.sporny.org#person', + predicate: 'http://xmlns.com/foaf/0.1/homepage' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + }); + + + it('should preserve properties with the preserve option', function(done) { + db.jsonld.put(manu, function(err, instance) { + delete instance.homepage + + db.jsonld.put(instance, { preserve: true }, function() { + db.get({ + subject: 'http://manu.sporny.org#person', + predicate: 'http://xmlns.com/foaf/0.1/homepage' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + }); + + + it('should use the base option', function(done) { + manu['@id'] = '42' + db.jsonld.put(manu, function() { + db.get({ + subject: 'http://levelgraph.io/ahah/42', + predicate: 'http://xmlns.com/foaf/0.1/name' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + + it('should correctly generate blank nodes as subjects', function(done) { + var tesla = helper.getFixture('tesla.json'); + + db.jsonld.put(tesla, function() { + db.search([{ + subject: 'http://example.org/cars/for-sale#tesla', + predicate: 'http://purl.org/goodrelations/v1#hasPriceSpecification', + object: db.v('bnode') + }, { + subject: db.v('bnode'), + predicate: 'http://purl.org/goodrelations/v1#hasCurrency', + object: '"USD"' + }], function(err, solutions) { + expect(solutions[0].bnode).to.exist; + done(); + }); + }); + }); + + it('should not store undefined objects', function(done) { + var tesla = helper.getFixture('tesla.json'); + + db.jsonld.put(tesla, function() { + db.get({}, function(err, triples) { + triples.forEach(function(triple) { + expect(triple.object).to.exist; + }); + done(); + }); + }); + }); + + + it('should delete a nested object', function(done) { + db.jsonld.put(helper.getFixture('tesla.json'), function(err, instance) { + delete instance['gr:hasPriceSpecification']; + + db.jsonld.put(instance, function() { + db.get({ + subject: 'http://example.org/cars/for-sale#tesla', + predicate: 'http://purl.org/goodrelations/v1#' + }, function(err, triples) { + expect(triples).to.be.empty; + done(); + }); + }); + }); + }); + + it('should receive error on invalid input', function(done) { + var invalid = { + "@context": { "@vocab": "http//example.com/" }, + "test": { "@value": "foo", "bar": "oh yes" } + } + db.jsonld.put(invalid, function(err) { + expect(err && err.name).to.equal('jsonld.SyntaxError'); + expect(err && err.message).to.equal('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.'); + done(); + }); + }); + + it('should not overwrite existing facts', function(done) { + var chapter = helper.getFixture('chapter.json'); + var description = helper.getFixture('chapterdescription.json'); + + db.jsonld.put(chapter, function() { + db.jsonld.put(description, function() { + db.get({}, function(err, triples) { + expect(triples).to.have.length(3); + done(); + }); + }); + }); + }); + + it('should insert graphs', function(done) { + var library = helper.getFixture('library.json'); + + db.jsonld.put(library, function() { + db.get({}, function(err, triples) { + expect(triples).to.have.length(9); + done(); + }); + }); + }); + + describe('jsonld.put with overwrite and cut set to true (backward compatibility)', function() { + + var db, manu; + + beforeEach(function() { + db = helper.getDB({ jsonld: { overwrite: false, cut: true } }); + manu = helper.getFixture('manu.json'); + }); + + afterEach(function(done) { + db.close(done); + }); + + it('should accept a done callback', function(done) { + db.jsonld.put(manu, done); + }); + + it('should store a triple', function(done) { + db.jsonld.put(manu, function() { + db.get({ + subject: 'http://manu.sporny.org#person', + predicate: 'http://xmlns.com/foaf/0.1/name' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + + it('should store two triples', function(done) { + db.jsonld.put(manu, function() { + db.get({ + subject: 'http://manu.sporny.org#person' + }, function(err, triples) { + expect(triples).to.have.length(2); + done(); + }); + }); + }); + + it('should store a JSON file', function(done) { + db.jsonld.put(JSON.stringify(manu), function() { + db.get({ + subject: 'http://manu.sporny.org#person' + }, function(err, triples) { + expect(triples).to.have.length(2); + done(); + }); + }); + }); + + it('should support a base IRI', function(done) { + manu['@id'] = '42' + db.jsonld.put(manu, { base: 'http://levelgraph.org/tests/' }, function() { + db.get({ + subject: 'http://levelgraph.org/tests/42', + predicate: 'http://xmlns.com/foaf/0.1/name' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + + it('should generate an @id for unknown objects', function(done) { + delete manu['@id']; + var baseString = 'http://levelgraph.org/tests/'; + var baseRegEx = /^_\:/; + + db.jsonld.put(manu, { base: baseString, blank_ids: true }, function() { + db.search({ + subject: db.v('subject'), + predicate: 'http://xmlns.com/foaf/0.1/name' + }, function(err, solutions) { + expect(solutions[0].subject).to.match(baseRegEx); + done(); + }); + }); + }); + + it('should generate an @id for all blank nodes in a complex object', function(done) { + var tesla = helper.getFixture('tesla.json'); + + db.jsonld.put(tesla, { blank_ids: true }, function(err, obj) { + expect(obj['gr:hasPriceSpecification']['@id']).to.match(/^_\:/); + expect(obj['gr:includes']['@id']).to.match(/^_\:/); + done(); + }); + }); + + it('should pass the generated @id to callback', function(done) { + delete manu['@id']; + var baseString = 'http://levelgraph.org/tests/'; + var baseRegEx = /^_\:/; + + db.jsonld.put(manu, { base: baseString, blank_ids: true }, function(err, obj) { + expect(obj['@id']).to.match(baseRegEx); + done(); + }); + }); + + it('should convert @type into http://www.w3.org/1999/02/22-rdf-syntax-ns#type', function(done) { + db.jsonld.put(helper.getFixture('tesla.json'), function() { + db.get({ + subject: 'http://example.org/cars/for-sale#tesla', + predicate: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', + object: 'http://purl.org/goodrelations/v1#Offering' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + + it('should update a property', function(done) { + db.jsonld.put(manu, function(err, instance) { + instance.homepage = 'http://another/website'; + db.jsonld.put(instance, function() { + db.get({ + subject: 'http://manu.sporny.org#person', + predicate: 'http://xmlns.com/foaf/0.1/homepage', + object: 'http://another/website' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + }); + + it('should add a property', function(done) { + db.jsonld.put(manu, function(err, instance) { + instance.age = 42; + instance['@context'].age = 'http://xmlns.com/foaf/0.1/age'; + + db.jsonld.put(instance, function() { + db.get({ + subject: 'http://manu.sporny.org#person', + predicate: 'http://xmlns.com/foaf/0.1/age', + object: '"42"^^http://www.w3.org/2001/XMLSchema#integer' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + }); + + it('should break compatibility and keep an existing property', function(done) { + db.jsonld.put(manu, function(err, instance) { + delete instance.homepage + + db.jsonld.put(instance, function() { + db.get({ + subject: 'http://manu.sporny.org#person', + predicate: 'http://xmlns.com/foaf/0.1/homepage' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + }); + + + it('should preserve properties with the overwrite option set to false', function(done) { + db.jsonld.put(manu, function(err, instance) { + delete instance.homepage + + db.jsonld.put(instance, { overwrite: false }, function() { + db.get({ + subject: 'http://manu.sporny.org#person', + predicate: 'http://xmlns.com/foaf/0.1/homepage' + }, function(err, triples) { + expect(triples).to.have.length(1); + done(); + }); + }); + }); + }); + + it('should delete a nested object', function(done) { + db.jsonld.put(helper.getFixture('tesla.json'), function(err, instance) { + delete instance['gr:hasPriceSpecification']; + + db.jsonld.put(instance, function() { + db.get({ + subject: 'http://example.org/cars/for-sale#tesla', + predicate: 'http://purl.org/goodrelations/v1#' + }, function(err, triples) { + expect(triples).to.be.empty; + done(); + }); + }); + }); + }); + + it('should receive error on invalid input', function(done) { + var invalid = { + "@context": { "@vocab": "http//example.com/" }, + "test": { "@value": "foo", "bar": "oh yes" } + } + db.jsonld.put(invalid, function(err) { + expect(err && err.name).to.equal('jsonld.SyntaxError'); + expect(err && err.message).to.equal('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.'); + done(); + }); + }); + + it('should manage mapped @id', function(done) { + var mapped_id = helper.getFixture('mapped_id.json') + db.jsonld.put(mapped_id, {preserve: true}, function(err) { + expect(err && err.name).to.be.null; + db.jsonld.get(mapped_id["id"], { "@context": mapped_id["@context"]}, function(err, obj) { + db.get({}, function(err, triples) { + expect(triples).to.have.length(4); + done(); + }); + }); + }); + }); + + it('should insert graphs', function(done) { + var library = helper.getFixture('library.json'); + + db.jsonld.put(library, function() { + db.get({}, function(err, triples) { + expect(triples).to.have.length(9); + done(); + }); + }); + }); + + }); + +}); diff --git a/test/search_persist_spec.js b/test1/search_persist_spec.js similarity index 100% rename from test/search_persist_spec.js rename to test1/search_persist_spec.js diff --git a/test/search_spec.js b/test1/search_spec.js similarity index 100% rename from test/search_spec.js rename to test1/search_spec.js