eyeling 1.30.6 → 1.32.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 +0 -161
- package/dist/browser/eyeling.browser.js +54 -638
- package/eyeling.js +54 -638
- package/index.d.ts +9 -49
- package/index.js +1 -2
- package/lib/cli.js +4 -11
- package/lib/engine.js +6 -14
- package/lib/lexer.js +2 -6
- package/lib/multisource.js +3 -5
- package/lib/rdfjs.js +39 -1
- package/package.json +4 -2
- package/test/examples.test.js +5 -37
- package/test/run.js +0 -1
- package/examples/input/rdf-surfaces-all-values-from-reverse.trig +0 -18
- package/examples/input/rdf-surfaces-all-values-from.trig +0 -14
- package/examples/input/rdf-surfaces-ancestor.trig +0 -21
- package/examples/input/rdf-surfaces-city.trig +0 -12
- package/examples/input/rdf-surfaces-disjunction-elimination.trig +0 -17
- package/examples/input/rdf-surfaces-disjunction-route-filter.trig +0 -12
- package/examples/input/rdf-surfaces-domain.trig +0 -12
- package/examples/input/rdf-surfaces-explicit-disjunction.trig +0 -23
- package/examples/input/rdf-surfaces-multi-premise.trig +0 -14
- package/examples/input/rdf-surfaces-owl-all-values-from-codex.trig +0 -36
- package/examples/input/rdf-surfaces-property-chain.trig +0 -14
- package/examples/input/rdf-surfaces-range.trig +0 -12
- package/examples/input/rdf-surfaces-rdf12-graph-triple-term.trig +0 -15
- package/examples/input/rdf-surfaces-rdf12-named-graph.trig +0 -14
- package/examples/input/rdf-surfaces-rdf12-triple-term.trig +0 -13
- package/examples/input/rdf-surfaces-rdfs-range-codex.trig +0 -19
- package/examples/input/rdf-surfaces-rdfs-subclass-codex.trig +0 -19
- package/examples/input/rdf-surfaces-strong-negation-access.trig +0 -15
- package/examples/output/rdf-surfaces-all-values-from-reverse.n3 +0 -3
- package/examples/output/rdf-surfaces-all-values-from.n3 +0 -3
- package/examples/output/rdf-surfaces-ancestor.n3 +0 -5
- package/examples/output/rdf-surfaces-city.n3 +0 -3
- package/examples/output/rdf-surfaces-disjunction-elimination.n3 +0 -3
- package/examples/output/rdf-surfaces-disjunction-route-filter.n3 +0 -3
- package/examples/output/rdf-surfaces-domain.n3 +0 -3
- package/examples/output/rdf-surfaces-explicit-disjunction.n3 +0 -3
- package/examples/output/rdf-surfaces-multi-premise.n3 +0 -3
- package/examples/output/rdf-surfaces-owl-all-values-from-codex.n3 +0 -6
- package/examples/output/rdf-surfaces-property-chain.n3 +0 -3
- package/examples/output/rdf-surfaces-range.n3 +0 -3
- package/examples/output/rdf-surfaces-rdf12-graph-triple-term.n3 +0 -3
- package/examples/output/rdf-surfaces-rdf12-named-graph.n3 +0 -3
- package/examples/output/rdf-surfaces-rdf12-triple-term.n3 +0 -3
- package/examples/output/rdf-surfaces-rdfs-range-codex.n3 +0 -3
- package/examples/output/rdf-surfaces-rdfs-subclass-codex.n3 +0 -3
- package/examples/output/rdf-surfaces-strong-negation-access.n3 +0 -4
- package/examples/rdf-surfaces-all-values-from-reverse.n3 +0 -6
- package/examples/rdf-surfaces-all-values-from.n3 +0 -6
- package/examples/rdf-surfaces-ancestor.n3 +0 -6
- package/examples/rdf-surfaces-city.n3 +0 -6
- package/examples/rdf-surfaces-disjunction-elimination.n3 +0 -13
- package/examples/rdf-surfaces-disjunction-route-filter.n3 +0 -24
- package/examples/rdf-surfaces-domain.n3 +0 -6
- package/examples/rdf-surfaces-explicit-disjunction.n3 +0 -16
- package/examples/rdf-surfaces-multi-premise.n3 +0 -6
- package/examples/rdf-surfaces-owl-all-values-from-codex.n3 +0 -10
- package/examples/rdf-surfaces-property-chain.n3 +0 -6
- package/examples/rdf-surfaces-range.n3 +0 -6
- package/examples/rdf-surfaces-rdf12-graph-triple-term.n3 +0 -6
- package/examples/rdf-surfaces-rdf12-named-graph.n3 +0 -6
- package/examples/rdf-surfaces-rdf12-triple-term.n3 +0 -6
- package/examples/rdf-surfaces-rdfs-range-codex.n3 +0 -6
- package/examples/rdf-surfaces-rdfs-subclass-codex.n3 +0 -6
- package/examples/rdf-surfaces-strong-negation-access.n3 +0 -20
- package/lib/rdf_surfaces.js +0 -598
- package/test/rdf_surfaces.test.js +0 -227
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
VERSION "1.2-surfaces"
|
|
2
|
-
# eyeling-options: --rdf-surfaces
|
|
3
|
-
@prefix ex: <http://example.org/> .
|
|
4
|
-
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
5
|
-
|
|
6
|
-
ex:AllowedContainer owl:onProperty ex:contains .
|
|
7
|
-
ex:AllowedContainer owl:allValuesFrom ex:AllowedItem .
|
|
8
|
-
ex:box a ex:AllowedContainer .
|
|
9
|
-
ex:box ex:contains ex:item42 .
|
|
10
|
-
ex:crate ex:contains ex:item43 .
|
|
11
|
-
ex:item43 a ex:AllowedItem .
|
|
12
|
-
|
|
13
|
-
%not[ _:a _:b _:c
|
|
14
|
-
_:a owl:onProperty _:b .
|
|
15
|
-
_:a owl:allValuesFrom _:c .
|
|
16
|
-
%not[
|
|
17
|
-
%not[ _:x _:y
|
|
18
|
-
_:x a _:a .
|
|
19
|
-
_:x _:b _:y .
|
|
20
|
-
%not[
|
|
21
|
-
_:y a _:c .
|
|
22
|
-
%]
|
|
23
|
-
%]
|
|
24
|
-
%not[ _:x
|
|
25
|
-
%not[ _:y
|
|
26
|
-
_:x _:b _:y .
|
|
27
|
-
%not[
|
|
28
|
-
_:y a _:c .
|
|
29
|
-
%]
|
|
30
|
-
%]
|
|
31
|
-
%not[
|
|
32
|
-
_:x a _:a .
|
|
33
|
-
%]
|
|
34
|
-
%]
|
|
35
|
-
%]
|
|
36
|
-
%]
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
VERSION "1.2-surfaces"
|
|
2
|
-
# eyeling-options: --rdf-surfaces
|
|
3
|
-
@prefix ex: <http://example.org/> .
|
|
4
|
-
|
|
5
|
-
ex:alice ex:parent ex:bob .
|
|
6
|
-
ex:bob ex:parent ex:carol .
|
|
7
|
-
|
|
8
|
-
%not[ _:x _:y _:z
|
|
9
|
-
_:x ex:parent _:y .
|
|
10
|
-
_:y ex:parent _:z .
|
|
11
|
-
%not[
|
|
12
|
-
_:x ex:grandparent _:z .
|
|
13
|
-
%]
|
|
14
|
-
%]
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
VERSION "1.2-surfaces"
|
|
2
|
-
# eyeling-options: --rdf-surfaces
|
|
3
|
-
@prefix ex: <http://example.org/> .
|
|
4
|
-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
5
|
-
|
|
6
|
-
ex:auditGraph {
|
|
7
|
-
ex:obs1 rdf:reifies <<( ex:sensor17 ex:reports ex:Overheating )>> .
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
%not[ _:obs
|
|
11
|
-
ex:auditGraph { _:obs rdf:reifies <<( ex:sensor17 ex:reports ex:Overheating )>> . }
|
|
12
|
-
%not[
|
|
13
|
-
_:obs a ex:AuditedObservation .
|
|
14
|
-
%]
|
|
15
|
-
%]
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
VERSION "1.2-surfaces"
|
|
2
|
-
# eyeling-options: --rdf-surfaces
|
|
3
|
-
@prefix ex: <http://example.org/> .
|
|
4
|
-
|
|
5
|
-
ex:regionalReport {
|
|
6
|
-
ex:Brussels a ex:City .
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
%not[ _:x
|
|
10
|
-
ex:regionalReport { _:x a ex:City . }
|
|
11
|
-
%not[
|
|
12
|
-
_:x a ex:ReportedCity .
|
|
13
|
-
%]
|
|
14
|
-
%]
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
VERSION "1.2-surfaces"
|
|
2
|
-
# eyeling-options: --rdf-surfaces
|
|
3
|
-
@prefix ex: <http://example.org/> .
|
|
4
|
-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
5
|
-
|
|
6
|
-
ex:claim1 rdf:reifies <<( ex:Brussels rdf:type ex:City )>> .
|
|
7
|
-
|
|
8
|
-
%not[ _:claim
|
|
9
|
-
_:claim rdf:reifies <<( ex:Brussels rdf:type ex:City )>> .
|
|
10
|
-
%not[
|
|
11
|
-
_:claim a ex:CityClaim .
|
|
12
|
-
%]
|
|
13
|
-
%]
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
VERSION "1.2-surfaces"
|
|
2
|
-
# eyeling-options: --rdf-surfaces
|
|
3
|
-
@prefix ex: <http://example.org/> .
|
|
4
|
-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
5
|
-
|
|
6
|
-
ex:parent rdfs:range ex:Person .
|
|
7
|
-
ex:alice ex:parent ex:bob .
|
|
8
|
-
|
|
9
|
-
%not[ _:p _:c
|
|
10
|
-
_:p rdfs:range _:c .
|
|
11
|
-
%not[
|
|
12
|
-
%not[ _:s _:o
|
|
13
|
-
_:s _:p _:o .
|
|
14
|
-
%not[
|
|
15
|
-
_:o a _:c .
|
|
16
|
-
%]
|
|
17
|
-
%]
|
|
18
|
-
%]
|
|
19
|
-
%]
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
VERSION "1.2-surfaces"
|
|
2
|
-
# eyeling-options: --rdf-surfaces
|
|
3
|
-
@prefix ex: <http://example.org/> .
|
|
4
|
-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
5
|
-
|
|
6
|
-
ex:City rdfs:subClassOf ex:HumanCommunity .
|
|
7
|
-
ex:Brussels a ex:City .
|
|
8
|
-
|
|
9
|
-
%not[ _:c _:d
|
|
10
|
-
_:c rdfs:subClassOf _:d .
|
|
11
|
-
%not[
|
|
12
|
-
%not[ _:x
|
|
13
|
-
_:x a _:c .
|
|
14
|
-
%not[
|
|
15
|
-
_:x a _:d .
|
|
16
|
-
%]
|
|
17
|
-
%]
|
|
18
|
-
%]
|
|
19
|
-
%]
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
VERSION "1.2-surfaces"
|
|
2
|
-
# eyeling-options: --rdf-surfaces
|
|
3
|
-
@prefix ex: <http://example.org/> .
|
|
4
|
-
|
|
5
|
-
ex:alice ex:requests ex:lab .
|
|
6
|
-
ex:bob ex:requests ex:lab .
|
|
7
|
-
ex:lab a ex:RestrictedArea .
|
|
8
|
-
ex:alice ex:clearance ex:general .
|
|
9
|
-
ex:bob ex:clearance ex:admin .
|
|
10
|
-
|
|
11
|
-
# Strong negation: nobody with general clearance may access the lab.
|
|
12
|
-
%not[ _:person
|
|
13
|
-
_:person ex:access ex:lab .
|
|
14
|
-
_:person ex:clearance ex:general .
|
|
15
|
-
%]
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
@prefix ex: <http://example.org/> .
|
|
2
|
-
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
3
|
-
|
|
4
|
-
# Disjunction elimination as N3 rules: if every disjunctive option implies the
|
|
5
|
-
# same candidate conclusion, then the whole disjunction entails that conclusion.
|
|
6
|
-
{ ?choice ex:candidateConclusion ?conclusion .
|
|
7
|
-
( { ?choice ex:option ?option . }
|
|
8
|
-
{ ?option ex:implies ?conclusion . } ) log:forAllIn 1 .
|
|
9
|
-
} => { ?choice ex:disjunctionEntails ?conclusion . } .
|
|
10
|
-
|
|
11
|
-
{ ?choice ex:disjunctionEntails ?conclusion . }
|
|
12
|
-
log:query
|
|
13
|
-
{ ?choice ex:disjunctionEntails ?conclusion . } .
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
@prefix ex: <http://example.org/> .
|
|
2
|
-
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
3
|
-
|
|
4
|
-
# Extra N3 rules encode a disjunction as explicit alternatives. This does not
|
|
5
|
-
# assert both routes; it derives candidate routes that can be filtered.
|
|
6
|
-
{ ?shipment a ex:ExpressShipment . }
|
|
7
|
-
=> {
|
|
8
|
-
?shipment ex:possibleRoute ex:Rail .
|
|
9
|
-
?shipment ex:possibleRoute ex:Drone .
|
|
10
|
-
} .
|
|
11
|
-
|
|
12
|
-
# Mirror the strong-negation policy into a filterable denial fact before any
|
|
13
|
-
# candidate route is selected as viable.
|
|
14
|
-
{ ?shipment ex:destination ex:CityCenter .
|
|
15
|
-
?shipment ex:possibleRoute ex:Drone .
|
|
16
|
-
} => { ?shipment ex:stronglyNegatedRoute ex:Drone . } .
|
|
17
|
-
|
|
18
|
-
{ ?shipment ex:possibleRoute ?route .
|
|
19
|
-
1 log:notIncludes { ?shipment ex:stronglyNegatedRoute ?route . } .
|
|
20
|
-
} => { ?shipment ex:viableRoute ?route . } .
|
|
21
|
-
|
|
22
|
-
{ ?shipment ex:viableRoute ?route . }
|
|
23
|
-
log:query
|
|
24
|
-
{ ?shipment ex:viableRoute ?route . } .
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
@prefix ex: <http://example.org/> .
|
|
2
|
-
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
3
|
-
|
|
4
|
-
# Extra N3 rules interpret the explicit surface disjunction as candidate
|
|
5
|
-
# alternatives and select the alternatives that are not strongly negated.
|
|
6
|
-
{ ?shipment ex:destination ex:CityCenter .
|
|
7
|
-
?shipment ex:possibleRoute ex:Drone .
|
|
8
|
-
} => { ?shipment ex:stronglyNegatedRoute ex:Drone . } .
|
|
9
|
-
|
|
10
|
-
{ ?shipment ex:possibleRoute ?route .
|
|
11
|
-
1 log:notIncludes { ?shipment ex:stronglyNegatedRoute ?route . } .
|
|
12
|
-
} => { ?shipment ex:selectedRoute ?route . } .
|
|
13
|
-
|
|
14
|
-
{ ?shipment ex:selectedRoute ?route . }
|
|
15
|
-
log:query
|
|
16
|
-
{ ?shipment ex:selectedRoute ?route . } .
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
@prefix ex: <http://example.org/> .
|
|
2
|
-
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
3
|
-
|
|
4
|
-
# Extra N3 rules interpret the positive policy. The RDF Surface above remains
|
|
5
|
-
# a hard strong-negation guard: deriving the forbidden access would trip the fuse.
|
|
6
|
-
{ ?person ex:requests ?area .
|
|
7
|
-
?person ex:clearance ex:admin .
|
|
8
|
-
} => { ?person ex:access ?area . } .
|
|
9
|
-
|
|
10
|
-
{ ?person ex:requests ?area .
|
|
11
|
-
?person ex:access ?area .
|
|
12
|
-
} => { ?person ex:decision ex:Permit . } .
|
|
13
|
-
|
|
14
|
-
{ ?person ex:requests ?area .
|
|
15
|
-
1 log:notIncludes { ?person ex:decision ex:Permit . } .
|
|
16
|
-
} => { ?person ex:decision ex:Deny . } .
|
|
17
|
-
|
|
18
|
-
{ ?person ex:decision ?decision . }
|
|
19
|
-
log:query
|
|
20
|
-
{ ?person ex:decision ?decision . } .
|