eyeling 1.7.10 → 1.7.11
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/examples/bind.n3 +1 -1
- package/examples/snaf.n3 +1 -1
- package/eyeling.js +18 -40
- package/package.json +1 -1
package/examples/bind.n3
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
|
|
5
5
|
:phayes a :Person ; :givenName "Pat"; :familyName "Hayes" .
|
|
6
6
|
|
|
7
|
-
{ ?x a :Person .
|
|
7
|
+
{ ?x a :Person . (1 { ?x :name ?someName . } ()) log:collectAllIn ?SCOPE . ?x :givenName ?name1 . ?x :familyName ?name2 . (?name1 " " ?name2) string:concatenation ?FN . } => { ?x :name ?FN } .
|
package/examples/snaf.n3
CHANGED
package/eyeling.js
CHANGED
|
@@ -5533,62 +5533,40 @@ function evalBuiltin(goal, subst, facts, backRules, depth, varGen) {
|
|
|
5533
5533
|
return results;
|
|
5534
5534
|
}
|
|
5535
5535
|
|
|
5536
|
-
// log:includes
|
|
5536
|
+
// log:includes
|
|
5537
5537
|
// Schema: $s+ log:includes $o+
|
|
5538
|
-
//
|
|
5539
|
-
// Otherwise, the scope is the current document scope (facts + backward rules).
|
|
5538
|
+
// Object may be a concrete formula or the literal `true` (empty formula).
|
|
5540
5539
|
if (pv === LOG_NS + 'includes') {
|
|
5540
|
+
if (!(g.s instanceof GraphTerm)) return [];
|
|
5541
|
+
|
|
5541
5542
|
// Empty formula is always included.
|
|
5542
5543
|
if (g.o instanceof Literal && g.o.value === 'true') return [{ ...subst }];
|
|
5543
5544
|
if (!(g.o instanceof GraphTerm)) return [];
|
|
5544
5545
|
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
let scopeBackRules = backRules;
|
|
5549
|
-
|
|
5550
|
-
// If the subject is a formula, treat it as a concrete scope graph.
|
|
5551
|
-
// Also support `true` as the empty formula.
|
|
5552
|
-
if (g.s instanceof GraphTerm) {
|
|
5553
|
-
scopeFacts = g.s.triples.slice();
|
|
5554
|
-
ensureFactIndexes(scopeFacts);
|
|
5555
|
-
Object.defineProperty(scopeFacts, '__scopedSnapshot', { value: scopeFacts, enumerable: false, writable: true });
|
|
5556
|
-
scopeBackRules = []; // concrete scope = syntactic containment (no extra rules)
|
|
5557
|
-
} else if (g.s instanceof Literal && g.s.value === 'true') {
|
|
5558
|
-
scopeFacts = [];
|
|
5559
|
-
ensureFactIndexes(scopeFacts);
|
|
5560
|
-
Object.defineProperty(scopeFacts, '__scopedSnapshot', { value: scopeFacts, enumerable: false, writable: true });
|
|
5561
|
-
scopeBackRules = [];
|
|
5562
|
-
} else {
|
|
5563
|
-
scopeFacts = facts; // dynamic scope
|
|
5564
|
-
}
|
|
5546
|
+
const scopeFacts = g.s.triples.slice();
|
|
5547
|
+
ensureFactIndexes(scopeFacts);
|
|
5548
|
+
Object.defineProperty(scopeFacts, '__scopedSnapshot', { value: scopeFacts, enumerable: false, writable: true });
|
|
5565
5549
|
|
|
5566
5550
|
const visited2 = [];
|
|
5567
5551
|
// Start from the incoming substitution so bindings flow outward.
|
|
5568
|
-
return proveGoals(Array.from(g.o.triples), { ...subst }, scopeFacts,
|
|
5552
|
+
return proveGoals(Array.from(g.o.triples), { ...subst }, scopeFacts, [], depth + 1, visited2, varGen);
|
|
5569
5553
|
}
|
|
5570
5554
|
|
|
5571
|
-
// log:notIncludes
|
|
5572
|
-
//
|
|
5555
|
+
// log:notIncludes
|
|
5556
|
+
// Schema: $s+ log:notIncludes $o+
|
|
5573
5557
|
if (pv === LOG_NS + 'notIncludes') {
|
|
5574
|
-
if (!(g.
|
|
5558
|
+
if (!(g.s instanceof GraphTerm)) return [];
|
|
5575
5559
|
|
|
5576
|
-
|
|
5577
|
-
|
|
5560
|
+
// Empty formula is always included, so it is never "not included".
|
|
5561
|
+
if (g.o instanceof Literal && g.o.value === 'true') return [];
|
|
5562
|
+
if (!(g.o instanceof GraphTerm)) return [];
|
|
5578
5563
|
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
ensureFactIndexes(scopeFacts);
|
|
5583
|
-
Object.defineProperty(scopeFacts, '__scopedSnapshot', { value: scopeFacts, enumerable: false, writable: true });
|
|
5584
|
-
scopeBackRules = []; // concrete scope = syntactic containment (no extra rules)
|
|
5585
|
-
} else {
|
|
5586
|
-
scopeFacts = facts.__scopedSnapshot || null;
|
|
5587
|
-
if (!scopeFacts) return []; // DELAY until saturation snapshot exists
|
|
5588
|
-
}
|
|
5564
|
+
const scopeFacts = g.s.triples.slice();
|
|
5565
|
+
ensureFactIndexes(scopeFacts);
|
|
5566
|
+
Object.defineProperty(scopeFacts, '__scopedSnapshot', { value: scopeFacts, enumerable: false, writable: true });
|
|
5589
5567
|
|
|
5590
5568
|
const visited2 = [];
|
|
5591
|
-
const sols = proveGoals(Array.from(g.o.triples), {}, scopeFacts,
|
|
5569
|
+
const sols = proveGoals(Array.from(g.o.triples), { ...subst }, scopeFacts, [], depth + 1, visited2, varGen);
|
|
5592
5570
|
return sols.length ? [] : [{ ...subst }];
|
|
5593
5571
|
}
|
|
5594
5572
|
|