@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.
@@ -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-C_Is4DOx.js";
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-CfzcRVcL.js";
17
- import { o as SparqlValue } from "./mod-C_Is4DOx.js";
18
- import { n as WorldsSdkInterface } from "./client-B1oktOm6.js";
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-CH7Hc3EE.js";
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-oBgXOONP.js";
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-B1oktOm6.js";
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-CH7Hc3EE.js";
4
- import { C as ReindexResponse, D as SearchRequest, O as SearchResponse, S as ReindexRequest, w as SearchIndexInterface } from "./mod-CfzcRVcL.js";
5
- import { c as SparqlRequest, i as SparqlResponse, s as SparqlEngineInterface } from "./mod-C_Is4DOx.js";
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.4",
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",