@ldo/rdf-utils 1.0.0-alpha.3 → 1.0.0-alpha.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.cjs +30 -0
- package/dist/datasetChanges.cjs +25 -0
- package/dist/datasetChanges.d.cts +22 -0
- package/dist/datasetChanges.d.cts.map +1 -0
- package/dist/datasetChanges.d.ts +21 -5
- package/dist/datasetChanges.d.ts.map +1 -0
- package/dist/datasetChanges.js +23 -23
- package/dist/datasetChanges.js.map +1 -1
- package/dist/datasetConverters.cjs +17 -0
- package/dist/datasetConverters.d.cts +13 -0
- package/dist/datasetConverters.d.cts.map +1 -0
- package/dist/datasetConverters.d.ts +13 -6
- package/dist/datasetConverters.d.ts.map +1 -0
- package/dist/datasetConverters.js +11 -13
- package/dist/datasetConverters.js.map +1 -1
- package/dist/index.cjs +34 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -4
- package/dist/index.js +7 -21
- package/dist/nodeSerialization.cjs +186 -0
- package/dist/nodeSerialization.d.cts +145 -0
- package/dist/nodeSerialization.d.cts.map +1 -0
- package/dist/nodeSerialization.d.ts +144 -37
- package/dist/nodeSerialization.d.ts.map +1 -0
- package/dist/nodeSerialization.js +136 -83
- package/dist/nodeSerialization.js.map +1 -1
- package/dist/rdfjsDataModel.cjs +19 -0
- package/dist/rdfjsDataModel.d.cts +13 -0
- package/dist/rdfjsDataModel.d.cts.map +1 -0
- package/dist/rdfjsDataModel.d.ts +13 -0
- package/dist/rdfjsDataModel.d.ts.map +1 -0
- package/dist/rdfjsDataModel.js +15 -0
- package/dist/rdfjsDataModel.js.map +1 -0
- package/dist/serializedToQuads.cjs +12 -0
- package/dist/serializedToQuads.d.cts +11 -0
- package/dist/serializedToQuads.d.cts.map +1 -0
- package/dist/serializedToQuads.d.ts +11 -4
- package/dist/serializedToQuads.d.ts.map +1 -0
- package/dist/serializedToQuads.js +9 -10
- package/dist/serializedToQuads.js.map +1 -1
- package/package.json +29 -12
- package/src/datasetChanges.ts +1 -1
- package/src/index.ts +1 -0
- package/src/rdfjsDataModel.ts +27 -0
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as rdfdmNamespace from "@rdfjs/data-model";
|
|
2
|
+
|
|
3
|
+
//#region src/rdfjsDataModel.d.ts
|
|
4
|
+
declare const quad: (typeof rdfdmNamespace)["quad"];
|
|
5
|
+
declare const namedNode: (typeof rdfdmNamespace)["namedNode"];
|
|
6
|
+
declare const blankNode: (typeof rdfdmNamespace)["blankNode"];
|
|
7
|
+
declare const literal: (typeof rdfdmNamespace)["literal"];
|
|
8
|
+
declare const defaultGraph: (typeof rdfdmNamespace)["defaultGraph"];
|
|
9
|
+
//# sourceMappingURL=rdfjsDataModel.d.ts.map
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { blankNode, defaultGraph, literal, namedNode, quad };
|
|
13
|
+
//# sourceMappingURL=rdfjsDataModel.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rdfjsDataModel.d.cts","names":[],"sources":["../../src/rdfjsDataModel.ts"],"sourcesContent":[],"mappings":";;;cAkBa,cAAc;cACd,mBAAmB;AADnB,cAGA,SAHc,EAAA,CAAA,OAGK,cAHS,CAAA,CAAA,WAAA,CAAA;AAC5B,cAIA,OAJmB,EAAA,CAAA,OAIF,cAJgB,CAAA,CAAA,SAAA,CAAA;AAEjC,cAIA,YAJmB,EAAA,CAAA,OAIG,cAJW,CAAA,CAAA,cAAA,CAAA;AAE9C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as rdfdmNamespace from "@rdfjs/data-model";
|
|
2
|
+
|
|
3
|
+
//#region src/rdfjsDataModel.d.ts
|
|
4
|
+
declare const quad: (typeof rdfdmNamespace)["quad"];
|
|
5
|
+
declare const namedNode: (typeof rdfdmNamespace)["namedNode"];
|
|
6
|
+
declare const blankNode: (typeof rdfdmNamespace)["blankNode"];
|
|
7
|
+
declare const literal: (typeof rdfdmNamespace)["literal"];
|
|
8
|
+
declare const defaultGraph: (typeof rdfdmNamespace)["defaultGraph"];
|
|
9
|
+
//# sourceMappingURL=rdfjsDataModel.d.ts.map
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { blankNode as blankNode$1, defaultGraph as defaultGraph$1, literal as literal$1, namedNode as namedNode$1, quad as quad$1 };
|
|
13
|
+
//# sourceMappingURL=rdfjsDataModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rdfjsDataModel.d.ts","names":[],"sources":["../../src/rdfjsDataModel.ts"],"sourcesContent":[],"mappings":";;;cAkBa,cAAc;cACd,mBAAmB;AADnB,cAGA,SAHc,EAAA,CAAA,OAGK,cAHS,CAAA,CAAA,WAAA,CAAA;AAC5B,cAIA,OAJmB,EAAA,CAAA,OAIF,cAJgB,CAAA,CAAA,SAAA,CAAA;AAEjC,cAIA,YAJmB,EAAA,CAAA,OAIG,cAJW,CAAA,CAAA,cAAA,CAAA;AAE9C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as rdfdmNamespace from "@rdfjs/data-model";
|
|
2
|
+
|
|
3
|
+
//#region src/rdfjsDataModel.ts
|
|
4
|
+
let RdfDataModelResolved;
|
|
5
|
+
if (rdfdmNamespace.default && typeof rdfdmNamespace.default.namedNode === "function") RdfDataModelResolved = rdfdmNamespace.default;
|
|
6
|
+
else RdfDataModelResolved = rdfdmNamespace;
|
|
7
|
+
const quad = RdfDataModelResolved.quad;
|
|
8
|
+
const namedNode = RdfDataModelResolved.namedNode;
|
|
9
|
+
const blankNode = RdfDataModelResolved.blankNode;
|
|
10
|
+
const literal = RdfDataModelResolved.literal;
|
|
11
|
+
const defaultGraph = RdfDataModelResolved.defaultGraph;
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { blankNode, defaultGraph, literal, namedNode, quad };
|
|
15
|
+
//# sourceMappingURL=rdfjsDataModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rdfjsDataModel.js","names":["quad: (typeof rdfdmNamespace)[\"quad\"]","namedNode: (typeof rdfdmNamespace)[\"namedNode\"]","blankNode: (typeof rdfdmNamespace)[\"blankNode\"]","literal: (typeof rdfdmNamespace)[\"literal\"]","defaultGraph: (typeof rdfdmNamespace)[\"defaultGraph\"]"],"sources":["../src/rdfjsDataModel.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-ts-comment */\n// src/utils/rdfjs-data-model-interop.ts\nimport * as rdfdmNamespace from \"@rdfjs/data-model\";\n\n// The interop shim\nlet RdfDataModelResolved;\nif (\n // @ts-ignore\n rdfdmNamespace.default &&\n // @ts-ignore\n typeof rdfdmNamespace.default.namedNode === \"function\"\n) {\n // @ts-ignore\n RdfDataModelResolved = rdfdmNamespace.default;\n} else {\n RdfDataModelResolved = rdfdmNamespace;\n}\n\nexport const quad: (typeof rdfdmNamespace)[\"quad\"] = RdfDataModelResolved.quad;\nexport const namedNode: (typeof rdfdmNamespace)[\"namedNode\"] =\n RdfDataModelResolved.namedNode;\nexport const blankNode: (typeof rdfdmNamespace)[\"blankNode\"] =\n RdfDataModelResolved.blankNode;\nexport const literal: (typeof rdfdmNamespace)[\"literal\"] =\n RdfDataModelResolved.literal;\nexport const defaultGraph: (typeof rdfdmNamespace)[\"defaultGraph\"] =\n RdfDataModelResolved.defaultGraph;\n"],"mappings":";;;AAKA,IAAI;AACJ,IAEE,eAAe,kBAER,eAAe,QAAQ,cAAc,WAG5C,wBAAuB,eAAe;IAEtC,wBAAuB;AAGzB,MAAaA,OAAwC,qBAAqB;AAC1E,MAAaC,YACX,qBAAqB;AACvB,MAAaC,YACX,qBAAqB;AACvB,MAAaC,UACX,qBAAqB;AACvB,MAAaC,eACX,qBAAqB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const n3 = require_rolldown_runtime.__toESM(require("n3"));
|
|
3
|
+
|
|
4
|
+
//#region src/serializedToQuads.ts
|
|
5
|
+
async function serializedToQuads(data, options) {
|
|
6
|
+
if (options && options.format === "application/ld+json") throw new Error("Not Implemented");
|
|
7
|
+
const parser = new n3.Parser(options);
|
|
8
|
+
return parser.parse(data);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.serializedToQuads = serializedToQuads;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Quad } from "@rdfjs/types";
|
|
2
|
+
import { ParserOptions } from "n3";
|
|
3
|
+
|
|
4
|
+
//#region src/serializedToQuads.d.ts
|
|
5
|
+
type ParserOptions$1 = ParserOptions;
|
|
6
|
+
declare function serializedToQuads(data: string, options?: ParserOptions$1): Promise<Quad[]>;
|
|
7
|
+
//# sourceMappingURL=serializedToQuads.d.ts.map
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { ParserOptions$1 as ParserOptions, serializedToQuads };
|
|
11
|
+
//# sourceMappingURL=serializedToQuads.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializedToQuads.d.cts","names":[],"sources":["../../src/serializedToQuads.ts"],"sourcesContent":[],"mappings":";;;;KAIY,eAAA,GAAgB;iBAEN,iBAAA,yBAEV,kBACT,QAAQ;AALX"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ParserOptions } from "n3";
|
|
2
|
+
import { Quad } from "@rdfjs/types";
|
|
3
|
+
|
|
4
|
+
//#region src/serializedToQuads.d.ts
|
|
5
|
+
type ParserOptions$1 = ParserOptions;
|
|
6
|
+
declare function serializedToQuads(data: string, options?: ParserOptions$1): Promise<Quad[]>;
|
|
7
|
+
//# sourceMappingURL=serializedToQuads.d.ts.map
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { ParserOptions$1 as ParserOptions, serializedToQuads as serializedToQuads$1 };
|
|
11
|
+
//# sourceMappingURL=serializedToQuads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializedToQuads.d.ts","names":[],"sources":["../../src/serializedToQuads.ts"],"sourcesContent":[],"mappings":";;;;KAIY,eAAA,GAAgB;iBAEN,iBAAA,yBAEV,kBACT,QAAQ;AALX"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const n3_1 = require("n3");
|
|
1
|
+
import { Parser } from "n3";
|
|
2
|
+
|
|
3
|
+
//#region src/serializedToQuads.ts
|
|
5
4
|
async function serializedToQuads(data, options) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const parser = new n3_1.Parser(options);
|
|
10
|
-
return parser.parse(data);
|
|
5
|
+
if (options && options.format === "application/ld+json") throw new Error("Not Implemented");
|
|
6
|
+
const parser = new Parser(options);
|
|
7
|
+
return parser.parse(data);
|
|
11
8
|
}
|
|
12
|
-
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { serializedToQuads };
|
|
13
12
|
//# sourceMappingURL=serializedToQuads.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializedToQuads.js","
|
|
1
|
+
{"version":3,"file":"serializedToQuads.js","names":["data: string","options?: ParserOptions"],"sources":["../src/serializedToQuads.ts"],"sourcesContent":["import type { Quad } from \"@rdfjs/types\";\nimport type { ParserOptions as ParserOptionsImport } from \"n3\";\nimport { Parser } from \"n3\";\n\nexport type ParserOptions = ParserOptionsImport;\n\nexport async function serializedToQuads(\n data: string,\n options?: ParserOptions,\n): Promise<Quad[]> {\n // JSON-LD Parsing\n if (options && options.format === \"application/ld+json\") {\n throw new Error(\"Not Implemented\");\n // return new Promise((resolve, reject) => {\n // JSON.parse(data);\n // const parserJsonld = new ParserJsonld();\n\n // const input = new Readable({\n // read: () => {\n // input.push(data);\n // input.push(null);\n // },\n // });\n\n // const output = parserJsonld.import(input);\n // const quads: Quad[] = [];\n // output.on(\"data\", (quad) => {\n // quads.push(quad);\n // });\n // output.on(\"end\", () => {\n // resolve((datasetFactory.dataset(quads) as unknown) as ReturnDataset);\n // });\n // /* istanbul ignore next */\n // output.on(\"error\", (err) => {\n // /* istanbul ignore next */\n // reject(err);\n // });\n // });\n }\n // N3 Parsing\n const parser = new Parser(options as ParserOptions);\n return parser.parse(data);\n}\n"],"mappings":";;;AAMA,eAAsB,kBACpBA,MACAC,SACiB;AAEjB,KAAI,WAAW,QAAQ,WAAW,sBAChC,OAAM,IAAI,MAAM;CA4BlB,MAAM,SAAS,IAAI,OAAO;AAC1B,QAAO,OAAO,MAAM,KAAK;AAC1B"}
|
package/package.json
CHANGED
|
@@ -1,32 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldo/rdf-utils",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.34",
|
|
4
4
|
"description": "Some RDF Utilities to support LDO librariers",
|
|
5
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./dist/index.d.cts",
|
|
17
|
+
"default": "./dist/index.cjs"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
6
22
|
"scripts": {
|
|
7
|
-
"build": "
|
|
23
|
+
"build": "rimraf dist && NODE_OPTIONS=--max-old-space-size=8192 tsdown",
|
|
8
24
|
"watch": "tsc --watch",
|
|
9
|
-
"test": "
|
|
10
|
-
"test:watch": "
|
|
11
|
-
"prepublishOnly": "npm run
|
|
12
|
-
"lint": "eslint src/** --fix --no-error-on-unmatched-pattern"
|
|
25
|
+
"test": "vitest run --coverage",
|
|
26
|
+
"test:watch": "vitest --watch",
|
|
27
|
+
"prepublishOnly": "npm run build",
|
|
28
|
+
"lint": "eslint src/** --fix --no-error-on-unmatched-pattern",
|
|
29
|
+
"remove-dist": "rimraf dist/"
|
|
13
30
|
},
|
|
14
31
|
"repository": {
|
|
15
32
|
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/o-development/
|
|
33
|
+
"url": "git+https://github.com/o-development/ldo.git"
|
|
17
34
|
},
|
|
18
35
|
"author": "Jackson Morgan",
|
|
19
36
|
"license": "MIT",
|
|
20
37
|
"bugs": {
|
|
21
|
-
"url": "https://github.com/o-development/
|
|
38
|
+
"url": "https://github.com/o-development/ldo/issues"
|
|
22
39
|
},
|
|
23
|
-
"homepage": "https://github.com/o-development/
|
|
40
|
+
"homepage": "https://github.com/o-development/ldo/tree/main/packages/rdf-utils#readme",
|
|
24
41
|
"devDependencies": {
|
|
25
|
-
"@rdfjs/types": "^1.0.1",
|
|
26
42
|
"@types/jsonld": "^1.5.9"
|
|
27
43
|
},
|
|
28
44
|
"dependencies": {
|
|
29
45
|
"@rdfjs/data-model": "^1.2.0",
|
|
46
|
+
"@rdfjs/types": "^1.0.1",
|
|
30
47
|
"n3": "^1.17.1",
|
|
31
48
|
"rdf-string": "^1.6.3"
|
|
32
49
|
},
|
|
@@ -37,5 +54,5 @@
|
|
|
37
54
|
"publishConfig": {
|
|
38
55
|
"access": "public"
|
|
39
56
|
},
|
|
40
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "ac9581d27e78e3e813620d0651390ad01d5a387a"
|
|
41
58
|
}
|
package/src/datasetChanges.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
+
// src/utils/rdfjs-data-model-interop.ts
|
|
3
|
+
import * as rdfdmNamespace from "@rdfjs/data-model";
|
|
4
|
+
|
|
5
|
+
// The interop shim
|
|
6
|
+
let RdfDataModelResolved;
|
|
7
|
+
if (
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
rdfdmNamespace.default &&
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
typeof rdfdmNamespace.default.namedNode === "function"
|
|
12
|
+
) {
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
RdfDataModelResolved = rdfdmNamespace.default;
|
|
15
|
+
} else {
|
|
16
|
+
RdfDataModelResolved = rdfdmNamespace;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const quad: (typeof rdfdmNamespace)["quad"] = RdfDataModelResolved.quad;
|
|
20
|
+
export const namedNode: (typeof rdfdmNamespace)["namedNode"] =
|
|
21
|
+
RdfDataModelResolved.namedNode;
|
|
22
|
+
export const blankNode: (typeof rdfdmNamespace)["blankNode"] =
|
|
23
|
+
RdfDataModelResolved.blankNode;
|
|
24
|
+
export const literal: (typeof rdfdmNamespace)["literal"] =
|
|
25
|
+
RdfDataModelResolved.literal;
|
|
26
|
+
export const defaultGraph: (typeof rdfdmNamespace)["defaultGraph"] =
|
|
27
|
+
RdfDataModelResolved.defaultGraph;
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,mDAAiC;AACjC,sDAAoC;AACpC,sDAAoC"}
|