@wazootech/worlds-sdk 0.11.4 → 0.11.6
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 +1 -0
- package/dist/{build-search-result-id-DPlgkWyi.js → build-search-result-id-owYEv-UZ.js} +1 -1
- package/dist/{chunk-and-embed-BlB2v4-2.js → chunk-and-embed-CNYO49kB.js} +1 -1
- package/dist/{client-B1oktOm6.d.ts → client-DHhpNpi6.d.ts} +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/memory.d.ts +1 -1
- package/dist/memory.js +1 -1
- package/dist/{mod-CfzcRVcL.d.ts → mod-Du9mzmwt.d.ts} +1 -1
- package/dist/{mod-C_Is4DOx.d.ts → mod-Q0-ml33V.d.ts} +1 -1
- package/dist/{mod-CH7Hc3EE.d.ts → mod-aUvsYiTJ.d.ts} +10 -5
- package/dist/quad-chunker.js +1 -1
- package/dist/{quad-store-oBgXOONP.js → quad-store-CT8YQQky.js} +55 -23
- package/dist/quad-store.d.ts +1 -1
- package/dist/quad-store.js +1 -1
- package/dist/{rdfjs-DodYvbzF.js → rdfjs-CN2lccto.js} +2 -2
- package/dist/rdfjs.d.ts +2 -2
- package/dist/rdfjs.js +1 -1
- package/dist/search-index.d.ts +1 -1
- package/dist/search-index.js +3 -3
- package/dist/shacl.d.ts +101 -0
- package/dist/shacl.js +970 -0
- package/dist/sparql-engine.d.ts +1 -1
- package/dist/testing.d.ts +6 -4
- package/dist/testing.js +39 -2
- package/dist/wazoo.d.ts +4 -4
- package/package.json +9 -1
package/dist/sparql-engine.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SparqlSelectResults, c as SparqlRequest, i as SparqlResponse, n as SparqlBinding, o as SparqlValue, r as SparqlConstructResults, s as SparqlEngineInterface, t as SparqlAskResults } from "./mod-
|
|
1
|
+
import { a as SparqlSelectResults, c as SparqlRequest, i as SparqlResponse, n as SparqlBinding, o as SparqlValue, r as SparqlConstructResults, s as SparqlEngineInterface, t as SparqlAskResults } from "./mod-Q0-ml33V.js";
|
|
2
2
|
export type { SparqlAskResults, SparqlBinding, SparqlConstructResults, SparqlEngineInterface, SparqlRequest, SparqlResponse, SparqlSelectResults, SparqlValue };
|
package/dist/testing.d.ts
CHANGED
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
* `createMemoryWorldsSdk` as the portable reference; `@wazootech/worlds-sqlite` is the
|
|
14
14
|
* durable source of truth for SQLite-family behavior.
|
|
15
15
|
*/
|
|
16
|
-
import { D as SearchRequest, T as SearchIndexOnImport } from "./mod-
|
|
17
|
-
import { o as SparqlValue } from "./mod-
|
|
18
|
-
import { n as WorldsSdkInterface } from "./client-
|
|
16
|
+
import { D as SearchRequest, T as SearchIndexOnImport } from "./mod-Du9mzmwt.js";
|
|
17
|
+
import { o as SparqlValue } from "./mod-Q0-ml33V.js";
|
|
18
|
+
import { n as WorldsSdkInterface } from "./client-DHhpNpi6.js";
|
|
19
19
|
import * as rdfjs from "@rdfjs/types";
|
|
20
|
-
import { U as TransactionContext, Y as Patch } from "./mod-
|
|
20
|
+
import { U as TransactionContext, Y as Patch } from "./mod-aUvsYiTJ.js";
|
|
21
21
|
import { t as EmbeddingService } from "./embedding-service-DebRMVmn.js";
|
|
22
22
|
/**
|
|
23
23
|
* Parity fixtures are the shared corpus every durable backend runs in its
|
|
@@ -51,6 +51,8 @@ export interface ParitySearchCase {
|
|
|
51
51
|
export interface ParitySparqlCase {
|
|
52
52
|
/** name identifies the case in the parity report. */
|
|
53
53
|
name: string;
|
|
54
|
+
/** update is an optional SPARQL update both Sdks run before the query. */
|
|
55
|
+
update?: string;
|
|
54
56
|
/** query is the SPARQL query executed against both Sdks. */
|
|
55
57
|
query: string;
|
|
56
58
|
/** expected is the hand-authored result both Sdks must satisfy. */
|
package/dist/testing.js
CHANGED
|
@@ -1,7 +1,39 @@
|
|
|
1
|
-
import { h as hashQuad } from "./quad-store-
|
|
1
|
+
import { h as hashQuad } from "./quad-store-CT8YQQky.js";
|
|
2
2
|
import { o as materializeImportQuads } from "./rdf-formats-C2znopLM.js";
|
|
3
3
|
import { DataFactory } from "n3";
|
|
4
4
|
import { FakeEmbeddingService } from "./embedding-service.js";
|
|
5
|
+
// src/testing/parity-update-order.ts
|
|
6
|
+
const stored = "<urn:alice> <urn:likes> \"sailing\"";
|
|
7
|
+
const missing = "<urn:alice> <urn:likes> \"rowing\"";
|
|
8
|
+
/** lastOperationWins expects one update request to leave its last operation's result. */
|
|
9
|
+
function lastOperationWins(name, update, fact, present) {
|
|
10
|
+
return {
|
|
11
|
+
name,
|
|
12
|
+
update,
|
|
13
|
+
query: `ASK { ${fact} }`,
|
|
14
|
+
expected: {
|
|
15
|
+
kind: "ask",
|
|
16
|
+
boolean: present
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* updateOrderWorld changes one fact more than once in a single update request.
|
|
22
|
+
* A backend that buffers the request into one patch must keep the last
|
|
23
|
+
* operation, whether or not the fact was stored before.
|
|
24
|
+
*/
|
|
25
|
+
const updateOrderWorld = {
|
|
26
|
+
name: "updateOrderWorld",
|
|
27
|
+
nquads: `${stored} .`,
|
|
28
|
+
totalQuads: 1,
|
|
29
|
+
sparql: [
|
|
30
|
+
lastOperationWins("insert then delete removes a stored fact", `INSERT DATA { ${stored} } ; DELETE DATA { ${stored} }`, stored, false),
|
|
31
|
+
lastOperationWins("insert then delete leaves a missing fact missing", `INSERT DATA { ${missing} } ; DELETE DATA { ${missing} }`, missing, false),
|
|
32
|
+
lastOperationWins("delete then insert keeps a stored fact", `DELETE DATA { ${stored} } ; INSERT DATA { ${stored} }`, stored, true),
|
|
33
|
+
lastOperationWins("delete then insert adds a missing fact", `DELETE DATA { ${missing} } ; INSERT DATA { ${missing} }`, missing, true),
|
|
34
|
+
lastOperationWins("the last of three operations wins", `DELETE DATA { ${stored} } ; INSERT DATA { ${stored} } ; DELETE DATA { ${stored} }`, stored, false)
|
|
35
|
+
]
|
|
36
|
+
};
|
|
5
37
|
// src/testing/parity-fixtures.ts
|
|
6
38
|
const XSD = "http://www.w3.org/2001/XMLSchema#";
|
|
7
39
|
/**
|
|
@@ -261,7 +293,8 @@ const parityCorpus = {
|
|
|
261
293
|
typedLiteralsWorld,
|
|
262
294
|
rdfStarWorld,
|
|
263
295
|
chunkBoundaryWorld,
|
|
264
|
-
emptyWorld
|
|
296
|
+
emptyWorld,
|
|
297
|
+
updateOrderWorld
|
|
265
298
|
],
|
|
266
299
|
replaceCases: [replaceModeCase]
|
|
267
300
|
};
|
|
@@ -409,6 +442,10 @@ async function checkSparqlCase(fixtureName, options, nquads, sparqlCase, failure
|
|
|
409
442
|
const cand = await options.candidate();
|
|
410
443
|
await importNquads(ref, nquads);
|
|
411
444
|
await importNquads(cand, nquads);
|
|
445
|
+
if (sparqlCase.update) {
|
|
446
|
+
await ref.sparql({ query: sparqlCase.update });
|
|
447
|
+
await cand.sparql({ query: sparqlCase.update });
|
|
448
|
+
}
|
|
412
449
|
const refResponse = await ref.sparql({ query: sparqlCase.query });
|
|
413
450
|
const candResponse = await cand.sparql({ query: sparqlCase.query });
|
|
414
451
|
checkSparqlAgainstExpectation(fixtureName, sparqlCase.name, "reference", refResponse, sparqlCase.expected, failures);
|
package/dist/wazoo.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as WorldsSdkInterface } from "./client-
|
|
1
|
+
import { n as WorldsSdkInterface } from "./client-DHhpNpi6.js";
|
|
2
2
|
import { Client } from "@wazootech/worlds-client";
|
|
3
|
-
import { $ as ImportRequest, X as ExportRequest, Z as ExportResponse, tt as QuadStoreInterface } from "./mod-
|
|
4
|
-
import { C as ReindexResponse, D as SearchRequest, O as SearchResponse, S as ReindexRequest, w as SearchIndexInterface } from "./mod-
|
|
5
|
-
import { c as SparqlRequest, i as SparqlResponse, s as SparqlEngineInterface } from "./mod-
|
|
3
|
+
import { $ as ImportRequest, X as ExportRequest, Z as ExportResponse, tt as QuadStoreInterface } from "./mod-aUvsYiTJ.js";
|
|
4
|
+
import { C as ReindexResponse, D as SearchRequest, O as SearchResponse, S as ReindexRequest, w as SearchIndexInterface } from "./mod-Du9mzmwt.js";
|
|
5
|
+
import { c as SparqlRequest, i as SparqlResponse, s as SparqlEngineInterface } from "./mod-Q0-ml33V.js";
|
|
6
6
|
/**
|
|
7
7
|
* CreateWazooSdkOptions configures the remote Worlds SDK client.
|
|
8
8
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wazootech/worlds-sdk",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.6",
|
|
4
4
|
"description": "Give an agent a knowledge graph it can search and query with SPARQL: in memory, on a Worlds storage package such as SQLite or Postgres, or on the hosted Worlds API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wazoo",
|
|
@@ -60,6 +60,10 @@
|
|
|
60
60
|
"types": "./dist/rdfjs.d.ts",
|
|
61
61
|
"default": "./dist/rdfjs.js"
|
|
62
62
|
},
|
|
63
|
+
"./shacl": {
|
|
64
|
+
"types": "./dist/shacl.d.ts",
|
|
65
|
+
"default": "./dist/shacl.js"
|
|
66
|
+
},
|
|
63
67
|
"./memory": {
|
|
64
68
|
"types": "./dist/memory.d.ts",
|
|
65
69
|
"default": "./dist/memory.js"
|
|
@@ -94,6 +98,7 @@
|
|
|
94
98
|
"test": "bun test",
|
|
95
99
|
"build": "tsdown",
|
|
96
100
|
"check:package": "bun scripts/check-package.ts",
|
|
101
|
+
"mutation": "stryker run",
|
|
97
102
|
"ci": "bun run fmt:check && bun run lint && bun run check && bun run test"
|
|
98
103
|
},
|
|
99
104
|
"dependencies": {
|
|
@@ -105,6 +110,8 @@
|
|
|
105
110
|
"@wazootech/worlds-client": "^0.8.2",
|
|
106
111
|
"ai": "^6.0.195",
|
|
107
112
|
"n3": "^2.0.3",
|
|
113
|
+
"rdf-validate-shacl": "0.6.5",
|
|
114
|
+
"re2js": "2.10.0",
|
|
108
115
|
"zod": "^3.25.76 || ^4.1.8"
|
|
109
116
|
},
|
|
110
117
|
"devDependencies": {
|
|
@@ -112,6 +119,7 @@
|
|
|
112
119
|
"@langchain/core": "^1.1.48",
|
|
113
120
|
"@langchain/textsplitters": "^1.0.1",
|
|
114
121
|
"@std/encoding": "npm:@jsr/std__encoding@^1.0.10",
|
|
122
|
+
"@stryker-mutator/core": "10.1.1",
|
|
115
123
|
"@types/bun": "1.4.5",
|
|
116
124
|
"@types/n3": "1.26.1",
|
|
117
125
|
"oxlint": "1.95.0",
|