rete-graph 0.1.0 → 0.2.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.
Binary file
package/index.d.ts CHANGED
@@ -63,3 +63,20 @@ export function build(text: string, format?: "nt" | "nq" | "ttl"): Promise<Uint8
63
63
 
64
64
  /** Initialize the wasm engine explicitly (open()/build() do it lazily). */
65
65
  export function init(source?: BufferSource | WebAssembly.Module | URL | string | null): Promise<void>;
66
+
67
+ /**
68
+ * RDF/JS Source over an open Graph — plugs `.rete` files into Comunica,
69
+ * LDflex, GraphQL-LD, and anything speaking the RDF/JS Source interface:
70
+ * `sources: [new ReteSource(graph)]`. Each match() is one pattern lookup
71
+ * against the file's indexes; Comunica performs the joins. For heavy
72
+ * multi-join queries over big REMOTE files prefer full pushdown via a
73
+ * SPARQL endpoint (`rete serve`, or the gateway's `/sparql/<key-or-url>`).
74
+ */
75
+ export class ReteSource {
76
+ constructor(graph: Graph);
77
+ readonly graph: Graph;
78
+ /** RDF/JS Stream of quads matching the pattern (null/Variable = free). */
79
+ match(subject?: unknown, predicate?: unknown, object?: unknown, graph?: unknown): unknown;
80
+ /** Number of matching quads (helps query planners order joins). */
81
+ countQuads(subject?: unknown, predicate?: unknown, object?: unknown, graph?: unknown): number;
82
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rete-graph",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Query local and remote .rete graph files with SPARQL — WebAssembly client for browsers and Node.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -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
  }