eyeling 1.30.6 → 1.31.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 +15 -637
- package/eyeling.js +15 -637
- package/index.d.ts +0 -4
- 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/package.json +1 -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
package/README.md
CHANGED
|
@@ -292,7 +292,6 @@ eyeling --rdf --stream-messages rules.n3 messages.trig
|
|
|
292
292
|
| `-h`, `--help` | Show help and exit. |
|
|
293
293
|
| `-p`, `--proof` | Enable proof explanations. |
|
|
294
294
|
| `-r`, `--rdf` | Enable RDF/TriG input and output compatibility. |
|
|
295
|
-
| `--rdf-surfaces` | Enable RDF Surfaces `%not[ ... %]` syntax. Implies `--rdf`. |
|
|
296
295
|
| `--stream-messages` | Process RDF Message Logs one message at a time under `--rdf`. |
|
|
297
296
|
| `-s`, `--super-restricted` | Disable all built-ins except implication handling. |
|
|
298
297
|
| `-t`, `--stream` | Stream derived triples as soon as they are derived. |
|
|
@@ -357,7 +356,6 @@ Useful options:
|
|
|
357
356
|
|---|---|
|
|
358
357
|
| `proof` | Include proof explanations when true. Defaults to false for API output. |
|
|
359
358
|
| `rdf` | Enable RDF/TriG compatibility mode. |
|
|
360
|
-
| `rdfSurfaces` | Enable RDF Surfaces syntax. Implies RDF compatibility in the bundled CLI path. |
|
|
361
359
|
| `args` | Extra CLI-style arguments. |
|
|
362
360
|
| `maxBuffer` | Child-process output buffer limit. |
|
|
363
361
|
| `builtinModules` | Custom built-in module path or paths. |
|
|
@@ -429,7 +427,6 @@ Useful options:
|
|
|
429
427
|
| `onDerived` | Callback called for derived or query-selected output. |
|
|
430
428
|
| `enforceHttps` | Apply HTTPS rewriting for dereferencing built-ins. |
|
|
431
429
|
| `rdf` | Enable RDF/TriG compatibility mode. |
|
|
432
|
-
| `rdfSurfaces` | Enable RDF Surfaces syntax. Implies RDF compatibility. |
|
|
433
430
|
| `rdfjs` | Also emit RDF-JS quads where conversion is possible. |
|
|
434
431
|
| `dataFactory` | Custom RDF-JS DataFactory. |
|
|
435
432
|
| `skipUnsupportedRdfJs` | Skip N3-only terms when producing RDF-JS quads. |
|
|
@@ -591,161 +588,6 @@ In RDF mode, Eyeling accepts and serializes RDF-compatible forms such as:
|
|
|
591
588
|
|
|
592
589
|
RDF 1.2 triple terms require explicit RDF compatibility mode. This protects ordinary N3 users from accidentally mixing parser modes.
|
|
593
590
|
|
|
594
|
-
### RDF Surfaces
|
|
595
|
-
|
|
596
|
-
RDF Surfaces are enabled with `--rdf-surfaces` on the CLI or `{ rdfSurfaces: true }` in the API. The option implies RDF compatibility mode. The syntax follows the BLOGIC text convention from Pat Hayes' ISWC 2009 slides: `%not[` and `%]` surface parentheses plus explicit blank-node binding graffiti at the beginning of a surface. Because RDF Surfaces may now combine the surface extension with RDF 1.2 TriG features, the examples use `.trig` for RDF Surface input files and start with `VERSION "1.2-surfaces"`.
|
|
597
|
-
|
|
598
|
-
The examples keep RDF Surface input separate from Eyeling queries:
|
|
599
|
-
|
|
600
|
-
- `examples/input/<name>.trig` contains RDF 1.2 TriG input, RDF Surface rules, and the `VERSION "1.2-surfaces"` header.
|
|
601
|
-
- `examples/<name>.n3` contains only the corresponding `log:query`.
|
|
602
|
-
|
|
603
|
-
Use separate non-indented lines for triples and surface closes. Put only newly bound blank marks on the surface-opening line; marks already bound by an outer surface are reused in inner triples and are not repeated after `%not[`.
|
|
604
|
-
|
|
605
|
-
```trig
|
|
606
|
-
VERSION "1.2-surfaces"
|
|
607
|
-
@prefix ex: <http://example.org/> .
|
|
608
|
-
|
|
609
|
-
ex:Brussels a ex:City .
|
|
610
|
-
|
|
611
|
-
%not[ _:x
|
|
612
|
-
_:x a ex:City .
|
|
613
|
-
%not[
|
|
614
|
-
_:x a ex:HumanCommunity .
|
|
615
|
-
%]
|
|
616
|
-
%]
|
|
617
|
-
```
|
|
618
|
-
|
|
619
|
-
The slide-32 shape above is normalized as:
|
|
620
|
-
|
|
621
|
-
```n3
|
|
622
|
-
{ ?x a ex:City . }
|
|
623
|
-
=>
|
|
624
|
-
{ ?x a ex:HumanCommunity . } .
|
|
625
|
-
```
|
|
626
|
-
|
|
627
|
-
The first slide-33 abbreviation, range, is written as:
|
|
628
|
-
|
|
629
|
-
```trig
|
|
630
|
-
%not[ _:x _:y
|
|
631
|
-
_:x ex:parent _:y .
|
|
632
|
-
%not[
|
|
633
|
-
_:y a ex:Person .
|
|
634
|
-
%]
|
|
635
|
-
%]
|
|
636
|
-
```
|
|
637
|
-
|
|
638
|
-
and behaves like:
|
|
639
|
-
|
|
640
|
-
```n3
|
|
641
|
-
{ ?x ex:parent ?y . }
|
|
642
|
-
=>
|
|
643
|
-
{ ?y a ex:Person . } .
|
|
644
|
-
```
|
|
645
|
-
|
|
646
|
-
Eyeling also recognizes codex-style surfaces that introduce rules from RDF/OWL vocabulary facts. For example, this `rdfs:range` codex:
|
|
647
|
-
|
|
648
|
-
```trig
|
|
649
|
-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
650
|
-
|
|
651
|
-
%not[ _:p _:c
|
|
652
|
-
_:p rdfs:range _:c .
|
|
653
|
-
%not[
|
|
654
|
-
%not[ _:s _:o
|
|
655
|
-
_:s _:p _:o .
|
|
656
|
-
%not[
|
|
657
|
-
_:o a _:c .
|
|
658
|
-
%]
|
|
659
|
-
%]
|
|
660
|
-
%]
|
|
661
|
-
%]
|
|
662
|
-
```
|
|
663
|
-
|
|
664
|
-
is normalized to the Horn rule shape:
|
|
665
|
-
|
|
666
|
-
```n3
|
|
667
|
-
{
|
|
668
|
-
?p rdfs:range ?c .
|
|
669
|
-
?s ?p ?o .
|
|
670
|
-
}
|
|
671
|
-
=>
|
|
672
|
-
{ ?o a ?c . } .
|
|
673
|
-
```
|
|
674
|
-
|
|
675
|
-
The slide-33 `owl:allValuesFrom` codex is supported in both directions:
|
|
676
|
-
|
|
677
|
-
```trig
|
|
678
|
-
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
679
|
-
|
|
680
|
-
%not[ _:a _:b _:c
|
|
681
|
-
_:a owl:onProperty _:b .
|
|
682
|
-
_:a owl:allValuesFrom _:c .
|
|
683
|
-
%not[
|
|
684
|
-
%not[ _:x _:y
|
|
685
|
-
_:x a _:a .
|
|
686
|
-
_:x _:b _:y .
|
|
687
|
-
%not[
|
|
688
|
-
_:y a _:c .
|
|
689
|
-
%]
|
|
690
|
-
%]
|
|
691
|
-
%not[ _:x
|
|
692
|
-
%not[ _:y
|
|
693
|
-
_:x _:b _:y .
|
|
694
|
-
%not[
|
|
695
|
-
_:y a _:c .
|
|
696
|
-
%]
|
|
697
|
-
%]
|
|
698
|
-
%not[
|
|
699
|
-
_:x a _:a .
|
|
700
|
-
%]
|
|
701
|
-
%]
|
|
702
|
-
%]
|
|
703
|
-
%]
|
|
704
|
-
```
|
|
705
|
-
|
|
706
|
-
The forward part derives filler types. The reverse part is compiled into a data-driven scoped check using `log:forAllIn`: for each resource with at least one property value, if all those values are known to have the target class, infer the restricted class.
|
|
707
|
-
|
|
708
|
-
A top-level negative surface without a nested negative child is treated as an inference fuse:
|
|
709
|
-
|
|
710
|
-
```trig
|
|
711
|
-
%not[ _:x
|
|
712
|
-
_:x a ex:Impossible .
|
|
713
|
-
%]
|
|
714
|
-
```
|
|
715
|
-
|
|
716
|
-
which behaves like:
|
|
717
|
-
|
|
718
|
-
```n3
|
|
719
|
-
{ ?x a ex:Impossible . } => false .
|
|
720
|
-
```
|
|
721
|
-
|
|
722
|
-
The implementation is intentionally conservative: it supports the practical Horn fragment used by the included RDF Surfaces examples, including slide-32 implication, slide-33 range/allValuesFrom codices, nested codices that flatten to Horn rules, scoped `log:forAllIn` reverse checks, and top-level negative-surface fuses. It does not claim to be a complete first-order RDF Surfaces theorem prover.
|
|
723
|
-
|
|
724
|
-
Run the included examples:
|
|
725
|
-
|
|
726
|
-
```bash
|
|
727
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-city.trig examples/rdf-surfaces-city.n3
|
|
728
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-range.trig examples/rdf-surfaces-range.n3
|
|
729
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-domain.trig examples/rdf-surfaces-domain.n3
|
|
730
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-property-chain.trig examples/rdf-surfaces-property-chain.n3
|
|
731
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-ancestor.trig examples/rdf-surfaces-ancestor.n3
|
|
732
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-multi-premise.trig examples/rdf-surfaces-multi-premise.n3
|
|
733
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-all-values-from.trig examples/rdf-surfaces-all-values-from.n3
|
|
734
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-all-values-from-reverse.trig examples/rdf-surfaces-all-values-from-reverse.n3
|
|
735
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-rdfs-range-codex.trig examples/rdf-surfaces-rdfs-range-codex.n3
|
|
736
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-rdfs-subclass-codex.trig examples/rdf-surfaces-rdfs-subclass-codex.n3
|
|
737
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-rdf12-named-graph.trig examples/rdf-surfaces-rdf12-named-graph.n3
|
|
738
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-rdf12-triple-term.trig examples/rdf-surfaces-rdf12-triple-term.n3
|
|
739
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-rdf12-graph-triple-term.trig examples/rdf-surfaces-rdf12-graph-triple-term.n3
|
|
740
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-owl-all-values-from-codex.trig examples/rdf-surfaces-owl-all-values-from-codex.n3
|
|
741
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-strong-negation-access.trig examples/rdf-surfaces-strong-negation-access.n3
|
|
742
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-disjunction-route-filter.trig examples/rdf-surfaces-disjunction-route-filter.n3
|
|
743
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-explicit-disjunction.trig examples/rdf-surfaces-explicit-disjunction.n3
|
|
744
|
-
eyeling --rdf-surfaces examples/input/rdf-surfaces-disjunction-elimination.trig examples/rdf-surfaces-disjunction-elimination.n3
|
|
745
|
-
```
|
|
746
|
-
|
|
747
|
-
The additional examples show ordinary Horn-style RDF Surface patterns beyond the exact slide-33 abbreviations: subject typing (`rdf-surfaces-domain`), a two-hop property chain (`rdf-surfaces-property-chain`), recursive transitive closure (`rdf-surfaces-ancestor`), a conjunctive classification rule (`rdf-surfaces-multi-premise`), codex-style RDFS/OWL rule generation (`rdf-surfaces-rdfs-range-codex`, `rdf-surfaces-rdfs-subclass-codex`, `rdf-surfaces-owl-all-values-from-codex`), and RDF 1.2 inputs with named graphs and triple terms (`rdf-surfaces-rdf12-named-graph`, `rdf-surfaces-rdf12-triple-term`, `rdf-surfaces-rdf12-graph-triple-term`). More challenging examples keep the engine unchanged and add N3 helper rules on top: `rdf-surfaces-strong-negation-access` uses a top-level negative surface as a strong-negation fuse for an access policy, `rdf-surfaces-disjunction-route-filter` represents a disjunction as explicit candidate routes and filters one with a strong-negation policy, `rdf-surfaces-explicit-disjunction` puts the disjunction directly in the RDF Surface file with one outer negative surface and two inner alternatives, and `rdf-surfaces-disjunction-elimination` uses `log:forAllIn` to derive a conclusion only when every option in a disjunction implies it.
|
|
748
|
-
|
|
749
591
|
---
|
|
750
592
|
|
|
751
593
|
## RDF Message Logs
|
|
@@ -1121,7 +963,6 @@ input text / RDF-JS / AST
|
|
|
1121
963
|
│
|
|
1122
964
|
▼
|
|
1123
965
|
lib/lexer.js tokenization and RDF compatibility normalization
|
|
1124
|
-
lib/rdf_surfaces.js RDF Surfaces `%not[...%]` normalization
|
|
1125
966
|
│
|
|
1126
967
|
▼
|
|
1127
968
|
lib/parser.js N3/TriG-ish parser to internal AST
|
|
@@ -1271,7 +1112,6 @@ Package scripts are defined in `package.json`.
|
|
|
1271
1112
|
| `npm run test:package` | Verify package-level behavior. |
|
|
1272
1113
|
| `npm run test:store` | Verify memory and persistent fact-store matching. |
|
|
1273
1114
|
| `npm run test:rdf12` | Run RDF 1.2 Turtle, N-Triples, N-Quads, and TriG syntax suites. |
|
|
1274
|
-
| `npm run test:rdf-surfaces` | Run RDF Surfaces syntax and reasoning checks. |
|
|
1275
1115
|
| `npm test` | Build and run the full suite. |
|
|
1276
1116
|
|
|
1277
1117
|
### Recommended local check before committing
|
|
@@ -1307,7 +1147,6 @@ The tests exercise:
|
|
|
1307
1147
|
- RDF-JS input and output;
|
|
1308
1148
|
- custom built-ins;
|
|
1309
1149
|
- RDF 1.2 compatibility mode;
|
|
1310
|
-
- RDF Surfaces compatibility mode;
|
|
1311
1150
|
- RDF Message Log parsing and streaming;
|
|
1312
1151
|
- package exports and browser playground behavior.
|
|
1313
1152
|
|