eyelang 1.2.0 → 1.2.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/examples/output/web-names.pl +6 -6
- package/examples/web-names.pl +11 -11
- package/package.json +1 -1
- package/test/run-regression.mjs +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
web_uri(web(be.ugent,
|
|
2
|
-
web_uri(web(com.example,
|
|
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
3
|
web_uri(web(be.ugent, idlab), "https://data.ugent.be/id/idlab").
|
|
4
4
|
web_uri(web(be.ugent, ugent), "https://data.ugent.be/id/ugent").
|
|
5
5
|
web_uri(web(eyereasoner.github, eyelang), "https://github.com/eyereasoner/eyelang").
|
|
6
6
|
web_uri(web(org.schema, maintainer), "https://schema.org/maintainer").
|
|
7
|
-
affiliated_with(web(be.ugent,
|
|
8
|
-
affiliated_with(web(be.ugent,
|
|
9
|
-
project_contact(web(eyereasoner.github, eyelang), web(be.ugent,
|
|
10
|
-
same_local_name(web(be.ugent,
|
|
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).
|
package/examples/web-names.pl
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
% Compact web-style
|
|
1
|
+
% Compact web-style terms without full URIs or global prefix tables.
|
|
2
2
|
%
|
|
3
3
|
% RDF-style URIs are globally meaningful but long, while QNames such as
|
|
4
4
|
% schema:Person depend on an external prefix declaration. This example uses an
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
% is the local name inside that space.
|
|
8
8
|
%
|
|
9
9
|
% The important property is that the complete term is self-contained. The local
|
|
10
|
-
% name
|
|
11
|
-
% web(com.example,
|
|
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
12
|
% prefix context and no accidental collision. Tooling can still expand selected
|
|
13
13
|
% web/2 terms to full URI strings when a base is known.
|
|
14
14
|
|
|
@@ -24,22 +24,22 @@ space_base(eyereasoner.github, "https://github.com/eyereasoner/").
|
|
|
24
24
|
space_base(org.schema, "https://schema.org/").
|
|
25
25
|
|
|
26
26
|
% A tiny graph using globally scoped web names as ordinary eyelang terms.
|
|
27
|
-
triple(web(be.ugent,
|
|
28
|
-
triple(web(be.ugent,
|
|
29
|
-
triple(web(be.ugent,
|
|
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
30
|
triple(web(be.ugent, idlab), web(org.schema, parentOrganization), web(be.ugent, ugent)).
|
|
31
31
|
|
|
32
32
|
triple(web(eyereasoner.github, eyelang), web(org.schema, name), "eyelang").
|
|
33
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,
|
|
34
|
+
triple(web(eyereasoner.github, eyelang), web(org.schema, maintainer), web(be.ugent, josd)).
|
|
35
35
|
|
|
36
36
|
% Same local spelling, different global identity.
|
|
37
|
-
triple(web(com.example,
|
|
37
|
+
triple(web(com.example, josd), web(org.schema, name), "Another JosD in another space").
|
|
38
38
|
|
|
39
39
|
% Keep URI expansion explicit and optional: reasoning uses web/2 terms, while
|
|
40
40
|
% web_uri/2 is only a presentation bridge for selected names.
|
|
41
|
-
published_name(web(be.ugent,
|
|
42
|
-
published_name(web(com.example,
|
|
41
|
+
published_name(web(be.ugent, josd)).
|
|
42
|
+
published_name(web(com.example, josd)).
|
|
43
43
|
published_name(web(be.ugent, idlab)).
|
|
44
44
|
published_name(web(be.ugent, ugent)).
|
|
45
45
|
published_name(web(eyereasoner.github, eyelang)).
|
|
@@ -66,7 +66,7 @@ affiliated_with(Person, Org) :-
|
|
|
66
66
|
|
|
67
67
|
% A project contact is derived by joining the project's maintainer with the
|
|
68
68
|
% maintainer's email. The join works because both facts use the same complete
|
|
69
|
-
% web(be.ugent,
|
|
69
|
+
% web(be.ugent, josd) term.
|
|
70
70
|
project_contact(Project, Person, Email) :-
|
|
71
71
|
triple(Project, web(org.schema, maintainer), Person),
|
|
72
72
|
triple(Person, web(org.schema, email), Email).
|
package/package.json
CHANGED
package/test/run-regression.mjs
CHANGED
|
@@ -477,10 +477,10 @@ function whiteBoxCases() {
|
|
|
477
477
|
},
|
|
478
478
|
},
|
|
479
479
|
{
|
|
480
|
-
name: 'parser preserves dotted atom constants for web-style
|
|
480
|
+
name: 'parser preserves dotted atom constants for web-style terms',
|
|
481
481
|
run: () => {
|
|
482
|
-
const clauses = parseProgramText('p(web(be.ugent,
|
|
483
|
-
assertEqual(termToString(clauses[0].head, new Env(), true), 'p(web(be.ugent,
|
|
482
|
+
const clauses = parseProgramText('p(web(be.ugent, josd), org.schema).\n');
|
|
483
|
+
assertEqual(termToString(clauses[0].head, new Env(), true), 'p(web(be.ugent, josd), org.schema)', 'head');
|
|
484
484
|
},
|
|
485
485
|
},
|
|
486
486
|
{
|