eyelang 1.7.0 → 1.7.1

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/docs/guide.md CHANGED
@@ -458,7 +458,7 @@ Use `holds/2` when you want to match the member term directly, for example `name
458
458
  | [`turing.eye`](../examples/turing.eye) | Simulates a binary-increment Turing machine. | [`output/turing.eye`](../examples/output/turing.eye) |
459
459
  | [`vector-similarity.eye`](../examples/vector-similarity.eye) | Computes dot product, norm, and cosine similarity. | [`output/vector-similarity.eye`](../examples/output/vector-similarity.eye) |
460
460
  | [`vulnerability-impact.eye`](../examples/vulnerability-impact.eye) | Analyzes vulnerable transitive dependencies and urgent patch impact. | [`output/vulnerability-impact.eye`](../examples/output/vulnerability-impact.eye) |
461
- | [`web-names.eye`](../examples/web-names.eye) | Uses compact Prolog-like `web(?space, ?local)` terms as readable global identifiers and expands selected terms to URIs. | [`output/web-names.eye`](../examples/output/web-names.eye) |
461
+ | [`web-names.eye`](../examples/web-names.eye) | Uses angle-bracket IRI atoms as first-class web names and joins them across a tiny graph. | [`output/web-names.eye`](../examples/output/web-names.eye) |
462
462
  | [`weighted-interval-scheduling.eye`](../examples/weighted-interval-scheduling.eye) | Selects the best non-overlapping weighted intervals with tabled dynamic programming. | [`output/weighted-interval-scheduling.eye`](../examples/output/weighted-interval-scheduling.eye) |
463
463
  | [`witch.eye`](../examples/witch.eye) | Derives the classic “burn the witch” rule chain. | [`output/witch.eye`](../examples/output/witch.eye) |
464
464
  | [`wolf-goat-cabbage.eye`](../examples/wolf-goat-cabbage.eye) | Solves the wolf-goat-cabbage river crossing. | [`output/wolf-goat-cabbage.eye`](../examples/output/wolf-goat-cabbage.eye) |
@@ -1,10 +1,3 @@
1
- web_uri(web('be.ugent', josd), "https://data.ugent.be/id/josd").
2
- web_uri(web('com.example', josd), "https://example.com/id/josd").
3
- web_uri(web('be.ugent', idlab), "https://data.ugent.be/id/idlab").
4
- web_uri(web('be.ugent', ugent), "https://data.ugent.be/id/ugent").
5
- web_uri(web('eyereasoner.github', eyelang), "https://github.com/eyereasoner/eyelang").
6
- web_uri(web('org.schema', maintainer), "https://schema.org/maintainer").
7
- affiliated_with(web('be.ugent', josd), web('be.ugent', idlab)).
8
- affiliated_with(web('be.ugent', josd), web('be.ugent', ugent)).
9
- project_contact(web('eyereasoner.github', eyelang), web('be.ugent', josd), "josderoo@gmail.com").
10
- same_local_name(web('be.ugent', josd), web('com.example', josd), josd).
1
+ affiliated_with(<https://data.ugent.be/id/josd>, <https://data.ugent.be/id/idlab>).
2
+ affiliated_with(<https://data.ugent.be/id/josd>, <https://data.ugent.be/id/ugent>).
3
+ project_contact(<https://github.com/eyereasoner/eyelang>, <https://data.ugent.be/id/josd>, "josderoo@gmail.com").
@@ -1,83 +1,39 @@
1
- % Compact web-style terms without full URIs or global prefix tables.
1
+ % Web names as first-class Eyelang atoms.
2
2
  %
3
- % RDF-style URIs are globally meaningful but long, while QNames such as
4
- % schema:Person depend on an external prefix declaration. This example uses an
5
- % eyelang-native alternative: web(Space, Local). The first argument is an
6
- % ISO-compatible quoted atom naming a vocabulary, organization, or authority;
7
- % the second argument is the local name inside that space.
8
- %
9
- % The important property is that the complete term is self-contained. The local
10
- % name josd can safely occur in two spaces: web('be.ugent', josd) and
11
- % web('com.example', josd) are different Herbrand terms, so there is no hidden
12
- % prefix context and no accidental collision. Tooling can still expand selected
13
- % web/2 terms to full URI strings when a base is known.
3
+ % Angle-bracket IRI atoms are ordinary atoms with globally meaningful names.
4
+ % They are self-contained, require no prefix declarations, and can be joined
5
+ % directly across rules just like any other atom.
14
6
 
15
- materialize(web_uri, 2).
16
7
  materialize(affiliated_with, 2).
17
8
  materialize(project_contact, 3).
18
- materialize(same_local_name, 3).
19
-
20
- % Optional URI bases for spaces that we want to publish or display.
21
- space_base('be.ugent', "https://data.ugent.be/id/").
22
- space_base('com.example', "https://example.com/id/").
23
- space_base('eyereasoner.github', "https://github.com/eyereasoner/").
24
- space_base('org.schema', "https://schema.org/").
25
-
26
- % A tiny graph using globally scoped web terms as ordinary eyelang terms.
27
- triple(web('be.ugent', josd), web('org.schema', name), "Jos De Roo").
28
- triple(web('be.ugent', josd), web('org.schema', email), "josderoo@gmail.com").
29
- triple(web('be.ugent', josd), web('org.schema', affiliation), web('be.ugent', idlab)).
30
- triple(web('be.ugent', idlab), web('org.schema', parentOrganization), web('be.ugent', ugent)).
31
9
 
32
- triple(web('eyereasoner.github', eyelang), web('org.schema', name), "eyelang").
33
- triple(web('eyereasoner.github', eyelang), web('org.schema', codeRepository), "https://github.com/eyereasoner/eyelang").
34
- triple(web('eyereasoner.github', eyelang), web('org.schema', maintainer), web('be.ugent', josd)).
10
+ table(parent_organization, 2).
35
11
 
36
- % Same local spelling, different global identity.
37
- triple(web('com.example', josd), web('org.schema', name), "Another JosD in another space").
12
+ % A tiny graph using absolute IRI atoms directly.
13
+ triple(<https://data.ugent.be/id/josd>, <https://schema.org/name>, "Jos De Roo").
14
+ triple(<https://data.ugent.be/id/josd>, <https://schema.org/email>, "josderoo@gmail.com").
15
+ triple(<https://data.ugent.be/id/josd>, <https://schema.org/affiliation>, <https://data.ugent.be/id/idlab>).
16
+ triple(<https://data.ugent.be/id/idlab>, <https://schema.org/parentOrganization>, <https://data.ugent.be/id/ugent>).
38
17
 
39
- % Keep URI expansion explicit and optional: reasoning uses web/2 terms, while
40
- % web_uri/2 is only a presentation bridge for selected names.
41
- published_name(web('be.ugent', josd)).
42
- published_name(web('com.example', josd)).
43
- published_name(web('be.ugent', idlab)).
44
- published_name(web('be.ugent', ugent)).
45
- published_name(web('eyereasoner.github', eyelang)).
46
- published_name(web('org.schema', maintainer)).
47
-
48
- web_uri(web(?space, ?local), ?uri) :-
49
- published_name(web(?space, ?local)),
50
- space_base(?space, ?base),
51
- atom_string(?local, ?localtext),
52
- str_concat(?base, ?localtext, ?uri).
18
+ triple(<https://github.com/eyereasoner/eyelang>, <https://schema.org/name>, "eyelang").
19
+ triple(<https://github.com/eyereasoner/eyelang>, <https://schema.org/codeRepository>, <https://github.com/eyereasoner/eyelang>).
20
+ triple(<https://github.com/eyereasoner/eyelang>, <https://schema.org/maintainer>, <https://data.ugent.be/id/josd>).
53
21
 
54
22
  % Organization membership follows parentOrganization links transitively.
55
23
  parent_organization(?unit, ?org) :-
56
- triple(?unit, web('org.schema', parentOrganization), ?org).
24
+ triple(?unit, <https://schema.org/parentOrganization>, ?org).
57
25
  parent_organization(?unit, ?org) :-
58
- triple(?unit, web('org.schema', parentOrganization), ?mid),
26
+ triple(?unit, <https://schema.org/parentOrganization>, ?mid),
59
27
  parent_organization(?mid, ?org).
60
28
 
61
29
  affiliated_with(?person, ?org) :-
62
- triple(?person, web('org.schema', affiliation), ?org).
30
+ triple(?person, <https://schema.org/affiliation>, ?org).
63
31
  affiliated_with(?person, ?org) :-
64
- triple(?person, web('org.schema', affiliation), ?unit),
32
+ triple(?person, <https://schema.org/affiliation>, ?unit),
65
33
  parent_organization(?unit, ?org).
66
34
 
67
35
  % A project contact is derived by joining the project's maintainer with the
68
- % maintainer's email. The join works because both facts use the same complete
69
- % web('be.ugent', josd) term.
36
+ % maintainer's email. The join works because both facts use the same IRI atom.
70
37
  project_contact(?project, ?person, ?email) :-
71
- triple(?project, web('org.schema', maintainer), ?person),
72
- triple(?person, web('org.schema', email), ?email).
73
-
74
- % Demonstrate that local names are not global names. This reports the deliberate
75
- % local-name collision without treating the two people as equal.
76
- local_name(?entity, ?local) :-
77
- triple(?entity, web('org.schema', name), ?_),
78
- eq(?entity, web(?_, ?local)).
79
-
80
- same_local_name(?a, ?b, ?local) :-
81
- local_name(?a, ?local),
82
- local_name(?b, ?local),
83
- lt(?a, ?b).
38
+ triple(?project, <https://schema.org/maintainer>, ?person),
39
+ triple(?person, <https://schema.org/email>, ?email).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eyelang",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "A small Prolog-like logic programming language for rules, goals, answers, and proofs.",
5
5
  "type": "module",
6
6
  "main": "./index.js",