eyemind 0.8.36 → 0.8.37
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/LS-SPEC.md +1 -1
- package/README.md +4 -2
- package/package.json +1 -1
- package/src/srl-parser.js +7 -2
- package/src/srl.js +1 -1
- package/src/version.js +1 -1
package/LS-SPEC.md
CHANGED
package/README.md
CHANGED
|
@@ -356,9 +356,11 @@ Turtle (`--all` adds the base graph). Rules become `implies`, `NOT` becomes
|
|
|
356
356
|
`not`, `GROUP` becomes `findall_sorted`, and a SPARQL error is a goal that
|
|
357
357
|
fails. Local variable names in `NOT` and `GROUP` cannot be bound again
|
|
358
358
|
elsewhere in the same rule. Decimals are exact (`0.1 + 0.2` is `0.3`) and
|
|
359
|
-
floats are binary64.
|
|
359
|
+
floats are binary64. `WHERE DATA` and `NOT DATA` match only the supplied
|
|
360
|
+
base graph. eyemind also accepts `GROUND` in those positions for W3C test
|
|
361
|
+
suite compatibility.
|
|
360
362
|
`NOW()` and `UUID()` use a clock and seed captured at compilation, which a
|
|
361
|
-
saved proof retains. All
|
|
363
|
+
saved proof retains. All 367 cached W3C SPARQL 1.2 RL tests pass.
|
|
362
364
|
|
|
363
365
|
```sh
|
|
364
366
|
eyemind -c rules.srl facts.ttl # the inference graph, with a checked proof
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eyemind",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.37",
|
|
4
4
|
"description": "A dependency-free Logic Script (LS) reasoner with forward and backward reasoning, checkable proofs, and RDF 1.2, Notation3 (N3), SPARQL 1.2 RL (SRL) and Logical English (LE) interoperability.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
package/src/srl-parser.js
CHANGED
|
@@ -117,12 +117,17 @@ class Parser {
|
|
|
117
117
|
this.expectValue('{');
|
|
118
118
|
const head = this.parseTriplesBlock({ allowPath: false, context: 'head' });
|
|
119
119
|
this.expectWord('WHERE');
|
|
120
|
-
const groundData = this.
|
|
120
|
+
const groundData = this.matchBaseGraph();
|
|
121
121
|
this.expectValue('{');
|
|
122
122
|
const body = this.parseRuleBodyWithBlankNodeScope();
|
|
123
123
|
return { name, head, body, groundData, runOnce: ruleNeedsRunOnce(head, body, this.options) };
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
matchBaseGraph() {
|
|
127
|
+
// eyemind: accept GROUND from W3C test fixtures alongside the published DATA.
|
|
128
|
+
return this.matchWord('DATA') || this.matchWord('GROUND');
|
|
129
|
+
}
|
|
130
|
+
|
|
126
131
|
parseRuleBodyWithBlankNodeScope() {
|
|
127
132
|
const previous = this.bodyBnodeLabels;
|
|
128
133
|
this.bodyBnodeLabels = new Map();
|
|
@@ -374,7 +379,7 @@ class Parser {
|
|
|
374
379
|
} else if (this.matchWord('BIND')) {
|
|
375
380
|
throw this.error('BIND is not part of the SPARQL 1.2 RL grammar; use SET');
|
|
376
381
|
} else if (this.matchWord('NOT')) {
|
|
377
|
-
const groundData = this.
|
|
382
|
+
const groundData = this.matchBaseGraph();
|
|
378
383
|
this.expectValue('{');
|
|
379
384
|
const body = this.parseBodyBasicAlreadyOpen();
|
|
380
385
|
clauses.push({ type: 'not', body, groundData });
|
package/src/srl.js
CHANGED
|
@@ -46,7 +46,7 @@ import { write } from './writer.js';
|
|
|
46
46
|
export class SrlError extends Error {}
|
|
47
47
|
|
|
48
48
|
// A rule set as data blocks and rules: { baseIRI, prefixes, imports, data,
|
|
49
|
-
// rules }.
|
|
49
|
+
// rules }. The parser also accepts GROUND as the base-graph modifier.
|
|
50
50
|
export function parseRuleSet(text, { base = null, filename = '<input>' } = {}) {
|
|
51
51
|
return new Parser(String(text), { baseIRI: base, filename, strictGrammar: true }).parseProgram();
|
|
52
52
|
}
|
package/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// The release this checkout is; ./release keeps it in step with package.json.
|
|
2
|
-
export const VERSION = '0.8.
|
|
2
|
+
export const VERSION = '0.8.37';
|