@factoidal/core 0.7.1 → 0.10.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/CHANGELOG.md +503 -1
- package/NOTICE +2 -21
- package/README.md +117 -993
- package/api.d.ts +53 -0
- package/api.js +5 -0
- package/api.mjs +56 -0
- package/bin/engine.mjs +38 -19
- package/bin/factoidal.mjs +512 -66
- package/bin/pack.mjs +37 -0
- package/bin/serve-worker.mjs +32 -0
- package/bin/serve.mjs +423 -0
- package/bin/store-worker-host.mjs +1 -1
- package/bin/store.mjs +1 -1
- package/browser.d.ts +110 -507
- package/browser.js +151 -2257
- package/docs/fuseki-replacement.md +108 -0
- package/fn.d.ts +24 -95
- package/fn.js +104 -150
- package/index.d.ts +598 -259
- package/index.js +4 -234
- package/index.mjs +176 -84
- package/l4-assets/l4factoidal.js +47 -7
- package/l4-assets/l4factoidal.mjs +1 -1
- package/l4-assets/l4factoidal.wasm +0 -0
- package/l4-assets/version.json +11 -7
- package/lib/api.mjs +2300 -0
- package/lib/browser-engine.mjs +69 -0
- package/lib/dataset.mjs +377 -0
- package/lib/delta-log-hosts.mjs +191 -0
- package/lib/lean-entry.mjs +204 -0
- package/lib/pure.mjs +98 -0
- package/lib/store.mjs +115 -0
- package/lib/version.mjs +5 -0
- package/lws/README.md +97 -0
- package/lws/server.mjs +331 -0
- package/package.json +59 -61
- package/rdfjs.js +5 -536
- package/rdfjs.mjs +594 -0
- package/sample-store.d.ts +8 -16
- package/sample-store.mjs +39 -29
- package/solid/client/README.md +100 -0
- package/solid/client/index.mjs +277 -0
- package/solid/server/README.md +96 -0
- package/solid/server/index.mjs +317 -0
- package/store-host/deno.mjs +8 -0
- package/store-host/index.mjs +12 -0
- package/store-host/node.mjs +8 -0
- package/xmpp/README.md +107 -0
- package/xmpp/index.mjs +229 -0
- package/browser-wasm.js +0 -872
- package/factoidal-npm-entry.js +0 -15477
- package/factoidal-npm-entry.wasm.assets/code-5a7fc68f2ab1323718b8.wasm +0 -0
- package/factoidal-npm-entry.wasm.js +0 -455
- package/factoidal.js +0 -13118
- package/factoidal.wasm.assets/code-bbe6099bfb5b10c4c3ab.wasm +0 -0
- package/factoidal.wasm.js +0 -457
- package/hacl-init.js +0 -92
- package/hacl-wasm/FStar.wasm +0 -0
- package/hacl-wasm/Hacl_Bignum.wasm +0 -0
- package/hacl-wasm/Hacl_Bignum25519_51.wasm +0 -0
- package/hacl-wasm/Hacl_Bignum_Base.wasm +0 -0
- package/hacl-wasm/Hacl_Curve25519_51.wasm +0 -0
- package/hacl-wasm/Hacl_Ed25519.wasm +0 -0
- package/hacl-wasm/Hacl_Ed25519_PrecompTable.wasm +0 -0
- package/hacl-wasm/Hacl_Hash_Base.wasm +0 -0
- package/hacl-wasm/Hacl_Hash_SHA2.wasm +0 -0
- package/hacl-wasm/Hacl_IntTypes_Intrinsics.wasm +0 -0
- package/hacl-wasm/LowStar_Endianness.wasm +0 -0
- package/hacl-wasm/WasmSupport.wasm +0 -0
- package/hacl-wasm/api.js +0 -775
- package/hacl-wasm/api.json +0 -3787
- package/hacl-wasm/layouts.json +0 -1
- package/hacl-wasm/loader.js +0 -568
- package/hacl-wasm/shell.js +0 -12
- package/l4-core.d.ts +0 -159
- package/l4-core.js +0 -188
- package/l4.d.ts +0 -50
- package/l4.js +0 -104
- package/lib/api.js +0 -2300
- package/lib/engine-js.js +0 -165
- package/lib/engine-wasm.js +0 -300
- package/sample-store/CURRENT +0 -1
- package/sample-store/gen-1/manifest.sbm2 +0 -0
- package/sample-store/gen-1/manifest.tsv +0 -14
- package/sample-store/gen-1/predicate-0.ibk3 +0 -0
- package/sample-store/gen-1/predicate-0.ibk3.merkle +0 -1
- package/sample-store/gen-1/predicate-0.ibk3.oli2 +0 -0
- package/sample-store/gen-1/predicate-0.ibk3.oli2.merkle +0 -1
- package/sample-store/gen-1/predicate-0.ibk3.sri2 +0 -0
- package/sample-store/gen-1/predicate-0.ibk3.sri2.merkle +0 -1
- package/sample-store/gen-1/predicate-0.ibk3.tli1 +0 -0
- package/sample-store/gen-1/predicate-0.ibk3.tli1.merkle +0 -0
- package/sample-store/gen-1/predicate-1.ibk3 +0 -0
- package/sample-store/gen-1/predicate-1.ibk3.merkle +0 -0
- package/sample-store/gen-1/predicate-1.ibk3.oli2 +0 -0
- package/sample-store/gen-1/predicate-1.ibk3.oli2.merkle +0 -0
- package/sample-store/gen-1/predicate-1.ibk3.sri2 +0 -0
- package/sample-store/gen-1/predicate-1.ibk3.sri2.merkle +0 -1
- package/sample-store/gen-1/predicate-1.ibk3.tli1 +0 -0
- package/sample-store/gen-1/predicate-1.ibk3.tli1.merkle +0 -1
- package/sample-store/gen-1/predicate-10.ibk3 +0 -0
- package/sample-store/gen-1/predicate-10.ibk3.merkle +0 -1
- package/sample-store/gen-1/predicate-10.ibk3.oli2 +0 -0
- package/sample-store/gen-1/predicate-10.ibk3.oli2.merkle +0 -0
- package/sample-store/gen-1/predicate-10.ibk3.sri2 +0 -0
- package/sample-store/gen-1/predicate-10.ibk3.sri2.merkle +0 -1
- package/sample-store/gen-1/predicate-10.ibk3.tli1 +0 -0
- package/sample-store/gen-1/predicate-10.ibk3.tli1.merkle +0 -1
- package/sample-store/gen-1/predicate-11.ibk3 +0 -0
- package/sample-store/gen-1/predicate-11.ibk3.merkle +0 -0
- package/sample-store/gen-1/predicate-11.ibk3.oli2 +0 -0
- package/sample-store/gen-1/predicate-11.ibk3.oli2.merkle +0 -1
- package/sample-store/gen-1/predicate-11.ibk3.sri2 +0 -0
- package/sample-store/gen-1/predicate-11.ibk3.sri2.merkle +0 -1
- package/sample-store/gen-1/predicate-11.ibk3.tli1 +0 -0
- package/sample-store/gen-1/predicate-11.ibk3.tli1.merkle +0 -1
- package/sample-store/gen-1/predicate-12.ibk3 +0 -0
- package/sample-store/gen-1/predicate-12.ibk3.merkle +0 -1
- package/sample-store/gen-1/predicate-12.ibk3.oli2 +0 -0
- package/sample-store/gen-1/predicate-12.ibk3.oli2.merkle +0 -1
- package/sample-store/gen-1/predicate-12.ibk3.sri2 +0 -0
- package/sample-store/gen-1/predicate-12.ibk3.sri2.merkle +0 -1
- package/sample-store/gen-1/predicate-12.ibk3.tli1 +0 -0
- package/sample-store/gen-1/predicate-12.ibk3.tli1.merkle +0 -1
- package/sample-store/gen-1/predicate-2.ibk3 +0 -0
- package/sample-store/gen-1/predicate-2.ibk3.merkle +0 -1
- package/sample-store/gen-1/predicate-2.ibk3.oli2 +0 -0
- package/sample-store/gen-1/predicate-2.ibk3.oli2.merkle +0 -1
- package/sample-store/gen-1/predicate-2.ibk3.sri2 +0 -0
- package/sample-store/gen-1/predicate-2.ibk3.sri2.merkle +0 -0
- package/sample-store/gen-1/predicate-2.ibk3.tli1 +0 -0
- package/sample-store/gen-1/predicate-2.ibk3.tli1.merkle +0 -0
- package/sample-store/gen-1/predicate-3.ibk3 +0 -0
- package/sample-store/gen-1/predicate-3.ibk3.merkle +0 -1
- package/sample-store/gen-1/predicate-3.ibk3.oli2 +0 -0
- package/sample-store/gen-1/predicate-3.ibk3.oli2.merkle +0 -1
- package/sample-store/gen-1/predicate-3.ibk3.sri2 +0 -0
- package/sample-store/gen-1/predicate-3.ibk3.sri2.merkle +0 -1
- package/sample-store/gen-1/predicate-3.ibk3.tli1 +0 -0
- package/sample-store/gen-1/predicate-3.ibk3.tli1.merkle +0 -1
- package/sample-store/gen-1/predicate-4.ibk3 +0 -0
- package/sample-store/gen-1/predicate-4.ibk3.merkle +0 -0
- package/sample-store/gen-1/predicate-4.ibk3.oli2 +0 -0
- package/sample-store/gen-1/predicate-4.ibk3.oli2.merkle +0 -1
- package/sample-store/gen-1/predicate-4.ibk3.sri2 +0 -0
- package/sample-store/gen-1/predicate-4.ibk3.sri2.merkle +0 -1
- package/sample-store/gen-1/predicate-4.ibk3.tli1 +0 -0
- package/sample-store/gen-1/predicate-4.ibk3.tli1.merkle +0 -2
- package/sample-store/gen-1/predicate-5.ibk3 +0 -0
- package/sample-store/gen-1/predicate-5.ibk3.merkle +0 -1
- package/sample-store/gen-1/predicate-5.ibk3.oli2 +0 -0
- package/sample-store/gen-1/predicate-5.ibk3.oli2.merkle +0 -1
- package/sample-store/gen-1/predicate-5.ibk3.sri2 +0 -0
- package/sample-store/gen-1/predicate-5.ibk3.sri2.merkle +0 -1
- package/sample-store/gen-1/predicate-5.ibk3.tli1 +0 -0
- package/sample-store/gen-1/predicate-5.ibk3.tli1.merkle +0 -1
- package/sample-store/gen-1/predicate-6.ibk3 +0 -0
- package/sample-store/gen-1/predicate-6.ibk3.merkle +0 -1
- package/sample-store/gen-1/predicate-6.ibk3.oli2 +0 -0
- package/sample-store/gen-1/predicate-6.ibk3.oli2.merkle +0 -1
- package/sample-store/gen-1/predicate-6.ibk3.sri2 +0 -0
- package/sample-store/gen-1/predicate-6.ibk3.sri2.merkle +0 -1
- package/sample-store/gen-1/predicate-6.ibk3.tli1 +0 -0
- package/sample-store/gen-1/predicate-6.ibk3.tli1.merkle +0 -0
- package/sample-store/gen-1/predicate-7.ibk3 +0 -0
- package/sample-store/gen-1/predicate-7.ibk3.merkle +0 -0
- package/sample-store/gen-1/predicate-7.ibk3.oli2 +0 -0
- package/sample-store/gen-1/predicate-7.ibk3.oli2.merkle +0 -2
- package/sample-store/gen-1/predicate-7.ibk3.sri2 +0 -0
- package/sample-store/gen-1/predicate-7.ibk3.sri2.merkle +0 -1
- package/sample-store/gen-1/predicate-7.ibk3.tli1 +0 -0
- package/sample-store/gen-1/predicate-7.ibk3.tli1.merkle +0 -1
- package/sample-store/gen-1/predicate-8.ibk3 +0 -0
- package/sample-store/gen-1/predicate-8.ibk3.merkle +0 -1
- package/sample-store/gen-1/predicate-8.ibk3.oli2 +0 -0
- package/sample-store/gen-1/predicate-8.ibk3.oli2.merkle +0 -1
- package/sample-store/gen-1/predicate-8.ibk3.sri2 +0 -0
- package/sample-store/gen-1/predicate-8.ibk3.sri2.merkle +0 -1
- package/sample-store/gen-1/predicate-8.ibk3.tli1 +0 -0
- package/sample-store/gen-1/predicate-8.ibk3.tli1.merkle +0 -1
- package/sample-store/gen-1/predicate-9.ibk3 +0 -0
- package/sample-store/gen-1/predicate-9.ibk3.merkle +0 -1
- package/sample-store/gen-1/predicate-9.ibk3.oli2 +0 -0
- package/sample-store/gen-1/predicate-9.ibk3.oli2.merkle +0 -1
- package/sample-store/gen-1/predicate-9.ibk3.sri2 +0 -0
- package/sample-store/gen-1/predicate-9.ibk3.sri2.merkle +0 -3
- package/sample-store/gen-1/predicate-9.ibk3.tli1 +0 -0
- package/sample-store/gen-1/predicate-9.ibk3.tli1.merkle +0 -2
- package/select.d.ts +0 -116
- package/select.js +0 -492
- package/version.json +0 -102
- package/wasm.d.ts +0 -130
- package/wasm.js +0 -158
package/browser.d.ts
CHANGED
|
@@ -1,514 +1,117 @@
|
|
|
1
|
-
// TypeScript declarations for factoidal/browser (browser.js)
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// JSON) rather than the RDF/JS Dataset shapes the Node API returns.
|
|
7
|
-
//
|
|
8
|
-
// Shared value shapes (SPARQL-Results JSON, MathML/XForms/Schematron/
|
|
9
|
-
// TOAN/matrix codecs) are imported from ./index so the two declaration
|
|
10
|
-
// files can never disagree about them.
|
|
11
|
-
|
|
12
|
-
import type {
|
|
13
|
-
SparqlResultsJson,
|
|
14
|
-
MathValue,
|
|
15
|
-
XFormsBind,
|
|
16
|
-
XFormsNodeValidity,
|
|
17
|
-
SchematronFinding,
|
|
18
|
-
ToanExpr,
|
|
19
|
-
MatrixCell,
|
|
20
|
-
MatrixResult,
|
|
21
|
-
XPathResult,
|
|
22
|
-
} from './index';
|
|
1
|
+
// TypeScript declarations for '@factoidal/core/browser' (browser.js): the
|
|
2
|
+
// functions of the main entry (index.d.ts), loaded in the browser. The
|
|
3
|
+
// engine's wasm is fetched and compiled with WebAssembly.instantiateStreaming
|
|
4
|
+
// on the first call. openStore() takes a StoreReader: a page has no file
|
|
5
|
+
// system, so a path string rejects.
|
|
23
6
|
|
|
24
7
|
export type {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
SchematronFinding,
|
|
30
|
-
ToanExpr,
|
|
31
|
-
MatrixCell,
|
|
32
|
-
MatrixResult,
|
|
33
|
-
XPathResult,
|
|
34
|
-
ScaledValue,
|
|
35
|
-
SigmoidParams,
|
|
8
|
+
NamedNode, BlankNode, Literal, Variable, DefaultGraph, Quad, Term, DataFactory,
|
|
9
|
+
DataFormat, EntailRegime, Bindings, DataInput, QueryInput, ParseOptions,
|
|
10
|
+
QueryOptions, SerializeOptions, StoreReader, OpenStoreOptions,
|
|
11
|
+
DeltaLogHandle, DeltaLogInspection,
|
|
36
12
|
} from './index';
|
|
37
13
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
queryString: string,
|
|
121
|
-
options?: {
|
|
122
|
-
entail?: EntailRegime;
|
|
123
|
-
output?: OutputFormat;
|
|
124
|
-
engine?: 'js' | 'wasm';
|
|
125
|
-
wasmUrl?: string;
|
|
126
|
-
transformSource?: (src: string) => string;
|
|
127
|
-
}
|
|
128
|
-
): Promise<SparqlResultsJson | string>;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Run a SPARQL 1.1 query against a read-only HDT artifact's raw bytes
|
|
132
|
-
* (CLI's `--data-hdt` backend). Default graph only, SELECT/ASK only.
|
|
133
|
-
*/
|
|
134
|
-
export function queryHdt(
|
|
135
|
-
hdtBytes: Uint8Array | ArrayBuffer | string,
|
|
136
|
-
sparql: string,
|
|
137
|
-
options?: { output?: OutputFormat }
|
|
138
|
-
): Promise<SparqlResultsJson | string>;
|
|
139
|
-
|
|
140
|
-
// ---------------------------------------------------------------------
|
|
141
|
-
// npm-entry ABI loader + operations that need it. These return the
|
|
142
|
-
// ABI's own parsed {ok, ...} envelope.
|
|
143
|
-
// ---------------------------------------------------------------------
|
|
144
|
-
|
|
145
|
-
/** Override where `factoidal-npm-entry.js` is fetched from. */
|
|
146
|
-
export function setFactoidalNpmEntryUrl(url: string): void;
|
|
147
|
-
/** Fetch + evaluate the npm-entry bundle once, returning its ABI object. */
|
|
148
|
-
export function loadNpmEntry(): Promise<Record<string, (...args: string[]) => string>>;
|
|
149
|
-
|
|
150
|
-
/** RIF Core smoke saturation (a fixed capability probe, no user input). */
|
|
151
|
-
export function rifSmoke(): Promise<{
|
|
152
|
-
inputNquads: string;
|
|
153
|
-
saturatedNquads: string;
|
|
154
|
-
inputCount: number;
|
|
155
|
-
derivedCount: number;
|
|
156
|
-
rounds: number;
|
|
157
|
-
fuel: number;
|
|
158
|
-
engineMs: number;
|
|
159
|
-
}>;
|
|
160
|
-
|
|
161
|
-
/** RIF Core forward-chaining saturation over a premise graph. */
|
|
162
|
-
export function rifEval(
|
|
163
|
-
rifXml: string,
|
|
164
|
-
dataNQuads: string
|
|
165
|
-
): Promise<{ ok: true; saturatedNquads: string; [k: string]: unknown }>;
|
|
166
|
-
|
|
167
|
-
/** SHACL Core validation (dataset-handle N-Quads in). */
|
|
168
|
-
export function shaclValidate(
|
|
169
|
-
dataNQuads: string,
|
|
170
|
-
shapesNQuads: string
|
|
171
|
-
): Promise<{ ok: true; conforms: boolean; reportNquads: string }>;
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* ShEx validation of one focus node against one shape. `verdict` null
|
|
175
|
-
* (deferred:true) means outside the decidable fragment — never guessed.
|
|
176
|
-
*/
|
|
177
|
-
export function shexValidate(
|
|
178
|
-
dataNQuads: string,
|
|
179
|
-
schemaJson: string,
|
|
180
|
-
focus: string,
|
|
181
|
-
shapeLabel?: string
|
|
182
|
-
): Promise<{ ok: true; verdict: boolean | null; deferred: boolean }>;
|
|
183
|
-
|
|
184
|
-
/** RDFS/OWL-RL entailment closure (default graph only). */
|
|
185
|
-
export function owlClosure(
|
|
186
|
-
dataNQuads: string,
|
|
187
|
-
mode: 'RDFS' | 'OWL-RL'
|
|
188
|
-
): Promise<{ ok: true; nquads: string }>;
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Certified six-rule core-RDFS closure (theorem-backed; see
|
|
192
|
-
* docs/theorem-registry.md). "corerdfs" is this project's API name for
|
|
193
|
-
* the fragment the literature calls ρdf (Muñoz, Pérez & Gutierrez,
|
|
194
|
-
* "Simple and Efficient Minimal RDFS", J. Web Semantics 7(3), 2009).
|
|
195
|
-
*/
|
|
196
|
-
export function coreRdfsClosure(
|
|
197
|
-
data: string,
|
|
198
|
-
options?: { format?: string; baseIRI?: string }
|
|
199
|
-
): Promise<{ ok: true; ntriples: string }>;
|
|
200
|
-
|
|
201
|
-
/** Decidable core-RDFS fragment check — the regime theorems' fragment hypothesis. */
|
|
202
|
-
export function coreRdfsCheck(
|
|
203
|
-
data: string,
|
|
204
|
-
options?: { format?: string; baseIRI?: string }
|
|
205
|
-
): Promise<{ ok: true; fragment: boolean }>;
|
|
206
|
-
|
|
207
|
-
/** Literature-name alias for coreRdfsClosure (ρdf). */
|
|
208
|
-
export function rhoDfClosure(
|
|
209
|
-
data: string,
|
|
210
|
-
options?: { format?: string; baseIRI?: string }
|
|
211
|
-
): Promise<{ ok: true; ntriples: string }>;
|
|
212
|
-
|
|
213
|
-
/** Literature-name alias for coreRdfsCheck (ρdf). */
|
|
214
|
-
export function rhoDfFragmentCheck(
|
|
215
|
-
data: string,
|
|
216
|
-
options?: { format?: string; baseIRI?: string }
|
|
217
|
-
): Promise<{ ok: true; fragment: boolean }>;
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* RDFS-Plus closure — RDFS plus the practical OWL subset (sameAs,
|
|
221
|
-
* inverseOf, Symmetric/Transitive/Functional/InverseFunctional,
|
|
222
|
-
* equivalentClass/Property). Per-rule proved certificates; no
|
|
223
|
-
* chain-level completeness claim (see the theorem registry).
|
|
224
|
-
*/
|
|
225
|
-
export function rdfsPlusClosure(
|
|
226
|
-
data: string,
|
|
227
|
-
options?: { format?: string; baseIRI?: string }
|
|
228
|
-
): Promise<{ ok: true; ntriples: string; rounds: number }>;
|
|
229
|
-
|
|
230
|
-
/** OWL tableau class-expression materialisation (default graph only). */
|
|
231
|
-
export function tableauMaterialise(
|
|
232
|
-
dataNQuads: string
|
|
233
|
-
): Promise<{ ok: true; nquads: string; addedCount: number }>;
|
|
234
|
-
|
|
235
|
-
/** OWL DL inconsistency verdict (RL -> tableau -> RL -> is_inconsistent);
|
|
236
|
-
* `rlAlone` is the plain OWL-RL verdict on the same input. */
|
|
237
|
-
export function tableauDlInconsistent(
|
|
238
|
-
dataNQuads: string
|
|
239
|
-
): Promise<{ ok: true; inconsistent: boolean; rlAlone: boolean }>;
|
|
240
|
-
|
|
241
|
-
/** OWL DL consistency verdict via the verified clash-detecting tableau
|
|
242
|
-
* (Tableau.Refute over the OWL-RL closure); `consistent` is
|
|
243
|
-
* true|false|null (null = budget-out, `reason` names the fuel cap). */
|
|
244
|
-
export function owlIsConsistent(
|
|
245
|
-
dataNQuads: string,
|
|
246
|
-
optsJson?: string
|
|
247
|
-
): Promise<{ ok: true; consistent: boolean | null; reason?: string }>;
|
|
248
|
-
|
|
249
|
-
/** OWL entailment check (OWL-RL closure path then negate-and-refute);
|
|
250
|
-
* `entailed` is true|false|null, `via` is 'closure' | 'refutation'. */
|
|
251
|
-
export function owlEntails(
|
|
252
|
-
premiseNQuads: string,
|
|
253
|
-
conclusionNQuads: string,
|
|
254
|
-
optsJson?: string
|
|
255
|
-
): Promise<{ ok: true; entailed: boolean | null; via: string; reason?: string }>;
|
|
256
|
-
|
|
257
|
-
/** RML mapping evaluation against one logical source. */
|
|
258
|
-
export function rmlMap(
|
|
259
|
-
mappingNQuads: string,
|
|
260
|
-
sourceData: string,
|
|
261
|
-
sourceKind: 'json' | 'csv'
|
|
262
|
-
): Promise<{ ok: true; nquads: string }>;
|
|
263
|
-
|
|
264
|
-
/** CSVW csv2rdf conversion. */
|
|
265
|
-
export function csvwToRdf(
|
|
266
|
-
csvText: string,
|
|
267
|
-
metadataJson?: string,
|
|
268
|
-
options?: { mode?: 'standard' | 'minimal'; base?: string; url?: string }
|
|
269
|
-
): Promise<{ ok: true; nquads: string }>;
|
|
270
|
-
|
|
271
|
-
/** JSON-LD parsing with JSON-LD-specific options. */
|
|
272
|
-
export function jsonldToRdf(
|
|
273
|
-
jsonldText: string,
|
|
274
|
-
options?: {
|
|
275
|
-
base?: string;
|
|
276
|
-
rdfDirection?: string;
|
|
277
|
-
expandContext?: string;
|
|
278
|
-
processingMode?: string;
|
|
279
|
-
}
|
|
280
|
-
): Promise<{ ok: true; nquads: string }>;
|
|
281
|
-
|
|
282
|
-
/** Serialize N-Quads as expanded-form JSON-LD (JCS-canonical string). */
|
|
283
|
-
export function jsonldFromRdf(
|
|
284
|
-
nquads: string,
|
|
285
|
-
options?: { useNativeTypes?: boolean; useRdfType?: boolean }
|
|
286
|
-
): Promise<{ ok: true; jsonld: string }>;
|
|
287
|
-
|
|
288
|
-
/** did:key (Ed25519) resolution to a DID Document (N-Triples). */
|
|
289
|
-
export function didKeyResolve(
|
|
290
|
-
didString: string
|
|
291
|
-
): Promise<{ ok: true; did: string; nquads: string }>;
|
|
292
|
-
|
|
293
|
-
/** XML 1.0 well-formedness (no DOCTYPE/DTD production). */
|
|
294
|
-
export function xmlWellformed(
|
|
295
|
-
xmlText: string
|
|
296
|
-
): Promise<{ ok: true; wellformed: boolean }>;
|
|
297
|
-
|
|
298
|
-
/** XPath 1.0 evaluation over an XML document. */
|
|
299
|
-
export function xpathEval(
|
|
300
|
-
xmlText: string,
|
|
301
|
-
xpathExpr: string
|
|
302
|
-
): Promise<{ ok: true } & XPathResult>;
|
|
303
|
-
|
|
304
|
-
// ---------------------------------------------------------------------
|
|
305
|
-
// VC Data Integrity crypto (eddsa-rdfc-2022, HACL* wasm backend).
|
|
306
|
-
//
|
|
307
|
-
// INIT (browser): unlike the Node entry (which auto-awaits initHacl()),
|
|
308
|
-
// a page MUST initialise the HACL* wasm backend itself before the first
|
|
309
|
-
// VC call — the hacl-wasm URL is page-specific (serve `hacl-wasm/` and
|
|
310
|
-
// `await initHacl({ apiUrl })` from hacl-init.js). An uninitialised
|
|
311
|
-
// backend makes verify THROW (the {ok:false} error surfaces), never
|
|
312
|
-
// return a false-positive true (#286, the throw-on-uninit contract).
|
|
313
|
-
// ---------------------------------------------------------------------
|
|
314
|
-
|
|
315
|
-
export function vcSha256Hex(message: string): Promise<{ ok: true; sha256: string }>;
|
|
316
|
-
export function vcEd25519SecretToPublic(
|
|
317
|
-
secretKeyHex: string
|
|
318
|
-
): Promise<{ ok: true; publicKeyHex: string }>;
|
|
319
|
-
export function vcEd25519Sign(
|
|
320
|
-
secretKeyHex: string,
|
|
321
|
-
messageHex: string
|
|
322
|
-
): Promise<{ ok: true; signatureHex: string }>;
|
|
323
|
-
export function vcEd25519Verify(
|
|
324
|
-
publicKeyHex: string,
|
|
325
|
-
messageHex: string,
|
|
326
|
-
signatureHex: string
|
|
327
|
-
): Promise<{ ok: true; valid: boolean }>;
|
|
328
|
-
export function vcEddsaCreateFromCanonical(
|
|
329
|
-
secretKeyHex: string,
|
|
330
|
-
canonicalDocument: string,
|
|
331
|
-
canonicalConfig: string
|
|
332
|
-
): Promise<{ ok: true; proofValue: string }>;
|
|
333
|
-
export function vcEddsaVerifyFromCanonical(
|
|
334
|
-
publicKeyHex: string,
|
|
335
|
-
canonicalDocument: string,
|
|
336
|
-
canonicalConfig: string,
|
|
337
|
-
proofValue: string
|
|
338
|
-
): Promise<{ ok: true; verified: boolean }>;
|
|
339
|
-
|
|
340
|
-
// ---------------------------------------------------------------------
|
|
341
|
-
// In-memory COTTAS/Parquet bytes store.
|
|
342
|
-
// ---------------------------------------------------------------------
|
|
343
|
-
|
|
344
|
-
/** Open a COTTAS artifact's bytes as a read-only store; returns a handle. */
|
|
345
|
-
export function openCottas(
|
|
346
|
-
bytes: Uint8Array | ArrayBuffer | string
|
|
347
|
-
): Promise<string>;
|
|
348
|
-
/** SPARQL over a store opened by openCottas() (read-only, no entail). */
|
|
349
|
-
export function queryCottas(
|
|
350
|
-
handle: string,
|
|
351
|
-
sparql: string
|
|
352
|
-
): Promise<
|
|
353
|
-
| { ok: true; kind: 'select'; srj: SparqlResultsJson }
|
|
354
|
-
| { ok: true; kind: 'ask'; boolean: boolean }
|
|
355
|
-
| { ok: true; kind: 'construct'; nquads: string }
|
|
356
|
-
>;
|
|
357
|
-
/** Release a store handle (does not evict the underlying byte cache). */
|
|
358
|
-
export function closeCottas(handle: string): Promise<void>;
|
|
359
|
-
/** Serialize dataset-handle N-Quads to COTTAS/Parquet bytes. */
|
|
360
|
-
export function toCottas(nQuads: string): Promise<Uint8Array>;
|
|
361
|
-
|
|
362
|
-
// ---------------------------------------------------------------------
|
|
363
|
-
// Typed engine functions (#74 FP surface, browser side). Same value
|
|
364
|
-
// shapes as the Node entry (index.d.ts).
|
|
365
|
-
// ---------------------------------------------------------------------
|
|
366
|
-
|
|
367
|
-
export function xsltTransform(stylesheetXml: string, sourceXml: string): Promise<string>;
|
|
368
|
-
export function mathmlEval(
|
|
369
|
-
contentMathmlXml: string,
|
|
370
|
-
bindings?: Record<string, string>
|
|
371
|
-
): Promise<MathValue>;
|
|
372
|
-
export function xformsRecalc(
|
|
373
|
-
instanceXml: string,
|
|
374
|
-
binds: XFormsBind[]
|
|
375
|
-
): Promise<{ instance: string; validity: XFormsNodeValidity[] }>;
|
|
376
|
-
export function jsonSchemaValidate(
|
|
377
|
-
schemaJson: string,
|
|
378
|
-
instanceJson: string
|
|
379
|
-
): Promise<{ valid: boolean; result: 'pass' | 'fail' | 'unsupported'; errors: string[] }>;
|
|
380
|
-
export function schematronValidate(
|
|
381
|
-
schematronXml: string,
|
|
382
|
-
instanceXml: string
|
|
383
|
-
): Promise<{ findings: SchematronFinding[] }>;
|
|
384
|
-
export function toanSummation(
|
|
385
|
-
bodyExpr: ToanExpr,
|
|
386
|
-
idx: string,
|
|
387
|
-
lo: number,
|
|
388
|
-
hi: number
|
|
389
|
-
): Promise<string>;
|
|
390
|
-
export function toanProduct(
|
|
391
|
-
bodyExpr: ToanExpr,
|
|
392
|
-
idx: string,
|
|
393
|
-
lo: number,
|
|
394
|
-
hi: number
|
|
395
|
-
): Promise<string>;
|
|
396
|
-
export function toanSimplify(expr: ToanExpr): Promise<string>;
|
|
397
|
-
export function toanDiff(expr: ToanExpr, variable: string): Promise<string>;
|
|
398
|
-
export function toanSubst(
|
|
399
|
-
expr: ToanExpr,
|
|
400
|
-
variable: string,
|
|
401
|
-
value: ToanExpr
|
|
402
|
-
): Promise<string>;
|
|
403
|
-
export function matrixDeterminant(matrix: MatrixCell[][]): Promise<MatrixResult>;
|
|
404
|
-
export function matrixScalarProduct(a: MatrixCell[], b: MatrixCell[]): Promise<MatrixResult>;
|
|
405
|
-
export function matrixVectorProduct(a: MatrixCell[], b: MatrixCell[]): Promise<MatrixResult>;
|
|
406
|
-
export function matrixOuterProduct(a: MatrixCell[], b: MatrixCell[]): Promise<MatrixResult>;
|
|
407
|
-
export function sigmoidPoints(
|
|
408
|
-
params: SigmoidParams
|
|
409
|
-
): Promise<Array<{ x: ScaledValue; y: ScaledValue }>>;
|
|
410
|
-
export function sigmoidFormulaMathml(): Promise<string>;
|
|
411
|
-
|
|
412
|
-
// ---------------------------------------------------------------------
|
|
413
|
-
// Durable browser persistence (IndexedDB-backed delta log). Browser-
|
|
414
|
-
// only: these use `indexedDB` and have no Node analogue — a Node caller
|
|
415
|
-
// drives the raw npm-entry ABI (deltaBatchToHex / deltaMergeApplyBrowser)
|
|
416
|
-
// or an injected storage layer directly (see tests/hub/post18_test.mjs's
|
|
417
|
-
// Map-backed stub, which mirrors this exact contract).
|
|
418
|
-
// ---------------------------------------------------------------------
|
|
419
|
-
|
|
420
|
-
/** A handle naming one IndexedDB-backed delta log. */
|
|
421
|
-
export interface DeltaLogHandle {
|
|
422
|
-
dbName: string;
|
|
423
|
-
}
|
|
14
|
+
export {
|
|
15
|
+
parse,
|
|
16
|
+
query,
|
|
17
|
+
update,
|
|
18
|
+
serialize,
|
|
19
|
+
canonicalize,
|
|
20
|
+
graphs,
|
|
21
|
+
canonicalHash,
|
|
22
|
+
openDataset,
|
|
23
|
+
closure,
|
|
24
|
+
formats,
|
|
25
|
+
queryRaw,
|
|
26
|
+
queryHdt,
|
|
27
|
+
registerExtensionFunction,
|
|
28
|
+
unregisterExtensionFunction,
|
|
29
|
+
clearExtensionFunctions,
|
|
30
|
+
registerServiceEndpoint,
|
|
31
|
+
clearServiceEndpoints,
|
|
32
|
+
openStore,
|
|
33
|
+
queryStore,
|
|
34
|
+
listStores,
|
|
35
|
+
deltaLogOpen,
|
|
36
|
+
deltaLogAppend,
|
|
37
|
+
deltaLogReadAllHex,
|
|
38
|
+
deltaLogMerge,
|
|
39
|
+
deltaLogInspect,
|
|
40
|
+
deltaLogDestroy,
|
|
41
|
+
_deltaLogCorruptLastForTest,
|
|
42
|
+
shaclValidate,
|
|
43
|
+
shexValidate,
|
|
44
|
+
owlClosure,
|
|
45
|
+
coreRdfsClosure,
|
|
46
|
+
coreRdfsCheck,
|
|
47
|
+
rdfsPlusClosure,
|
|
48
|
+
rhoDfClosure,
|
|
49
|
+
rhoDfFragmentCheck,
|
|
50
|
+
tableauMaterialise,
|
|
51
|
+
tableauDlInconsistent,
|
|
52
|
+
owlIsConsistent,
|
|
53
|
+
owlEntails,
|
|
54
|
+
rifEval,
|
|
55
|
+
rmlMap,
|
|
56
|
+
csvwToRdf,
|
|
57
|
+
jsonldToRdf,
|
|
58
|
+
jsonldFromRdf,
|
|
59
|
+
xmlWellformed,
|
|
60
|
+
xpathEval,
|
|
61
|
+
xsltTransform,
|
|
62
|
+
schematronValidate,
|
|
63
|
+
jsonSchemaValidate,
|
|
64
|
+
mathmlEval,
|
|
65
|
+
xformsRecalc,
|
|
66
|
+
clParse,
|
|
67
|
+
clSerialize,
|
|
68
|
+
clAlphaNorm,
|
|
69
|
+
clNormalize,
|
|
70
|
+
toanSummation,
|
|
71
|
+
toanProduct,
|
|
72
|
+
toanSimplify,
|
|
73
|
+
toanDiff,
|
|
74
|
+
toanSubst,
|
|
75
|
+
vcSha256Hex,
|
|
76
|
+
vcEd25519SecretToPublic,
|
|
77
|
+
vcEd25519Sign,
|
|
78
|
+
vcEd25519Verify,
|
|
79
|
+
vcEddsaCreateFromCanonical,
|
|
80
|
+
vcEddsaVerifyFromCanonical,
|
|
81
|
+
vcCheckCredential,
|
|
82
|
+
vcCheckCredentialSubject,
|
|
83
|
+
vcCheckNoDataLoss,
|
|
84
|
+
vcCheckRelatedResourceDigests,
|
|
85
|
+
didKeyResolve,
|
|
86
|
+
capabilities,
|
|
87
|
+
Dataset,
|
|
88
|
+
DatasetHandle,
|
|
89
|
+
Store,
|
|
90
|
+
ParseError,
|
|
91
|
+
dataFactory,
|
|
92
|
+
version,
|
|
93
|
+
engine,
|
|
94
|
+
loadEngine,
|
|
95
|
+
} from './index';
|
|
424
96
|
|
|
425
|
-
/** Open (creating if needed) a browser-persistent delta log. */
|
|
426
|
-
export function deltaLogOpen(dbName?: string): Promise<DeltaLogHandle>;
|
|
427
97
|
/**
|
|
428
|
-
*
|
|
429
|
-
*
|
|
98
|
+
* The directory the engine's three files (l4factoidal.js, l4factoidal.mjs,
|
|
99
|
+
* l4factoidal.wasm) are loaded from. Default: this package's l4-assets/,
|
|
100
|
+
* next to browser.js. Call before the first operation.
|
|
430
101
|
*/
|
|
431
|
-
export function
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
export function
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
): Promise<
|
|
443
|
-
|
|
444
|
-
export function
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
export const version: string;
|
|
448
|
-
|
|
449
|
-
declare const _default: {
|
|
450
|
-
query: typeof query;
|
|
451
|
-
toRdf: typeof toRdf;
|
|
452
|
-
canonicalize: typeof canonicalize;
|
|
453
|
-
runFactoidalCli: typeof runFactoidalCli;
|
|
454
|
-
setFactoidalUrl: typeof setFactoidalUrl;
|
|
455
|
-
getFactoidalUrl: typeof getFactoidalUrl;
|
|
456
|
-
encodeTextAsBundleBytes: typeof encodeTextAsBundleBytes;
|
|
457
|
-
queryDataset: typeof queryDataset;
|
|
458
|
-
version: string;
|
|
459
|
-
loadNpmEntry: typeof loadNpmEntry;
|
|
460
|
-
setFactoidalNpmEntryUrl: typeof setFactoidalNpmEntryUrl;
|
|
461
|
-
rifSmoke: typeof rifSmoke;
|
|
462
|
-
rifEval: typeof rifEval;
|
|
463
|
-
shaclValidate: typeof shaclValidate;
|
|
464
|
-
shexValidate: typeof shexValidate;
|
|
465
|
-
didKeyResolve: typeof didKeyResolve;
|
|
466
|
-
owlClosure: typeof owlClosure;
|
|
467
|
-
coreRdfsClosure: typeof coreRdfsClosure;
|
|
468
|
-
coreRdfsCheck: typeof coreRdfsCheck;
|
|
469
|
-
rdfsPlusClosure: typeof rdfsPlusClosure;
|
|
470
|
-
rhoDfClosure: typeof rhoDfClosure;
|
|
471
|
-
rhoDfFragmentCheck: typeof rhoDfFragmentCheck;
|
|
472
|
-
tableauMaterialise: typeof tableauMaterialise;
|
|
473
|
-
tableauDlInconsistent: typeof tableauDlInconsistent;
|
|
474
|
-
owlIsConsistent: typeof owlIsConsistent;
|
|
475
|
-
owlEntails: typeof owlEntails;
|
|
476
|
-
rmlMap: typeof rmlMap;
|
|
477
|
-
jsonldToRdf: typeof jsonldToRdf;
|
|
478
|
-
jsonldFromRdf: typeof jsonldFromRdf;
|
|
479
|
-
xmlWellformed: typeof xmlWellformed;
|
|
480
|
-
xpathEval: typeof xpathEval;
|
|
481
|
-
deltaLogOpen: typeof deltaLogOpen;
|
|
482
|
-
deltaLogAppend: typeof deltaLogAppend;
|
|
483
|
-
deltaLogReadAllHex: typeof deltaLogReadAllHex;
|
|
484
|
-
deltaLogMerge: typeof deltaLogMerge;
|
|
485
|
-
deltaLogDestroy: typeof deltaLogDestroy;
|
|
486
|
-
openCottas: typeof openCottas;
|
|
487
|
-
queryCottas: typeof queryCottas;
|
|
488
|
-
closeCottas: typeof closeCottas;
|
|
489
|
-
toCottas: typeof toCottas;
|
|
490
|
-
xsltTransform: typeof xsltTransform;
|
|
491
|
-
mathmlEval: typeof mathmlEval;
|
|
492
|
-
xformsRecalc: typeof xformsRecalc;
|
|
493
|
-
jsonSchemaValidate: typeof jsonSchemaValidate;
|
|
494
|
-
schematronValidate: typeof schematronValidate;
|
|
495
|
-
toanSummation: typeof toanSummation;
|
|
496
|
-
toanProduct: typeof toanProduct;
|
|
497
|
-
toanSimplify: typeof toanSimplify;
|
|
498
|
-
toanDiff: typeof toanDiff;
|
|
499
|
-
toanSubst: typeof toanSubst;
|
|
500
|
-
matrixDeterminant: typeof matrixDeterminant;
|
|
501
|
-
matrixScalarProduct: typeof matrixScalarProduct;
|
|
502
|
-
matrixVectorProduct: typeof matrixVectorProduct;
|
|
503
|
-
matrixOuterProduct: typeof matrixOuterProduct;
|
|
504
|
-
sigmoidPoints: typeof sigmoidPoints;
|
|
505
|
-
sigmoidFormulaMathml: typeof sigmoidFormulaMathml;
|
|
506
|
-
vcSha256Hex: typeof vcSha256Hex;
|
|
507
|
-
vcEd25519SecretToPublic: typeof vcEd25519SecretToPublic;
|
|
508
|
-
vcEd25519Sign: typeof vcEd25519Sign;
|
|
509
|
-
vcEd25519Verify: typeof vcEd25519Verify;
|
|
510
|
-
vcEddsaCreateFromCanonical: typeof vcEddsaCreateFromCanonical;
|
|
511
|
-
vcEddsaVerifyFromCanonical: typeof vcEddsaVerifyFromCanonical;
|
|
512
|
-
queryHdt: typeof queryHdt;
|
|
513
|
-
};
|
|
514
|
-
export default _default;
|
|
102
|
+
export function setAssetsUrl(url: string | URL): void;
|
|
103
|
+
|
|
104
|
+
/** The directory the engine's files are loaded from. */
|
|
105
|
+
export function getAssetsUrl(): string;
|
|
106
|
+
|
|
107
|
+
export { default } from './index';
|
|
108
|
+
|
|
109
|
+
// Added in 0.10.0 (lib/pure.mjs).
|
|
110
|
+
export function aeadSeal(a: { key: Uint8Array; nonce: Uint8Array; plaintext?: Uint8Array; aad?: Uint8Array }): Promise<Uint8Array>;
|
|
111
|
+
export function aeadOpen(a: { key: Uint8Array; nonce: Uint8Array; ciphertext: Uint8Array; aad?: Uint8Array }): Promise<Uint8Array>;
|
|
112
|
+
export function hpkeSeal(a: { skE: Uint8Array; pkR: Uint8Array; plaintext?: Uint8Array; info?: Uint8Array; aad?: Uint8Array }): Promise<{ message: Uint8Array; enc: Uint8Array; ciphertext: Uint8Array }>;
|
|
113
|
+
export function hpkeOpen(a: { skR: Uint8Array; message: Uint8Array; info?: Uint8Array; aad?: Uint8Array }): Promise<Uint8Array>;
|
|
114
|
+
export function proofCheck(bundleJson: string): Promise<Record<string, unknown>>;
|
|
115
|
+
export function proofInspect(bundleJson: string): Promise<Record<string, unknown>>;
|
|
116
|
+
export function canonicalizeNQuads(nquads: string): Promise<string>;
|
|
117
|
+
export function normalizeNQuads(nquads: string): Promise<string>;
|