eyeling 1.30.5 → 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.
Files changed (60) hide show
  1. package/README.md +0 -157
  2. package/dist/browser/eyeling.browser.js +13 -561
  3. package/eyeling.js +13 -561
  4. package/index.d.ts +0 -4
  5. package/index.js +1 -2
  6. package/lib/cli.js +4 -11
  7. package/lib/engine.js +6 -14
  8. package/lib/lexer.js +0 -4
  9. package/lib/multisource.js +3 -5
  10. package/package.json +3 -6
  11. package/test/examples.test.js +5 -37
  12. package/test/playground.test.js +1 -1
  13. package/test/run.js +60 -0
  14. package/examples/input/rdf-surfaces-all-values-from-reverse.ttl +0 -17
  15. package/examples/input/rdf-surfaces-all-values-from.ttl +0 -13
  16. package/examples/input/rdf-surfaces-ancestor.ttl +0 -20
  17. package/examples/input/rdf-surfaces-city.ttl +0 -11
  18. package/examples/input/rdf-surfaces-disjunction-elimination.ttl +0 -16
  19. package/examples/input/rdf-surfaces-disjunction-route-filter.ttl +0 -11
  20. package/examples/input/rdf-surfaces-domain.ttl +0 -11
  21. package/examples/input/rdf-surfaces-explicit-disjunction.ttl +0 -22
  22. package/examples/input/rdf-surfaces-multi-premise.ttl +0 -13
  23. package/examples/input/rdf-surfaces-owl-all-values-from-codex.ttl +0 -35
  24. package/examples/input/rdf-surfaces-property-chain.ttl +0 -13
  25. package/examples/input/rdf-surfaces-range.ttl +0 -11
  26. package/examples/input/rdf-surfaces-rdfs-range-codex.ttl +0 -18
  27. package/examples/input/rdf-surfaces-rdfs-subclass-codex.ttl +0 -18
  28. package/examples/input/rdf-surfaces-strong-negation-access.ttl +0 -14
  29. package/examples/output/rdf-surfaces-all-values-from-reverse.n3 +0 -3
  30. package/examples/output/rdf-surfaces-all-values-from.n3 +0 -3
  31. package/examples/output/rdf-surfaces-ancestor.n3 +0 -5
  32. package/examples/output/rdf-surfaces-city.n3 +0 -3
  33. package/examples/output/rdf-surfaces-disjunction-elimination.n3 +0 -3
  34. package/examples/output/rdf-surfaces-disjunction-route-filter.n3 +0 -3
  35. package/examples/output/rdf-surfaces-domain.n3 +0 -3
  36. package/examples/output/rdf-surfaces-explicit-disjunction.n3 +0 -3
  37. package/examples/output/rdf-surfaces-multi-premise.n3 +0 -3
  38. package/examples/output/rdf-surfaces-owl-all-values-from-codex.n3 +0 -6
  39. package/examples/output/rdf-surfaces-property-chain.n3 +0 -3
  40. package/examples/output/rdf-surfaces-range.n3 +0 -3
  41. package/examples/output/rdf-surfaces-rdfs-range-codex.n3 +0 -3
  42. package/examples/output/rdf-surfaces-rdfs-subclass-codex.n3 +0 -3
  43. package/examples/output/rdf-surfaces-strong-negation-access.n3 +0 -4
  44. package/examples/rdf-surfaces-all-values-from-reverse.n3 +0 -6
  45. package/examples/rdf-surfaces-all-values-from.n3 +0 -6
  46. package/examples/rdf-surfaces-ancestor.n3 +0 -6
  47. package/examples/rdf-surfaces-city.n3 +0 -6
  48. package/examples/rdf-surfaces-disjunction-elimination.n3 +0 -13
  49. package/examples/rdf-surfaces-disjunction-route-filter.n3 +0 -24
  50. package/examples/rdf-surfaces-domain.n3 +0 -6
  51. package/examples/rdf-surfaces-explicit-disjunction.n3 +0 -16
  52. package/examples/rdf-surfaces-multi-premise.n3 +0 -6
  53. package/examples/rdf-surfaces-owl-all-values-from-codex.n3 +0 -10
  54. package/examples/rdf-surfaces-property-chain.n3 +0 -6
  55. package/examples/rdf-surfaces-range.n3 +0 -6
  56. package/examples/rdf-surfaces-rdfs-range-codex.n3 +0 -6
  57. package/examples/rdf-surfaces-rdfs-subclass-codex.n3 +0 -6
  58. package/examples/rdf-surfaces-strong-negation-access.n3 +0 -20
  59. package/lib/rdf_surfaces.js +0 -524
  60. package/test/rdf_surfaces.test.js +0 -214
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,157 +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 this is Turtle plus the surface extension, the examples use `.ttl` for RDF Surface input files.
597
-
598
- The examples keep RDF Surface input separate from Eyeling queries:
599
-
600
- - `examples/input/<name>.ttl` contains ordinary RDF triples and RDF Surface rules.
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
- ```turtle
606
- @prefix ex: <http://example.org/> .
607
-
608
- ex:Brussels a ex:City .
609
-
610
- %not[ _:x
611
- _:x a ex:City .
612
- %not[
613
- _:x a ex:HumanCommunity .
614
- %]
615
- %]
616
- ```
617
-
618
- The slide-32 shape above is normalized as:
619
-
620
- ```n3
621
- { ?x a ex:City . }
622
- =>
623
- { ?x a ex:HumanCommunity . } .
624
- ```
625
-
626
- The first slide-33 abbreviation, range, is written as:
627
-
628
- ```turtle
629
- %not[ _:x _:y
630
- _:x ex:parent _:y .
631
- %not[
632
- _:y a ex:Person .
633
- %]
634
- %]
635
- ```
636
-
637
- and behaves like:
638
-
639
- ```n3
640
- { ?x ex:parent ?y . }
641
- =>
642
- { ?y a ex:Person . } .
643
- ```
644
-
645
- Eyeling also recognizes codex-style surfaces that introduce rules from RDF/OWL vocabulary facts. For example, this `rdfs:range` codex:
646
-
647
- ```turtle
648
- @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
649
-
650
- %not[ _:p _:c
651
- _:p rdfs:range _:c .
652
- %not[
653
- %not[ _:s _:o
654
- _:s _:p _:o .
655
- %not[
656
- _:o a _:c .
657
- %]
658
- %]
659
- %]
660
- %]
661
- ```
662
-
663
- is normalized to the Horn rule shape:
664
-
665
- ```n3
666
- {
667
- ?p rdfs:range ?c .
668
- ?s ?p ?o .
669
- }
670
- =>
671
- { ?o a ?c . } .
672
- ```
673
-
674
- The slide-33 `owl:allValuesFrom` codex is supported in both directions:
675
-
676
- ```turtle
677
- @prefix owl: <http://www.w3.org/2002/07/owl#> .
678
-
679
- %not[ _:a _:b _:c
680
- _:a owl:onProperty _:b .
681
- _:a owl:allValuesFrom _:c .
682
- %not[
683
- %not[ _:x _:y
684
- _:x a _:a .
685
- _:x _:b _:y .
686
- %not[
687
- _:y a _:c .
688
- %]
689
- %]
690
- %not[ _:x
691
- %not[ _:y
692
- _:x _:b _:y .
693
- %not[
694
- _:y a _:c .
695
- %]
696
- %]
697
- %not[
698
- _:x a _:a .
699
- %]
700
- %]
701
- %]
702
- %]
703
- ```
704
-
705
- 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.
706
-
707
- A top-level negative surface without a nested negative child is treated as an inference fuse:
708
-
709
- ```turtle
710
- %not[ _:x
711
- _:x a ex:Impossible .
712
- %]
713
- ```
714
-
715
- which behaves like:
716
-
717
- ```n3
718
- { ?x a ex:Impossible . } => false .
719
- ```
720
-
721
- 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.
722
-
723
- Run the included examples:
724
-
725
- ```bash
726
- eyeling --rdf-surfaces examples/input/rdf-surfaces-city.ttl examples/rdf-surfaces-city.n3
727
- eyeling --rdf-surfaces examples/input/rdf-surfaces-range.ttl examples/rdf-surfaces-range.n3
728
- eyeling --rdf-surfaces examples/input/rdf-surfaces-domain.ttl examples/rdf-surfaces-domain.n3
729
- eyeling --rdf-surfaces examples/input/rdf-surfaces-property-chain.ttl examples/rdf-surfaces-property-chain.n3
730
- eyeling --rdf-surfaces examples/input/rdf-surfaces-ancestor.ttl examples/rdf-surfaces-ancestor.n3
731
- eyeling --rdf-surfaces examples/input/rdf-surfaces-multi-premise.ttl examples/rdf-surfaces-multi-premise.n3
732
- eyeling --rdf-surfaces examples/input/rdf-surfaces-all-values-from.ttl examples/rdf-surfaces-all-values-from.n3
733
- eyeling --rdf-surfaces examples/input/rdf-surfaces-all-values-from-reverse.ttl examples/rdf-surfaces-all-values-from-reverse.n3
734
- eyeling --rdf-surfaces examples/input/rdf-surfaces-rdfs-range-codex.ttl examples/rdf-surfaces-rdfs-range-codex.n3
735
- eyeling --rdf-surfaces examples/input/rdf-surfaces-rdfs-subclass-codex.ttl examples/rdf-surfaces-rdfs-subclass-codex.n3
736
- eyeling --rdf-surfaces examples/input/rdf-surfaces-owl-all-values-from-codex.ttl examples/rdf-surfaces-owl-all-values-from-codex.n3
737
- eyeling --rdf-surfaces examples/input/rdf-surfaces-strong-negation-access.ttl examples/rdf-surfaces-strong-negation-access.n3
738
- eyeling --rdf-surfaces examples/input/rdf-surfaces-disjunction-route-filter.ttl examples/rdf-surfaces-disjunction-route-filter.n3
739
- eyeling --rdf-surfaces examples/input/rdf-surfaces-explicit-disjunction.ttl examples/rdf-surfaces-explicit-disjunction.n3
740
- eyeling --rdf-surfaces examples/input/rdf-surfaces-disjunction-elimination.ttl examples/rdf-surfaces-disjunction-elimination.n3
741
- ```
742
-
743
- 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`), and codex-style RDFS/OWL rule generation (`rdf-surfaces-rdfs-range-codex`, `rdf-surfaces-rdfs-subclass-codex`, `rdf-surfaces-owl-all-values-from-codex`). 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.
744
-
745
591
  ---
746
592
 
747
593
  ## RDF Message Logs
@@ -1117,7 +963,6 @@ input text / RDF-JS / AST
1117
963
 
1118
964
 
1119
965
  lib/lexer.js tokenization and RDF compatibility normalization
1120
- lib/rdf_surfaces.js RDF Surfaces `%not[...%]` normalization
1121
966
 
1122
967
 
1123
968
  lib/parser.js N3/TriG-ish parser to internal AST
@@ -1267,7 +1112,6 @@ Package scripts are defined in `package.json`.
1267
1112
  | `npm run test:package` | Verify package-level behavior. |
1268
1113
  | `npm run test:store` | Verify memory and persistent fact-store matching. |
1269
1114
  | `npm run test:rdf12` | Run RDF 1.2 Turtle, N-Triples, N-Quads, and TriG syntax suites. |
1270
- | `npm run test:rdf-surfaces` | Run RDF Surfaces syntax and reasoning checks. |
1271
1115
  | `npm test` | Build and run the full suite. |
1272
1116
 
1273
1117
  ### Recommended local check before committing
@@ -1303,7 +1147,6 @@ The tests exercise:
1303
1147
  - RDF-JS input and output;
1304
1148
  - custom built-ins;
1305
1149
  - RDF 1.2 compatibility mode;
1306
- - RDF Surfaces compatibility mode;
1307
1150
  - RDF Message Log parsing and streaming;
1308
1151
  - package exports and browser playground behavior.
1309
1152