eyeleng 1.0.13 → 1.1.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/README.md +22 -5
- package/dist/browser/eyeleng.browser.js +637 -14
- package/eyeleng.js +685 -24
- package/package.json +1 -1
- package/reports/w3c-shacl12-rules-earl.ttl +89 -89
- package/src/api.js +4 -1
- package/src/backward.js +490 -0
- package/src/cli.js +48 -10
- package/src/engine.js +68 -5
- package/src/query.js +69 -7
- package/src/store.js +2 -0
- package/test/api.test.js +127 -1
- package/test/cli.test.js +11 -2
package/README.md
CHANGED
|
@@ -148,13 +148,15 @@ W3C checks:
|
|
|
148
148
|
|
|
149
149
|
```sh
|
|
150
150
|
npm run w3c:rules
|
|
151
|
+
npm run w3c:rules:json
|
|
152
|
+
npm run w3c:rules:earl
|
|
151
153
|
npm run w3c:rdf
|
|
152
|
-
npm run w3c:all
|
|
153
154
|
npm run w3c:rdf:json
|
|
154
155
|
npm run w3c:rdf:earl
|
|
156
|
+
npm run w3c:all
|
|
155
157
|
```
|
|
156
158
|
|
|
157
|
-
`npm test` includes the W3C harnesses. When W3C URLs are reachable, progress is printed test by test. In offline environments, remote W3C checks are reported as unreachable unless `EYELENG_W3C_REQUIRED=1` is set.
|
|
159
|
+
`npm test` includes the W3C harnesses. When W3C URLs are reachable, progress is printed test by test. In offline environments, remote W3C checks are reported as unreachable unless `EYELENG_W3C_REQUIRED=1` is set. The `*:earl` scripts also print test progress, but write the EARL Turtle only to `reports/` instead of printing the report to the terminal.
|
|
158
160
|
|
|
159
161
|
The official Eyeleng EARL 1.0 report for the W3C SHACL 1.2 Rules manifest is in [reports/w3c-shacl12-rules-earl.ttl](./reports/w3c-shacl12-rules-earl.ttl).
|
|
160
162
|
|
|
@@ -178,7 +180,6 @@ Use message logs directly, import them from SRL, or force message-log parsing fr
|
|
|
178
180
|
```sh
|
|
179
181
|
./eyeleng.js examples/rdf-messages.srl
|
|
180
182
|
./eyeleng.js --rdf-messages --all examples/rdf-messages.trig
|
|
181
|
-
./eyeleng.js --stream-messages --all examples/rdf-messages.trig
|
|
182
183
|
```
|
|
183
184
|
|
|
184
185
|
The replay data includes message streams, envelopes, offsets, next-envelope links, payload kind, payload graph, and `eymsg:payloadTriple` triple terms. Blank-node labels are scoped per message. For Eyeleng, each payload graph is also represented as a closed RDF list of RDF 1.2 triple terms via `log:nameOf`.
|
|
@@ -206,12 +207,13 @@ Important options:
|
|
|
206
207
|
--check parse and analyze only; do not run rules
|
|
207
208
|
--strict treat static warnings as errors, including recursive term generation
|
|
208
209
|
--deps print rule dependency edges during --check
|
|
209
|
-
--query TEXT run a raw SRL body pattern over the closure
|
|
210
|
+
--query TEXT run a raw SRL body pattern over the closure or backward planner
|
|
210
211
|
--query-file FILE read a raw SRL body pattern from a file
|
|
212
|
+
--query-mode MODE use auto, forward, or backward query planning (default auto)
|
|
213
|
+
--hybrid orient function-like rules backward during forward execution and queries
|
|
211
214
|
--max-iterations N stop after N fixpoint iterations within a recursive layer
|
|
212
215
|
--no-imports parse IMPORTS/owl:imports but do not load imported rule sets
|
|
213
216
|
--rdf-messages parse input as an RDF Message Log
|
|
214
|
-
--stream-messages replay RDF Message Log envelopes
|
|
215
217
|
--include-message-facts include payload facts while parsing RDF Message Logs
|
|
216
218
|
--syntax MODE use srl, rdf, or auto syntax detection (default auto)
|
|
217
219
|
--ruleset TERM in RDF syntax, run only the selected srl:RuleSet
|
|
@@ -242,6 +244,20 @@ const { runQuery, formatBindings } = require('./src/index.js');
|
|
|
242
244
|
|
|
243
245
|
const result = runQuery(source, '?x :ancestorOf ?y');
|
|
244
246
|
console.log(formatBindings(result.query.bindings, result.prefixes));
|
|
247
|
+
|
|
248
|
+
// Query mode defaults to auto. Supported query/rule shapes are proved
|
|
249
|
+
// backward with tabling. If full backward proving is not safe but the
|
|
250
|
+
// ruleset contains function-like derived predicates, auto mode uses a
|
|
251
|
+
// hybrid plan before falling back to plain forward closure.
|
|
252
|
+
const justInTime = runQuery(source, ':alice :computedValue ?value', { queryMode: 'backward' });
|
|
253
|
+
|
|
254
|
+
// Explicit hybrid mode keeps forward materialization for ordinary rules, but
|
|
255
|
+
// orients function-like derived predicates backward and proves them only when
|
|
256
|
+
// a forward rule body or query asks for them.
|
|
257
|
+
const hybrid = run(source, { hybrid: true });
|
|
258
|
+
|
|
259
|
+
// The backward planner is demand-driven: irrelevant unsupported rules do not
|
|
260
|
+
// prevent a query from using tabled backward proving.
|
|
245
261
|
```
|
|
246
262
|
|
|
247
263
|
Imports:
|
|
@@ -274,6 +290,7 @@ src/store.js triple set, predicate index, matching, paths
|
|
|
274
290
|
src/builtins.js expression evaluation and built-in functions
|
|
275
291
|
src/analyze.js diagnostics, dependencies, strata
|
|
276
292
|
src/engine.js layered forward-chaining evaluator
|
|
293
|
+
src/backward.js goal-directed backward query prover with tabling
|
|
277
294
|
src/query.js external raw-body query operation
|
|
278
295
|
src/format.js text and JSON output
|
|
279
296
|
src/api.js public JavaScript API and import merging
|