eyeling 1.24.2 → 1.24.4
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 +43 -7
- package/dist/browser/eyeling.browser.js +401 -72
- package/eyeling.js +401 -72
- package/index.js +2 -0
- package/lib/cli.js +27 -10
- package/lib/engine.js +17 -7
- package/lib/lexer.js +242 -52
- package/lib/multisource.js +9 -2
- package/lib/printing.js +106 -1
- package/package.json +2 -3
- package/see/README.md +2 -1
- package/see/examples/doc/rdf_dataset.md +26 -0
- package/see/examples/input/path_discovery.trig +1 -1
- package/see/examples/input/rdf_dataset.trig +34 -0
- package/see/examples/n3/rdf_dataset.n3 +34 -0
- package/see/examples/output/rdf_dataset.md +54 -0
- package/see/examples/rdf_dataset.js +1512 -0
- package/see/see.js +27 -3
- package/test/api.test.js +68 -2
- package/test/see.test.js +0 -0
- package/tools/bundle.js +0 -0
- package/test/n3gen.test.js +0 -166
- package/tools/n3gen.js +0 -2166
package/see/README.md
CHANGED
|
@@ -18,7 +18,7 @@ Each example starts from a Notation3 source and is compiled by `see.js` into a s
|
|
|
18
18
|
|
|
19
19
|
The trust gate is executable verification. If a required fact is missing, the program fails instead of emitting an unsupported entailment.
|
|
20
20
|
|
|
21
|
-
The `triple_terms`
|
|
21
|
+
The `triple_terms` and `rdf_dataset` examples use RDF 1.2 `<<( ... )>>` triple-term syntax. Eyeling accepts that syntax only with `-r, --rdf`, where it normalizes triple terms to existing N3 singleton graph terms `{ ... }` and prints feasible output graph terms back as RDF 1.2 triple terms. The `rdf_dataset` example also uses an RDF/TriG named graph block, which RDF compatibility mode normalizes to the N3 `log:nameOf { ... }` graph-term shape and prints back as a TriG named graph block where feasible; SEE keeps the committed `.trig` input and formal output in RDF 1.2/TriG form.
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
## Run
|
|
@@ -138,6 +138,7 @@ The repository currently contains **50 N3-compiled SEE examples**. Each example
|
|
|
138
138
|
| <a id="example-odrl-dpv-risk-ranking"></a>[ODRL + DPV risk ranking](#example-odrl-dpv-risk-ranking) | compiled from Notation3 by `see.js`; policy and data-protection evidence are ranked by risk level and selected through rule-derived comparisons. | [doc](examples/doc/odrl_dpv_risk_ranked.md), [js](examples/odrl_dpv_risk_ranked.js), [input](examples/input/odrl_dpv_risk_ranked.trig), [output](examples/output/odrl_dpv_risk_ranked.md), [n3](examples/n3/odrl_dpv_risk_ranked.n3) |
|
|
139
139
|
| <a id="example-path-discovery"></a>[Path discovery](#example-path-discovery) | compiled from the upstream path-discovery rules; the runner loads the full 96k-fact airroutes graph from TriG and evaluates the bounded route query with an indexed adjacency list. | [doc](examples/doc/path_discovery.md), [js](examples/path_discovery.js), [input](examples/input/path-discovery.trig), [output](examples/output/path_discovery.md), [n3](examples/n3/path_discovery.n3) |
|
|
140
140
|
| <a id="example-rc-discharge-envelope"></a>[RC discharge envelope](#example-rc-discharge-envelope) | compiled from Notation3 by `see.js`; exponentiation over an upper decay bound certifies the first sampled capacitor step below tolerance. | [doc](examples/doc/rc_discharge_envelope.md), [js](examples/rc_discharge_envelope.js), [input](examples/input/rc_discharge_envelope.trig), [output](examples/output/rc_discharge_envelope.md), [n3](examples/n3/rc_discharge_envelope.n3) |
|
|
141
|
+
| <a id="example-rdf-dataset-compatibility"></a>[RDF dataset compatibility](#example-rdf-dataset-compatibility) | compiled from Notation3 by `see.js`; RDF/TriG named graph input and RDF 1.2 triple terms demonstrate the same N3 graph-term normalization used by Eyeling's explicit RDF compatibility mode. | [doc](examples/doc/rdf_dataset.md), [js](examples/rdf_dataset.js), [input](examples/input/rdf_dataset.trig), [output](examples/output/rdf_dataset.md), [n3](examples/n3/rdf_dataset.n3) |
|
|
141
142
|
| <a id="example-rdf-message-flow"></a>[RDF Message Flow](#example-rdf-message-flow) | compiled from Notation3 by `see.js`; live RDF Messages advance through ingest, validate, interpret, route, and sink stages, with each completed message releasing the next one. | [doc](examples/doc/rdf_message_flow.md), [js](examples/rdf_message_flow.js), [input](examples/input/rdf_message_flow.trig), [output](examples/output/rdf_message_flow.md), [n3](examples/n3/rdf_message_flow.n3) |
|
|
142
143
|
| <a id="example-rdf-messages"></a>[RDF Messages](#example-rdf-messages) | compiled from Notation3 by `see.js`; ordered RDF Message Log example preserving explicit message boundaries, an empty heartbeat, message-local payloads, and reused blank-node labels. | [doc](examples/doc/rdf_messages.md), [js](examples/rdf_messages.js), [input](examples/input/rdf_messages.trig), [output](examples/output/rdf_messages.md), [n3](examples/n3/rdf_messages.n3) |
|
|
143
144
|
| <a id="example-school-placement-route-audit"></a>[School placement route audit](#example-school-placement-route-audit) | compiled from Notation3 by `see.js`; student, school, distance, and policy facts derive an auditable school-placement route decision. | [doc](examples/doc/school_placement_audit.md), [js](examples/school_placement_audit.js), [input](examples/input/school_placement_audit.trig), [output](examples/output/school_placement_audit.md), [n3](examples/n3/school_placement_audit.n3) |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# RDF dataset compatibility
|
|
2
|
+
|
|
3
|
+
Generated by `see.js` from a Notation3 source file.
|
|
4
|
+
|
|
5
|
+
RDF 1.1 named graph data and RDF 1.2 triple terms are normalized to ordinary N3 graph terms before SEE compiles the derivation.
|
|
6
|
+
|
|
7
|
+
## Compilation summary
|
|
8
|
+
|
|
9
|
+
- Example name: `rdf_dataset`
|
|
10
|
+
- Input facts emitted: 4
|
|
11
|
+
- Forward rules compiled: 1
|
|
12
|
+
- Backward predicate rules compiled: 0
|
|
13
|
+
- Fuses compiled: 0
|
|
14
|
+
- Predicate count: 5
|
|
15
|
+
|
|
16
|
+
## Built-ins used
|
|
17
|
+
|
|
18
|
+
- `log:nameOf`
|
|
19
|
+
|
|
20
|
+
## Runtime model
|
|
21
|
+
|
|
22
|
+
The generated `examples/rdf_dataset.js` is a specialized JavaScript derivation program. For ordinary sources, `see.js` emits the source facts as `examples/input/rdf_dataset.trig`. For rules-only sources, generation can reuse an existing external evidence file such as `examples/input/rdf-dataset.trig` or `examples/input/rdf_dataset.trig`. The runner reads that TriG evidence directly and performs a local fixpoint derivation; it does not parse the program source or call an external reasoner.
|
|
23
|
+
|
|
24
|
+
## Output model
|
|
25
|
+
|
|
26
|
+
Running `node examples/rdf_dataset.js` produces a SEE-style Markdown report with an **Entailment** section, an **Explanation** section, and a **Formal TriG Output** section containing the selected derived/query facts.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
@prefix in: <https://example.org/see/input#> .
|
|
10
10
|
|
|
11
11
|
# Formal SEE input evidence in RDF 1.2 TriG.
|
|
12
|
-
# The generated runner
|
|
12
|
+
# The generated runner reads this TriG evidence directly in RDF compatibility mode.
|
|
13
13
|
|
|
14
14
|
# No source facts were present in the N3 program.
|
|
15
15
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
VERSION "1.2"
|
|
2
|
+
|
|
3
|
+
@prefix : <https://eyereasoner.github.io/see/examples/rdf-dataset#> .
|
|
4
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
5
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
6
|
+
@prefix see: <https://example.org/see#> .
|
|
7
|
+
@prefix in: <https://example.org/see/input#> .
|
|
8
|
+
|
|
9
|
+
# Formal SEE input evidence in RDF 1.2 TriG.
|
|
10
|
+
# The generated runner reads this TriG evidence directly.
|
|
11
|
+
|
|
12
|
+
:sensor :reports :overheating .
|
|
13
|
+
:overheating :requires :inspection .
|
|
14
|
+
:maintenanceSystem :trusted true .
|
|
15
|
+
|
|
16
|
+
:factoryDataset {
|
|
17
|
+
:observation rdf:reifies <<( :sensor :reports :overheating )>> .
|
|
18
|
+
:observation :recordedBy :maintenanceSystem .
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
in:metadata {
|
|
22
|
+
in:run a see:InputDataset .
|
|
23
|
+
in:run see:name "rdf_dataset" .
|
|
24
|
+
in:run see:title "RDF dataset compatibility" .
|
|
25
|
+
in:run see:sourceFile "examples/n3/rdf_dataset.n3" .
|
|
26
|
+
in:run see:sourceSHA256 "76035a24eb72fc1d28a5e1f3021baefee0dde667aa8fc9f2b0a111f9c773b744" .
|
|
27
|
+
in:run see:description "RDF 1.1 named graph data and RDF 1.2 triple terms are normalized to ordinary N3 graph terms before SEE compiles the derivation." .
|
|
28
|
+
in:run see:compiler "see.js N3-to-JS compiler" .
|
|
29
|
+
in:run see:inputFacts 4 .
|
|
30
|
+
in:run see:compiledRules 1 .
|
|
31
|
+
in:run see:compiledBackwardRules 0 .
|
|
32
|
+
in:run see:compiledFuses 0 .
|
|
33
|
+
in:run see:compiledQueries 1 .
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# RDF dataset compatibility
|
|
2
|
+
# RDF 1.1 named graph data and RDF 1.2 triple terms are normalized to ordinary N3 graph terms before SEE compiles the derivation.
|
|
3
|
+
|
|
4
|
+
VERSION "1.2"
|
|
5
|
+
@prefix : <https://eyereasoner.github.io/see/examples/rdf-dataset#> .
|
|
6
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
7
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
8
|
+
|
|
9
|
+
:sensor :reports :overheating .
|
|
10
|
+
:overheating :requires :inspection .
|
|
11
|
+
:maintenanceSystem :trusted true .
|
|
12
|
+
|
|
13
|
+
:factoryDataset {
|
|
14
|
+
:observation rdf:reifies <<( :sensor :reports :overheating )>> .
|
|
15
|
+
:observation :recordedBy :maintenanceSystem .
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
{
|
|
19
|
+
:sensor :reports ?condition .
|
|
20
|
+
?condition :requires ?action .
|
|
21
|
+
:maintenanceSystem :trusted true .
|
|
22
|
+
} => {
|
|
23
|
+
:workOrder :entails <<( :sensor :needs ?action )>> .
|
|
24
|
+
:audit log:nameOf {
|
|
25
|
+
:workOrder :basedOn :factoryDataset .
|
|
26
|
+
:workOrder :checkedBy :maintenanceSystem .
|
|
27
|
+
} .
|
|
28
|
+
} .
|
|
29
|
+
|
|
30
|
+
{
|
|
31
|
+
:workOrder :entails <<( ?device :needs ?action )>> .
|
|
32
|
+
} log:query {
|
|
33
|
+
:workOrder :entails <<( ?device :needs ?action )>> .
|
|
34
|
+
} .
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# RDF dataset compatibility
|
|
2
|
+
|
|
3
|
+
## Entailment
|
|
4
|
+
The compiled query selected 1 fact(s) after the rule closure was computed.
|
|
5
|
+
Main entailment: **:workOrder :entails <<( :sensor :needs :inspection )>>.**
|
|
6
|
+
|
|
7
|
+
Selected entailments:
|
|
8
|
+
- :workOrder :entails <<( :sensor :needs :inspection )>> .
|
|
9
|
+
|
|
10
|
+
## Explanation
|
|
11
|
+
Starts with 4 source fact(s), applies 1 rule(s), and reaches a fixpoint.
|
|
12
|
+
The log:query projection then keeps only the matching fact(s) shown above.
|
|
13
|
+
|
|
14
|
+
Derivation steps:
|
|
15
|
+
- Rule 1 (3 premise pattern(s) => 2 conclusion pattern(s)) derives :workOrder :entails <<( :sensor :needs :inspection )>> ., :audit log:nameOf { :workOrder :basedOn :factoryDataset . :workOrder :checkedBy :maintenanceSystem } .
|
|
16
|
+
- Uses: :sensor :reports :overheating . _(source)_; :overheating :requires :inspection . _(source)_; :maintenanceSystem :trusted true . _(source)_
|
|
17
|
+
|
|
18
|
+
Selected explanation support:
|
|
19
|
+
- :workOrder :entails <<( :sensor :needs :inspection )>> . _(derived by Rule 1)_
|
|
20
|
+
- :sensor :reports :overheating . _(source)_
|
|
21
|
+
- :overheating :requires :inspection . _(source)_
|
|
22
|
+
- :maintenanceSystem :trusted true . _(source)_
|
|
23
|
+
|
|
24
|
+
The query-selected facts are serialized in the Formal TriG Output section.
|
|
25
|
+
|
|
26
|
+
## Formal TriG Output
|
|
27
|
+
|
|
28
|
+
```trig
|
|
29
|
+
VERSION "1.2"
|
|
30
|
+
|
|
31
|
+
@prefix : <https://eyereasoner.github.io/see/examples/rdf-dataset#> .
|
|
32
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
33
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
34
|
+
@prefix see: <https://example.org/see#> .
|
|
35
|
+
@prefix in: <https://example.org/see/input#> .
|
|
36
|
+
|
|
37
|
+
:workOrder :entails <<( :sensor :needs :inspection )>> .
|
|
38
|
+
|
|
39
|
+
in:metadata {
|
|
40
|
+
in:run a see:InputDataset .
|
|
41
|
+
in:run see:name "rdf_dataset" .
|
|
42
|
+
in:run see:title "RDF dataset compatibility" .
|
|
43
|
+
in:run see:sourceFile "examples/n3/rdf_dataset.n3" .
|
|
44
|
+
in:run see:sourceSHA256 "76035a24eb72fc1d28a5e1f3021baefee0dde667aa8fc9f2b0a111f9c773b744" .
|
|
45
|
+
in:run see:description "RDF 1.1 named graph data and RDF 1.2 triple terms are normalized to ordinary N3 graph terms before SEE compiles the derivation." .
|
|
46
|
+
in:run see:compiler "see.js N3-to-JS compiler" .
|
|
47
|
+
in:run see:inputFacts 4 .
|
|
48
|
+
in:run see:compiledRules 1 .
|
|
49
|
+
in:run see:compiledBackwardRules 0 .
|
|
50
|
+
in:run see:compiledFuses 0 .
|
|
51
|
+
in:run see:compiledQueries 1 .
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|