eyeling 1.16.4 → 1.17.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/HANDBOOK.md +158 -7
- package/README.md +1 -1
- package/examples/auroracare.n3 +528 -0
- package/examples/control-system.n3 +222 -47
- package/examples/delfour.n3 +409 -0
- package/examples/easter.n3 +208 -78
- package/examples/gps.n3 +144 -53
- package/examples/ill-formed-literals.n3 +195 -0
- package/examples/output/auroracare.n3 +149 -0
- package/examples/output/control-system.n3 +19 -4
- package/examples/output/delfour.n3 +30 -0
- package/examples/output/digital-product-passport.n3 +1 -10
- package/examples/output/easter.n3 +150 -32
- package/examples/output/genetic-algorithm-knapsack.n3 +1 -3
- package/examples/output/genetic-algorithm.n3 +1 -3
- package/examples/output/gps.n3 +14 -5
- package/examples/output/ill-formed-literals.n3 +27 -0
- package/examples/output/interop-demo.n3 +1 -34
- package/examples/output/odrl-dpv-ehds-risk-ranked.n3 +21 -12
- package/examples/output/odrl-dpv-healthcare-risk-ranked.n3 +16 -116
- package/examples/output/odrl-dpv-risk-ranked.n3 +22 -13
- package/examples/output/odrl-risk-mitigation.n3 +17 -206
- package/examples/output/odrl-risk.n3 +5 -63
- package/examples/output/parcellocker.n3 +20 -0
- package/examples/output/sqrt2-cauchy.n3 +13 -57
- package/examples/output/sqrt2-dedekind.n3 +31 -108
- package/examples/parcellocker.n3 +164 -0
- package/eyeling.js +50 -28
- package/lib/builtins.js +1 -1
- package/lib/cli.js +33 -26
- package/lib/engine.js +14 -1
- package/lib/prelude.js +2 -0
- package/package.json +1 -1
- package/test/api.test.js +2 -2
package/lib/engine.js
CHANGED
|
@@ -13,6 +13,8 @@ const {
|
|
|
13
13
|
MATH_NS,
|
|
14
14
|
LOG_NS,
|
|
15
15
|
SKOLEM_NS,
|
|
16
|
+
MAX_LITERAL_TID_LEN,
|
|
17
|
+
normalizeLiteralForTid,
|
|
16
18
|
Literal,
|
|
17
19
|
Iri,
|
|
18
20
|
Var,
|
|
@@ -921,7 +923,18 @@ function __internCompoundTid(key) {
|
|
|
921
923
|
|
|
922
924
|
function termFastKey(t) {
|
|
923
925
|
// Atomic terms that already have a stable id.
|
|
924
|
-
if (t instanceof Iri || t instanceof Blank
|
|
926
|
+
if (t instanceof Iri || t instanceof Blank) return t.__tid;
|
|
927
|
+
|
|
928
|
+
if (t instanceof Literal) {
|
|
929
|
+
// Very large literals intentionally skip global interning in prelude.js to
|
|
930
|
+
// avoid retaining huge strings forever. Their per-object __tid is therefore
|
|
931
|
+
// not value-stable, so using it here breaks duplicate detection for facts
|
|
932
|
+
// such as long log:outputString blocks that are re-derived during forward
|
|
933
|
+
// chaining. Fall back to a value-based key in that case.
|
|
934
|
+
const norm = normalizeLiteralForTid(t.value);
|
|
935
|
+
if (typeof norm === 'string' && norm.length > MAX_LITERAL_TID_LEN) return 'L:' + norm;
|
|
936
|
+
return t.__tid;
|
|
937
|
+
}
|
|
925
938
|
|
|
926
939
|
// Structural fast key for strict-ground list terms.
|
|
927
940
|
// We only index when every element has a fast key; otherwise return null.
|
package/lib/prelude.js
CHANGED
package/package.json
CHANGED
package/test/api.test.js
CHANGED
|
@@ -1205,8 +1205,8 @@ _:l2 rdf:rest rdf:nil.
|
|
|
1205
1205
|
// -------------------------
|
|
1206
1206
|
|
|
1207
1207
|
{
|
|
1208
|
-
name: '51
|
|
1209
|
-
opt: ['
|
|
1208
|
+
name: '51 automatic output rendering: prints log:outputString values ordered by key (subject)',
|
|
1209
|
+
opt: ['-n'],
|
|
1210
1210
|
input: `@prefix log: <http://www.w3.org/2000/10/swap/log#>.
|
|
1211
1211
|
|
|
1212
1212
|
<http://example.org/2> log:outputString "B".
|