@factoidal/core 0.7.1 → 0.11.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 +616 -1
- package/NOTICE +2 -21
- package/README.md +123 -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/ext.mjs +16 -20
- package/bin/factoidal.mjs +667 -118
- 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 +114 -507
- package/browser.js +155 -2257
- package/docs/fuseki-replacement.md +108 -0
- package/fn.d.ts +25 -96
- package/fn.js +131 -240
- package/index.d.ts +620 -260
- package/index.js +4 -234
- package/index.mjs +180 -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 +2337 -0
- package/lib/browser-engine.mjs +69 -0
- package/lib/dataset.mjs +471 -0
- package/lib/delta-log-hosts.mjs +191 -0
- package/lib/lean-entry.mjs +213 -0
- package/lib/pure.mjs +98 -0
- package/lib/store.mjs +115 -0
- package/lib/version.mjs +5 -0
- package/lws/README.md +137 -0
- package/lws/persist.mjs +78 -0
- package/lws/server.mjs +416 -0
- package/package.json +59 -61
- package/rdfjs.js +5 -536
- package/rdfjs.mjs +517 -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 +293 -0
- package/solid/server/README.md +96 -0
- package/solid/server/index.mjs +395 -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
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Using `factoidal serve` in place of Apache Jena Fuseki
|
|
2
|
+
|
|
3
|
+
Status: 2026-10-18, `@factoidal/core` 0.10.0. Every row below was tested
|
|
4
|
+
with curl against the installed package, and is gated by
|
|
5
|
+
`test/fuseki-compat.test.mjs` (assertions for what works, expected failures
|
|
6
|
+
naming an issue for what does not).
|
|
7
|
+
|
|
8
|
+
## Command-line mapping
|
|
9
|
+
|
|
10
|
+
| Fuseki | factoidal |
|
|
11
|
+
|---|---|
|
|
12
|
+
| `fuseki-server --file data.ttl /ds` | `factoidal serve --file data.ttl /ds` |
|
|
13
|
+
| `fuseki-server --update --file data.ttl /ds` | the same; updates are always on |
|
|
14
|
+
| `fuseki-server --loc DB /ds` (TDB2, read only) | `factoidal serve --tdb2 DB /ds`: the TDB2 database is read in place and is read only (see Storage) |
|
|
15
|
+
| `fuseki-server --loc DB /ds` (TDB2, writable) | no TDB2 writer. Export with `tdb2.tdbdump`, then `factoidal pack data.nq STORE/gen-1 --layout ibk5`, `factoidal activate STORE gen-1`, `factoidal serve STORE --query-path /ds/sparql --gsp-path /ds/data` |
|
|
16
|
+
| `--port 3030` | `--port 3030` (the default is 3030 in both) |
|
|
17
|
+
| `--localhost` | the default; `--host 0.0.0.0` to listen on all addresses |
|
|
18
|
+
| `--mem /ds` | `--file` with an empty file |
|
|
19
|
+
| `--config config.ttl` | none: https://github.com/danbri/factoidal/issues/832 |
|
|
20
|
+
|
|
21
|
+
`--file` packs the file into a new collection in a temporary directory
|
|
22
|
+
(layout `ibk5`, so every graph accepts writes) and serves it. Updates go to
|
|
23
|
+
that directory and are lost when the process ends, as with
|
|
24
|
+
`fuseki-server --file`. For data that must persist, use the `STORE` form:
|
|
25
|
+
updates are appended to the collection's delta log and synced before the
|
|
26
|
+
response is sent.
|
|
27
|
+
|
|
28
|
+
## Endpoints
|
|
29
|
+
|
|
30
|
+
With `--file DATA /ds`, or `--query-path /ds/sparql --gsp-path /ds/data`:
|
|
31
|
+
|
|
32
|
+
| Path | Fuseki | factoidal serve |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| `/ds/sparql` | query and update | query and update; GET with no query string returns the Service Description |
|
|
35
|
+
| `/ds/query` | query | query and update (the same endpoint) |
|
|
36
|
+
| `/ds/update` | update | query and update (the same endpoint) |
|
|
37
|
+
| `/ds/data` | Graph Store read and write | Graph Store read and write (`?default`, `?graph=IRI`, or a path under `/ds/data`) |
|
|
38
|
+
| `/ds/get` | Graph Store read | Graph Store read; PUT, POST and DELETE answer 405 with `Allow: GET, HEAD, OPTIONS` |
|
|
39
|
+
| `/ds/data` with no graph parameter | the whole dataset | GET: N-Quads (the default) or TriG by `Accept`; a triple syntax in `Accept` selects the default graph. PUT of N-Quads or TriG replaces the dataset. POST of N-Quads or TriG adds to it (blank nodes renamed apart). POST of a triple syntax creates a new graph (Graph Store Protocol section 5.5). PUT of a triple syntax answers 415; DELETE answers 405 with `Allow`. https://github.com/danbri/factoidal/issues/829 |
|
|
40
|
+
| `/$/ping`, `/$/datasets`, `/$/datasets/ds`, `/$/stats`, `/$/stats/ds`, `/$/server` | administration API | read-only, with Fuseki's JSON member names (`ds.name`, `ds.state`, `ds.services`, `Requests`, `RequestsGood`, `RequestsBad`, `startDateTime`, `uptime`); `built` is not reported. POST or DELETE of a dataset answers 405; other `/$/` operations answer 404. https://github.com/danbri/factoidal/issues/831 |
|
|
41
|
+
|
|
42
|
+
Without `--query-path`, the endpoint is `/sparql` and also `/query` and
|
|
43
|
+
`/update`; the Graph Store is `/data`.
|
|
44
|
+
|
|
45
|
+
Conformance: W3C SPARQL 1.1 Protocol, Graph Store HTTP Protocol (direct and
|
|
46
|
+
indirect identification) and Service Description tests against the running
|
|
47
|
+
server over TCP (`lake exe l4protocol-live`): 50 pass, 0 fail (out of 50),
|
|
48
|
+
re-run 2026-10-13 after the endpoint aliases were added
|
|
49
|
+
(`docs/designissues/2026-10-10-store-serve.md` has the command).
|
|
50
|
+
|
|
51
|
+
## Content types (tested)
|
|
52
|
+
|
|
53
|
+
- Query results: `application/sparql-results+json`,
|
|
54
|
+
`application/sparql-results+xml`, `text/csv`, `text/tab-separated-values`.
|
|
55
|
+
- CONSTRUCT and DESCRIBE: `text/turtle`, `application/n-triples` and
|
|
56
|
+
`application/rdf+xml`. A graph with no RDF/XML form (a predicate IRI that
|
|
57
|
+
is no XML QName) answers the next acceptable syntax, or 406 when RDF/XML
|
|
58
|
+
is the only one acceptable.
|
|
59
|
+
- Query requests: GET `?query=`, POST `application/x-www-form-urlencoded`,
|
|
60
|
+
POST `application/sparql-query`. Updates: POST
|
|
61
|
+
`application/sparql-update` and form `update=`.
|
|
62
|
+
- Graph Store GET: `text/turtle`, `application/n-triples`,
|
|
63
|
+
`application/rdf+xml`; on the whole dataset also `application/n-quads` and
|
|
64
|
+
`application/trig`. JSON-LD answers 406:
|
|
65
|
+
https://github.com/danbri/factoidal/issues/830.
|
|
66
|
+
|
|
67
|
+
## Storage
|
|
68
|
+
|
|
69
|
+
Fuseki keeps a dataset in memory (`--mem`, `--file`) or in TDB2 (`--loc`).
|
|
70
|
+
factoidal serves a Shardborough collection: immutable generations plus a
|
|
71
|
+
delta log. A triples generation (`--layout ibk3`) accepts writes to the
|
|
72
|
+
default graph only; a named-graph write answers 501. Use `ibk4` or `ibk5`
|
|
73
|
+
for named graphs. The npm command cannot yet fold the delta log into a new
|
|
74
|
+
generation (`factoidal compact` and `factoidal update` exit 3:
|
|
75
|
+
https://github.com/danbri/factoidal/issues/641); the native
|
|
76
|
+
`l4block-shard-compact` of the source tree does it. Updates through the
|
|
77
|
+
server work.
|
|
78
|
+
TDB2 databases: `factoidal serve --tdb2 DB /ds` reads a Jena TDB2 database in
|
|
79
|
+
place with the Lean decoder (`L4Factoidal/Tdb2/Read.lean`; the same quads as
|
|
80
|
+
`tdb2.tdbdump`, record `docs/designissues/2026-10-13-tdb2-format.md`) and
|
|
81
|
+
serves SPARQL query and Graph Store GET at `/ds/sparql`, `/ds/query`,
|
|
82
|
+
`/ds/get` and `/ds/data`. `serveStore(DB, { tdb2: true, queryPath, gspPath })`
|
|
83
|
+
does the same from Node. The database is read only: every update and every
|
|
84
|
+
Graph Store write answers 501 with the message "this dataset is a read-only
|
|
85
|
+
Jena TDB2 database read in place", and changes nothing. The current
|
|
86
|
+
`Data-NNNN` generation is served; a database with a non-empty `journal.jrnl`
|
|
87
|
+
(Jena has not replayed it) is refused. The server holds every quad in memory
|
|
88
|
+
while it runs: it does not answer a pattern from the TDB2 indexes on disk
|
|
89
|
+
(https://github.com/danbri/factoidal/issues/775 is the same gap for
|
|
90
|
+
Shardborough). Not decoded: RDF 1.2 triple terms, prefixed datatype names.
|
|
91
|
+
The native CLI reads TDB2 as well (`l4factoidal tdb2-dump DB`,
|
|
92
|
+
`l4factoidal query DB --format tdb2 ...`). Test: `test/fuseki-compat.test.mjs`
|
|
93
|
+
(needs a Jena install in `SOTA_DL`; skipped with that reason otherwise).
|
|
94
|
+
Note that TDB2 itself changes the lexical form of numeric, boolean and date
|
|
95
|
+
literals (`"0"^^xsd:boolean` reads back as `"false"`), so a dump is not always
|
|
96
|
+
the data that was loaded.
|
|
97
|
+
|
|
98
|
+
## Not supported
|
|
99
|
+
|
|
100
|
+
- Several datasets in one process, assembler configuration, jena-text
|
|
101
|
+
indexes, inference models, `unionDefaultGraph`:
|
|
102
|
+
https://github.com/danbri/factoidal/issues/832.
|
|
103
|
+
- Authentication, access control, HTTPS:
|
|
104
|
+
https://github.com/danbri/factoidal/issues/833. Bind to 127.0.0.1 (the
|
|
105
|
+
default) or put a reverse proxy in front.
|
|
106
|
+
- The administration operations that change the server (create and delete
|
|
107
|
+
a dataset, backup, compaction, tasks, metrics) and the UI:
|
|
108
|
+
https://github.com/danbri/factoidal/issues/831.
|
package/fn.d.ts
CHANGED
|
@@ -16,10 +16,6 @@ import type {
|
|
|
16
16
|
XFormsNodeValidity,
|
|
17
17
|
SchematronFinding,
|
|
18
18
|
ToanExpr,
|
|
19
|
-
MatrixCell,
|
|
20
|
-
MatrixResult,
|
|
21
|
-
ScaledValue,
|
|
22
|
-
SigmoidParams,
|
|
23
19
|
} from './index';
|
|
24
20
|
|
|
25
21
|
export type {
|
|
@@ -28,10 +24,6 @@ export type {
|
|
|
28
24
|
XFormsNodeValidity,
|
|
29
25
|
SchematronFinding,
|
|
30
26
|
ToanExpr,
|
|
31
|
-
MatrixCell,
|
|
32
|
-
MatrixResult,
|
|
33
|
-
ScaledValue,
|
|
34
|
-
SigmoidParams,
|
|
35
27
|
} from './index';
|
|
36
28
|
|
|
37
29
|
/**
|
|
@@ -68,10 +60,10 @@ export class FnDataset implements Iterable<Quad> {
|
|
|
68
60
|
export const EMPTY: FnDataset;
|
|
69
61
|
|
|
70
62
|
/** Snapshot a (possibly mutable) RDF/JS Dataset into an FnDataset. */
|
|
71
|
-
export function fromDataset(dataset: Dataset): FnDataset;
|
|
63
|
+
export function fromDataset(dataset: Dataset | (Iterable<Quad> & { size: number })): FnDataset;
|
|
72
64
|
|
|
73
|
-
/** Materialize an FnDataset into a fresh,
|
|
74
|
-
export function toDataset(ds: FnDataset):
|
|
65
|
+
/** Materialize an FnDataset into a fresh, mutable RDF/JS DatasetCore (from @factoidal/core/rdfjs). */
|
|
66
|
+
export function toDataset(ds: FnDataset): Iterable<Quad> & { size: number; add(q: Quad): unknown; delete(q: Quad): unknown; has(q: Quad): boolean };
|
|
75
67
|
|
|
76
68
|
/**
|
|
77
69
|
* A mutable accumulator for incrementally-arriving quads — the
|
|
@@ -118,8 +110,7 @@ export function mapQuads(ds: FnDataset, f: (quad: Quad) => Quad): FnDataset;
|
|
|
118
110
|
|
|
119
111
|
/**
|
|
120
112
|
* Run a SPARQL 1.1 query. SELECT -> Bindings[]; ASK -> boolean;
|
|
121
|
-
* CONSTRUCT -> FnDataset
|
|
122
|
-
* capabilities()).
|
|
113
|
+
* CONSTRUCT and DESCRIBE -> FnDataset.
|
|
123
114
|
*/
|
|
124
115
|
export function query(
|
|
125
116
|
ds: FnDataset,
|
|
@@ -131,7 +122,7 @@ export function query(
|
|
|
131
122
|
* Materialize an entailment closure over ds's default graph as a new
|
|
132
123
|
* FnDataset (a self-CONSTRUCT under the given regime — reuses
|
|
133
124
|
* query()'s entailment support; named-graph triples are not
|
|
134
|
-
* restated).
|
|
125
|
+
* restated).
|
|
135
126
|
*/
|
|
136
127
|
export function entail(ds: FnDataset, regime: EntailRegime): Promise<FnDataset>;
|
|
137
128
|
|
|
@@ -143,7 +134,7 @@ export interface ValidateResult {
|
|
|
143
134
|
}
|
|
144
135
|
|
|
145
136
|
/**
|
|
146
|
-
* SHACL Core validation.
|
|
137
|
+
* SHACL Core validation. Neither
|
|
147
138
|
* argument is mutated or consumed.
|
|
148
139
|
* @param ds the data graph
|
|
149
140
|
* @param shapes the shapes graph
|
|
@@ -152,10 +143,9 @@ export function validate(ds: FnDataset, shapes: FnDataset): Promise<ValidateResu
|
|
|
152
143
|
|
|
153
144
|
/**
|
|
154
145
|
* ShEx (Shape Expressions) validation of one focus node against one
|
|
155
|
-
* shape.
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
* @param schema ShExJ (JSON Schema form), as text
|
|
146
|
+
* shape. The Lean validator decides every schema it reads: the answer
|
|
147
|
+
* is a boolean.
|
|
148
|
+
* @param schema ShExJ (first non-whitespace character '{') or ShExC, as text
|
|
159
149
|
* @param focus an IRI, "_:label", or an RDF/JS NamedNode/BlankNode term
|
|
160
150
|
* @param shape a shape label (same shapes as focus); omit/null for the
|
|
161
151
|
* schema's own `start`
|
|
@@ -169,8 +159,7 @@ export function shex(
|
|
|
169
159
|
|
|
170
160
|
/**
|
|
171
161
|
* Evaluate an RML mapping graph against one logical source's raw data,
|
|
172
|
-
* materializing the generated triples as a new FnDataset.
|
|
173
|
-
* npm-entry engine bundle. Every triples map in `mapping` reads the
|
|
162
|
+
* materializing the generated triples as a new FnDataset. Every triples map in `mapping` reads the
|
|
174
163
|
* SAME `source` -- joins across two different logical sources are out
|
|
175
164
|
* of scope for this entry point.
|
|
176
165
|
* @param mapping the RML mapping graph
|
|
@@ -183,8 +172,7 @@ export function fromMapping(
|
|
|
183
172
|
): Promise<FnDataset>;
|
|
184
173
|
|
|
185
174
|
/**
|
|
186
|
-
* CSVW csv2rdf conversion, materialized as a new FnDataset.
|
|
187
|
-
* npm-entry engine bundle. Both arguments are raw text (CSVW's
|
|
175
|
+
* CSVW csv2rdf conversion, materialized as a new FnDataset. Both arguments are raw text (CSVW's
|
|
188
176
|
* metadata format is JSON, not RDF); '' or omitted metadata infers
|
|
189
177
|
* the schema from the CSV's own header row. Every table in a
|
|
190
178
|
* multi-table `tables` group reads the SAME `csv` text.
|
|
@@ -204,7 +192,7 @@ export function fromCsvw(
|
|
|
204
192
|
/**
|
|
205
193
|
* RIF Core forward-chaining saturation, materialized as a new
|
|
206
194
|
* FnDataset (input triples + derived triples, default graph only).
|
|
207
|
-
*
|
|
195
|
+
*
|
|
208
196
|
* @param ds the premise graph
|
|
209
197
|
* @param rules a RIF Core XML rule document
|
|
210
198
|
*/
|
|
@@ -216,7 +204,7 @@ export function rif(ds: FnDataset, rules: string): Promise<FnDataset>;
|
|
|
216
204
|
* rdfs2/3/5/7/9/11 only, with the machine-checked decides-iff
|
|
217
205
|
* (docs/theorem-registry.md). "corerdfs" is this project's API name
|
|
218
206
|
* for the fragment the literature calls ρdf (subPropertyOf/
|
|
219
|
-
* subClassOf/type/domain/range).
|
|
207
|
+
* subClassOf/type/domain/range).
|
|
220
208
|
*/
|
|
221
209
|
export function coreRdfsClosure(
|
|
222
210
|
ds: FnDataset,
|
|
@@ -231,8 +219,7 @@ export function rhoDfClosure(
|
|
|
231
219
|
|
|
232
220
|
/**
|
|
233
221
|
* Decidable core-RDFS fragment check (`is_rho_df_frag`): does the
|
|
234
|
-
* certified coreRdfsClosure guarantee apply to `ds`?
|
|
235
|
-
* npm-entry engine bundle.
|
|
222
|
+
* certified coreRdfsClosure guarantee apply to `ds`?
|
|
236
223
|
*/
|
|
237
224
|
export function coreRdfsCheck(
|
|
238
225
|
ds: FnDataset,
|
|
@@ -251,19 +238,18 @@ export function rhoDfFragmentCheck(
|
|
|
251
238
|
* owl:sameAs, owl:inverseOf, Symmetric/Transitive/Functional/
|
|
252
239
|
* InverseFunctionalProperty, equivalentClass/Property. Every OWL row
|
|
253
240
|
* carries a proved licensing + truth lemma; no chain-level
|
|
254
|
-
* completeness claim (theorem registry).
|
|
255
|
-
* bundle.
|
|
241
|
+
* completeness claim (theorem registry).
|
|
256
242
|
*/
|
|
257
243
|
export function rdfsPlusClosure(
|
|
258
244
|
ds: FnDataset,
|
|
259
245
|
options?: { format?: string }
|
|
260
|
-
): Promise<{ ok: boolean; dataset: FnDataset
|
|
246
|
+
): Promise<{ ok: boolean; dataset: FnDataset }>;
|
|
261
247
|
|
|
262
248
|
/**
|
|
263
249
|
* OWL tableau materialisation (formal/fstar/Tableau.fst's
|
|
264
250
|
* `tableau_materialise`): add `i rdf:type <ClassExpression>` for every
|
|
265
251
|
* individual the model-construction reasoner proves is a member of an
|
|
266
|
-
* OWL class expression.
|
|
252
|
+
* OWL class expression. Default
|
|
267
253
|
* graph only. `dataset` is input + tableau-derived triples;
|
|
268
254
|
* `addedCount` is how many triples the tableau added.
|
|
269
255
|
*/
|
|
@@ -274,8 +260,7 @@ export function tableauMaterialise(
|
|
|
274
260
|
/**
|
|
275
261
|
* OWL DL inconsistency verdict (bin/owl-runner's DL pipeline: OWL-RL
|
|
276
262
|
* closure -> tableau materialise -> OWL-RL closure -> is_inconsistent).
|
|
277
|
-
* `rlAlone` is the plain OWL-RL verdict on the same input.
|
|
278
|
-
* npm-entry engine bundle. Default graph only.
|
|
263
|
+
* `rlAlone` is the plain OWL-RL verdict on the same input. Default graph only.
|
|
279
264
|
*/
|
|
280
265
|
export function tableauDlInconsistent(
|
|
281
266
|
ds: FnDataset
|
|
@@ -283,8 +268,7 @@ export function tableauDlInconsistent(
|
|
|
283
268
|
|
|
284
269
|
/**
|
|
285
270
|
* OWL DL consistency verdict via the verified clash-detecting tableau
|
|
286
|
-
* (Tableau.Refute.tableau_consistent over the OWL-RL closure).
|
|
287
|
-
* npm-entry engine bundle. Default graph only. `ontology` is an
|
|
271
|
+
* (Tableau.Refute.tableau_consistent over the OWL-RL closure). Default graph only. `ontology` is an
|
|
288
272
|
* FnDataset or raw RDF text (Turtle by default). `consistent` is
|
|
289
273
|
* `false`, `true`, or `null` (budget-out, `reason` names the fuel cap).
|
|
290
274
|
*/
|
|
@@ -295,8 +279,7 @@ export function owlIsConsistent(
|
|
|
295
279
|
|
|
296
280
|
/**
|
|
297
281
|
* OWL entailment check: does `premise` entail `conclusion`? Verified
|
|
298
|
-
* two-path dispatch (`via: "closure"` / `via: "refutation"`).
|
|
299
|
-
* npm-entry engine bundle. Default graph only. Each argument is an
|
|
282
|
+
* two-path dispatch (`via: "closure"` / `via: "refutation"`). Default graph only. Each argument is an
|
|
300
283
|
* FnDataset or raw RDF text. `entailed` is `true`, `false`, or `null`
|
|
301
284
|
* (refutation budget-out, `reason` names the cap).
|
|
302
285
|
*/
|
|
@@ -306,12 +289,12 @@ export function owlEntails(
|
|
|
306
289
|
options?: { format?: string; fuel?: number | string }
|
|
307
290
|
): Promise<{ entailed: boolean | null; via: 'closure' | 'refutation'; reason?: string }>;
|
|
308
291
|
|
|
309
|
-
/** RDFC-1.0 canonical N-Quads text.
|
|
292
|
+
/** RDFC-1.0 canonical N-Quads text. */
|
|
310
293
|
export function canonicalize(ds: FnDataset): Promise<string>;
|
|
311
294
|
|
|
312
295
|
/**
|
|
313
296
|
* sha256 hex digest of canonicalize(ds); memoized by FnDataset
|
|
314
|
-
* identity.
|
|
297
|
+
* identity.
|
|
315
298
|
*/
|
|
316
299
|
export function hash(ds: FnDataset): Promise<string>;
|
|
317
300
|
|
|
@@ -323,7 +306,7 @@ export function hash(ds: FnDataset): Promise<string>;
|
|
|
323
306
|
export function equals(a: FnDataset, b: FnDataset): Promise<boolean>;
|
|
324
307
|
|
|
325
308
|
/** Enumerate named graphs (default graph excluded), first-seen order. */
|
|
326
|
-
export function graphs(ds: FnDataset): Array<[
|
|
309
|
+
export function graphs(ds: FnDataset): Array<[name: NamedNode | BlankNode, graph: FnDataset]>;
|
|
327
310
|
|
|
328
311
|
/** A minimal mutable box holding one dataflow input value. */
|
|
329
312
|
export interface Cell<T> {
|
|
@@ -418,25 +401,6 @@ export function toanSubst(
|
|
|
418
401
|
variable: string,
|
|
419
402
|
value: ToanExpr
|
|
420
403
|
): Promise<string>;
|
|
421
|
-
export function matrixDeterminant(
|
|
422
|
-
matrix: MatrixCell[][]
|
|
423
|
-
): Promise<MatrixResult>;
|
|
424
|
-
export function matrixScalarProduct(
|
|
425
|
-
a: MatrixCell[],
|
|
426
|
-
b: MatrixCell[]
|
|
427
|
-
): Promise<MatrixResult>;
|
|
428
|
-
export function matrixVectorProduct(
|
|
429
|
-
a: MatrixCell[],
|
|
430
|
-
b: MatrixCell[]
|
|
431
|
-
): Promise<MatrixResult>;
|
|
432
|
-
export function matrixOuterProduct(
|
|
433
|
-
a: MatrixCell[],
|
|
434
|
-
b: MatrixCell[]
|
|
435
|
-
): Promise<MatrixResult>;
|
|
436
|
-
export function sigmoidPoints(
|
|
437
|
-
params: SigmoidParams
|
|
438
|
-
): Promise<Array<{ x: ScaledValue; y: ScaledValue }>>;
|
|
439
|
-
export function sigmoidFormulaMathml(): Promise<string>;
|
|
440
404
|
|
|
441
405
|
// ---------------------------------------------------------------------
|
|
442
406
|
// VC Data Integrity crypto (eddsa-rdfc-2022, HACL* wasm backend).
|
|
@@ -467,44 +431,9 @@ export function vcEddsaVerifyFromCanonical(
|
|
|
467
431
|
proofValue: string
|
|
468
432
|
): Promise<boolean>;
|
|
469
433
|
|
|
470
|
-
// ---------------------------------------------------------------------
|
|
471
|
-
// In-memory COTTAS/Parquet bytes store. Unlike every other constructor
|
|
472
|
-
// here, openCottas() does NOT return an FnDataset: rows decode lazily
|
|
473
|
-
// as query() touches them (see fn.js's doc comment and
|
|
474
|
-
// docs/designissues/2026-07-06-inmemory-bytes-store.md). Needs the
|
|
475
|
-
// npm-entry engine bundle.
|
|
476
|
-
// ---------------------------------------------------------------------
|
|
477
|
-
|
|
478
|
-
/** A read-only, lazily-decoding COTTAS store handle (see openCottas). */
|
|
479
|
-
export interface CottasStore {
|
|
480
|
-
/** The opaque handle string the underlying engine registry uses. */
|
|
481
|
-
readonly handle: string;
|
|
482
|
-
/**
|
|
483
|
-
* SPARQL over the store. SELECT -> Bindings[]; ASK -> boolean;
|
|
484
|
-
* CONSTRUCT -> FnDataset (materialized once). No `entail` option, no
|
|
485
|
-
* write overlay (read-only) — see fn.js's openCottas doc comment for
|
|
486
|
-
* the full divergence list from query(). Throws after close().
|
|
487
|
-
*/
|
|
488
|
-
query(sparql: string): Promise<Bindings[] | boolean | FnDataset>;
|
|
489
|
-
/** Release the store. Idempotent. */
|
|
490
|
-
close(): Promise<void>;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
/** Open a COTTAS/Parquet artifact's raw bytes as a read-only store. */
|
|
494
|
-
export function openCottas(
|
|
495
|
-
bytes: Uint8Array | ArrayBuffer | string
|
|
496
|
-
): Promise<CottasStore>;
|
|
497
|
-
|
|
498
|
-
/**
|
|
499
|
-
* Serialize an FnDataset to COTTAS/Parquet bytes via the native writer
|
|
500
|
-
* (round-trips back into openCottas()). Needs the npm-entry bundle.
|
|
501
|
-
*/
|
|
502
|
-
export function toCottas(ds: FnDataset): Promise<Uint8Array>;
|
|
503
|
-
|
|
504
434
|
/**
|
|
505
|
-
* Run a SPARQL 1.1 query against a read-only HDT
|
|
506
|
-
*
|
|
507
|
-
* bundle needed -- CLI-only. Default graph only, SELECT/ASK only.
|
|
435
|
+
* Run a SPARQL 1.1 query against a read-only HDT file's raw bytes (op
|
|
436
|
+
* queryHdt). Default graph only, SELECT/ASK only.
|
|
508
437
|
*/
|
|
509
438
|
export function queryHdt(
|
|
510
439
|
hdtBytes: Uint8Array | ArrayBuffer | string,
|