@blackcatinformatics/purrdf 0.3.1 → 0.3.3
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/package.json +1 -1
- package/pkg/purrdf_wasm.d.ts +10 -0
- package/pkg/purrdf_wasm.js +39 -0
- package/pkg/purrdf_wasm_bg.wasm +0 -0
- package/pkg/purrdf_wasm_bg.wasm.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blackcatinformatics/purrdf",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "A wasm32, in-memory RDF 1.2 engine with an idiomatic RDF/JS (DataFactory/Dataset/Stream) API. Quoted-triple terms and directional literals included.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT OR Apache-2.0",
|
package/pkg/purrdf_wasm.d.ts
CHANGED
|
@@ -237,6 +237,15 @@ export class Term {
|
|
|
237
237
|
readonly value: string;
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
+
/**
|
|
241
|
+
* `shaclEntail(shapesTtl, dataNt)` → the materialized dataset as an N-Triples
|
|
242
|
+
* string (the base graph plus every inferred triple).
|
|
243
|
+
*
|
|
244
|
+
* `shapesTtl` is a Turtle shapes graph; `dataNt` is an N-Triples data graph.
|
|
245
|
+
* Throws (rejects) if either graph fails to parse or if rule application fails.
|
|
246
|
+
*/
|
|
247
|
+
export function shaclEntail(shapes_ttl: string, data_nt: string): string;
|
|
248
|
+
|
|
240
249
|
/**
|
|
241
250
|
* `shaclValidateToSarif(shapesTtl, dataNt)` → a SARIF 2.1.0 JSON string.
|
|
242
251
|
*
|
|
@@ -292,6 +301,7 @@ export interface InitOutput {
|
|
|
292
301
|
readonly quad_subject: (a: number) => number;
|
|
293
302
|
readonly quad_term_type: (a: number, b: number) => void;
|
|
294
303
|
readonly quad_value: (a: number, b: number) => void;
|
|
304
|
+
readonly shaclEntail: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
295
305
|
readonly shaclValidateToSarif: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
296
306
|
readonly sink_finish: (a: number, b: number) => void;
|
|
297
307
|
readonly sink_new: () => number;
|
package/pkg/purrdf_wasm.js
CHANGED
|
@@ -840,6 +840,45 @@ export class Term {
|
|
|
840
840
|
}
|
|
841
841
|
if (Symbol.dispose) Term.prototype[Symbol.dispose] = Term.prototype.free;
|
|
842
842
|
|
|
843
|
+
/**
|
|
844
|
+
* `shaclEntail(shapesTtl, dataNt)` → the materialized dataset as an N-Triples
|
|
845
|
+
* string (the base graph plus every inferred triple).
|
|
846
|
+
*
|
|
847
|
+
* `shapesTtl` is a Turtle shapes graph; `dataNt` is an N-Triples data graph.
|
|
848
|
+
* Throws (rejects) if either graph fails to parse or if rule application fails.
|
|
849
|
+
* @param {string} shapes_ttl
|
|
850
|
+
* @param {string} data_nt
|
|
851
|
+
* @returns {string}
|
|
852
|
+
*/
|
|
853
|
+
export function shaclEntail(shapes_ttl, data_nt) {
|
|
854
|
+
let deferred4_0;
|
|
855
|
+
let deferred4_1;
|
|
856
|
+
try {
|
|
857
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
858
|
+
const ptr0 = passStringToWasm0(shapes_ttl, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
859
|
+
const len0 = WASM_VECTOR_LEN;
|
|
860
|
+
const ptr1 = passStringToWasm0(data_nt, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
861
|
+
const len1 = WASM_VECTOR_LEN;
|
|
862
|
+
wasm.shaclEntail(retptr, ptr0, len0, ptr1, len1);
|
|
863
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
864
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
865
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
866
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
867
|
+
var ptr3 = r0;
|
|
868
|
+
var len3 = r1;
|
|
869
|
+
if (r3) {
|
|
870
|
+
ptr3 = 0; len3 = 0;
|
|
871
|
+
throw takeObject(r2);
|
|
872
|
+
}
|
|
873
|
+
deferred4_0 = ptr3;
|
|
874
|
+
deferred4_1 = len3;
|
|
875
|
+
return getStringFromWasm0(ptr3, len3);
|
|
876
|
+
} finally {
|
|
877
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
878
|
+
wasm.__wbindgen_export3(deferred4_0, deferred4_1, 1);
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
|
|
843
882
|
/**
|
|
844
883
|
* `shaclValidateToSarif(shapesTtl, dataNt)` → a SARIF 2.1.0 JSON string.
|
|
845
884
|
*
|
package/pkg/purrdf_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -36,6 +36,7 @@ export const quad_predicate: (a: number) => number;
|
|
|
36
36
|
export const quad_subject: (a: number) => number;
|
|
37
37
|
export const quad_term_type: (a: number, b: number) => void;
|
|
38
38
|
export const quad_value: (a: number, b: number) => void;
|
|
39
|
+
export const shaclEntail: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
39
40
|
export const shaclValidateToSarif: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
40
41
|
export const sink_finish: (a: number, b: number) => void;
|
|
41
42
|
export const sink_new: () => number;
|