rete-graph 0.1.0 → 0.3.0
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/README.md +21 -1
- package/dist/index.js +1283 -23
- package/dist/rete-graph.js +1284 -24
- package/dist/rete-graph.min.js +61 -10
- package/dist/rete_wasm_bg.wasm +0 -0
- package/index.d.ts +34 -3
- package/package.json +3 -2
package/dist/rete_wasm_bg.wasm
CHANGED
|
Binary file
|
package/index.d.ts
CHANGED
|
@@ -40,6 +40,15 @@ export class Graph {
|
|
|
40
40
|
relations: [s: string, p: string, o: string, count: number][];
|
|
41
41
|
};
|
|
42
42
|
info(): { quads: number; terms: number; pyramidLevels: number; namedGraphs: number };
|
|
43
|
+
/** The embedded Dataset Card, or null when the file carries none. */
|
|
44
|
+
card(): Record<string, unknown> | null;
|
|
45
|
+
/** Example SPARQL queries from the card; `sparql` plus optional rich fields. */
|
|
46
|
+
examples(): { sparql: string; title?: string; question?: string }[];
|
|
47
|
+
/** Validate SHACL Core shapes (Turtle); lazy over remote graphs. */
|
|
48
|
+
shacl(
|
|
49
|
+
shapesTurtle: string,
|
|
50
|
+
opts?: { graph?: string | null; format?: "json" | "text" },
|
|
51
|
+
): unknown;
|
|
43
52
|
readonly quads: number;
|
|
44
53
|
graphNames(): string[];
|
|
45
54
|
/** Remote graphs only: cumulative fetch counters; null for bytes graphs. */
|
|
@@ -49,17 +58,39 @@ export class Graph {
|
|
|
49
58
|
}
|
|
50
59
|
|
|
51
60
|
/**
|
|
52
|
-
* Open a `.rete` graph: bytes,
|
|
53
|
-
*
|
|
54
|
-
*
|
|
61
|
+
* Open a `.rete` graph: bytes, an http(s) URL read lazily over HTTP Range, or
|
|
62
|
+
* (Node only) a `file://` URL read lazily off disk — same byte-range path, so
|
|
63
|
+
* a huge local file is queryable without loading it. Lazy opens use
|
|
64
|
+
* synchronous XHR: Node and browser web workers only (browser main threads
|
|
65
|
+
* forbid sync binary XHR — open bytes there).
|
|
55
66
|
*/
|
|
56
67
|
export function open(
|
|
57
68
|
source: Uint8Array | ArrayBuffer | string,
|
|
58
69
|
opts?: { headers?: Record<string, string> },
|
|
59
70
|
): Promise<Graph>;
|
|
60
71
|
|
|
72
|
+
/** The raw wasm engine — escape hatch for exports this wrapper doesn't wrap. */
|
|
73
|
+
export const wasm: Record<string, (...args: never[]) => unknown>;
|
|
74
|
+
|
|
61
75
|
/** Build a complete `.rete` file image from RDF text ("nt", "nq", "ttl"). */
|
|
62
76
|
export function build(text: string, format?: "nt" | "nq" | "ttl"): Promise<Uint8Array>;
|
|
63
77
|
|
|
64
78
|
/** Initialize the wasm engine explicitly (open()/build() do it lazily). */
|
|
65
79
|
export function init(source?: BufferSource | WebAssembly.Module | URL | string | null): Promise<void>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* RDF/JS Source over an open Graph — plugs `.rete` files into Comunica,
|
|
83
|
+
* LDflex, GraphQL-LD, and anything speaking the RDF/JS Source interface:
|
|
84
|
+
* `sources: [new ReteSource(graph)]`. Each match() is one pattern lookup
|
|
85
|
+
* against the file's indexes; Comunica performs the joins. For heavy
|
|
86
|
+
* multi-join queries over big REMOTE files prefer full pushdown via a
|
|
87
|
+
* SPARQL endpoint (`rete serve`, or the gateway's `/sparql/<key-or-url>`).
|
|
88
|
+
*/
|
|
89
|
+
export class ReteSource {
|
|
90
|
+
constructor(graph: Graph);
|
|
91
|
+
readonly graph: Graph;
|
|
92
|
+
/** RDF/JS Stream of quads matching the pattern (null/Variable = free). */
|
|
93
|
+
match(subject?: unknown, predicate?: unknown, object?: unknown, graph?: unknown): unknown;
|
|
94
|
+
/** Number of matching quads (helps query planners order joins). */
|
|
95
|
+
countQuads(subject?: unknown, predicate?: unknown, object?: unknown, graph?: unknown): number;
|
|
96
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rete-graph",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Query local and remote .rete graph files with SPARQL — WebAssembly client for browsers and Node.",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Query local and remote .rete graph files with SPARQL — WebAssembly client for browsers and Node, with lazy byte-range reads over HTTP and local files.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"test": "npm run build && node --test --test-timeout=60000 ./test/*.test.mjs"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
+
"@comunica/query-sparql": "^4.0.0",
|
|
31
32
|
"esbuild": "^0.25.0"
|
|
32
33
|
}
|
|
33
34
|
}
|