eyeling 1.12.4 → 1.12.5

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 CHANGED
@@ -27,6 +27,7 @@
27
27
  - [Epilogue](#epilogue)
28
28
  - [Appendix A — Eyeling user notes](#app-a)
29
29
  - [Appendix B — Notation 3: when facts can carry their own logic](#app-b)
30
+ - [Appendix C — N3 beyond Prolog: logic that survives the open web](#app-c)
30
31
 
31
32
  ---
32
33
 
@@ -1948,3 +1949,22 @@ The comparison with older tools is historically instructive. Cwm (Closed World M
1948
1949
  What motivates Notation 3, in the end, is architectural restraint. It refuses to let “logic” become merely a private feature of an application stack. It keeps meaning close to the graph: rules are expressed as graph patterns; results are expressed as triples; computation is pulled in through well-defined built-ins rather than arbitrary code. This produces a style of working where integration and inference are not sidecar scripts, but publishable artifacts—documents that can be inspected, shared, tested, and reused.
1949
1950
 
1950
1951
  In that sense, N3 is less a bid to make the web “smarter” than a bid to make meaning _portable_: not only facts that travel, but also the explicit steps by which facts can be connected, extended, and made actionable—without abandoning the simplicity that made triples travel in the first place.
1952
+
1953
+ ---
1954
+
1955
+ ## Appendix C — N3 beyond Prolog: logic that survives the open web
1956
+
1957
+ At first glance, an N3 rule set can feel familiar if you’ve used Prolog: variables, unification, and rules that read like “if this pattern holds, then that pattern follows.” But N3 is not just “logic programming with a different syntax.” It is logic shaped for a different environment: not a single program with a single database, but a world of distributed graphs that can be published, merged, and cited across boundaries.
1958
+
1959
+ That change of environment forces a change in what “beyond Prolog” even means. It is less about being more powerful in the abstract, and more about being *more portable as meaning* — logic that stays connected when it moves between documents, vocabularies, and authors.
1960
+
1961
+ Several design moves push N3 into that web-native space:
1962
+
1963
+ - **Global identity is the default.** Names are IRIs. A rule does not merely compute with local symbols; it operates over identifiers meant to be shared across datasets.
1964
+ - **Graphs are the unit of exchange.** The input is a graph; the output is a graph. Inference produces new triples rather than hidden internal state, so results can travel the same way the facts do.
1965
+ - **Statements can be treated as data.** Quoted graphs let you talk *about* assertions: claims, policies, provenance, “this source says …,” “this formula implies …,” and other meta-level structure that is awkward in a plain predicate database.
1966
+ - **Rules can be publishable artifacts.** Rules can live alongside data as text, be versioned, reviewed, and reused — the “meaning” is not forced back into an external codebase.
1967
+ - **Web-like computation can be pulled into rule bodies.** Built-ins make room for the small computations that real integration needs (strings, lists, comparisons), and some N3 workflows even treat IRIs as pointers to more knowledge.
1968
+
1969
+ In that sense, Prolog is a superb engine for proving things *inside* a chosen world. N3 is a way to write rules so they keep working *across* worlds: across documents, across graph boundaries, and across the open-ended growth of linked data. When an engine like Eyeling solves rule bodies with a Prolog-like prover but still saturates forward consequences, it’s exactly this bridge: Prolog-style execution serving a web-scale, graph-first notion of meaning.
1970
+
@@ -0,0 +1,10 @@
1
+ @prefix : <http://example.org/> .
2
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
3
+
4
+ :patch1 :result {
5
+ :alice a :Person .
6
+ :bob a :Person .
7
+ :alice :age 31 .
8
+ :alice :status :ActiveStatus .
9
+ :alice :verified true .
10
+ } .
@@ -0,0 +1,55 @@
1
+ # ===================================================================
2
+ # N3 graph patch example
3
+ # - Removes every triple from :source that is also present in :delete
4
+ # - Then adds all triples from :insert
5
+ # Uses only N3 builtins from the W3C spec:
6
+ # log:collectAllIn, log:conjunction, log:notIncludes
7
+ # ===================================================================
8
+
9
+ @prefix : <http://example.org/> .
10
+ @prefix log: <http://www.w3.org/2000/10/swap/log#> .
11
+
12
+ :patch1
13
+ :source {
14
+ :alice a :Person ;
15
+ :age 30 ;
16
+ :status :OldStatus ;
17
+ :email "alice@example.org" .
18
+ :bob a :Person .
19
+ } ;
20
+ :delete {
21
+ :alice :age 30 ;
22
+ :status :OldStatus ;
23
+ :email "alice@example.org" .
24
+ } ;
25
+ :insert {
26
+ :alice :age 31 ;
27
+ :status :ActiveStatus ;
28
+ :verified true .
29
+ } .
30
+
31
+ {
32
+ :patch1 :source ?G ;
33
+ :delete ?Del ;
34
+ :insert ?Ins .
35
+
36
+ # Collect exactly the triples from ?G that are NOT included in the delete graph term ?Del
37
+ ( { ?S ?P ?O . }
38
+ {
39
+ ?S ?P ?O .
40
+ ?Del log:notIncludes { ?S ?P ?O . } .
41
+ }
42
+ ?keptTriples
43
+ ) log:collectAllIn ?G .
44
+
45
+ # Merge kept graph terms back into a single graph term
46
+ ?keptTriples log:conjunction ?keptGraph .
47
+
48
+ # Add the insert graph term
49
+ ( ?keptGraph ?Ins ) log:conjunction ?patched .
50
+ }
51
+ =>
52
+ {
53
+ :patch1 :result ?patched .
54
+ } .
55
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eyeling",
3
- "version": "1.12.4",
3
+ "version": "1.12.5",
4
4
  "description": "A minimal Notation3 (N3) reasoner in JavaScript.",
5
5
  "main": "./index.js",
6
6
  "keywords": [