eyeprolog 0.5.8 → 0.5.9
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 +2 -2
- package/examples/dpv-odrl-purpose-mapping.pl +29 -31
- package/examples/goldbach.pl +3 -2
- package/examples/input/dpv-odrl-purpose-mapping-rules.pl +4 -6
- package/examples/input/odrl-dpv-fpv-trust-flow-rules.pl +5 -8
- package/examples/input/odrl-dpv-healthcare-risk-ranked-rules.pl +7 -12
- package/examples/input/odrl-dpv-risk-ranked-rules.pl +7 -12
- package/examples/input/odrl-policy-advanced-rules.pl +26 -26
- package/examples/input/odrl-policy-rules.pl +13 -13
- package/examples/input/rdf12-annotated-claims-rules.pl +6 -6
- package/examples/input/rdf12-annotation-rules.pl +3 -3
- package/examples/input/rdf12-directional-language-rules.pl +4 -2
- package/examples/input/rdf12-nested-triple-term-rules.pl +5 -4
- package/examples/input/rdf12-trig-graph-join-rules.pl +6 -5
- package/examples/input/rdf12-trig-named-graph-rules.pl +6 -5
- package/examples/input/rdf12-trig-triple-term-rules.pl +4 -3
- package/examples/input/rdf12-triple-term-rules.pl +4 -3
- package/examples/odrl-dpv-fpv-trust-flow.pl +34 -37
- package/examples/odrl-dpv-healthcare-risk-ranked.pl +42 -47
- package/examples/odrl-dpv-risk-ranked.pl +54 -59
- package/examples/odrl-policy-advanced-from-turtle.pl +44 -44
- package/examples/odrl-policy-from-turtle.pl +20 -20
- package/examples/output/goldbach.pl +0 -10
- package/examples/output/rdf12-annotation.pl +1 -1
- package/examples/output/rdf12-directional-language.pl +2 -2
- package/examples/output/rdf12-nested-triple-term.pl +1 -1
- package/examples/output/rdf12-trig-graph-join.pl +1 -1
- package/examples/output/rdf12-trig-named-graph.pl +3 -3
- package/examples/output/rdf12-trig-triple-term.pl +1 -1
- package/examples/output/rdf12-triple-term.pl +1 -1
- package/examples/proof/odrl-policy-from-turtle.pl +8 -8
- package/examples/proof/rdf12-annotation.pl +8 -8
- package/examples/proof/rdf12-directional-language.pl +10 -10
- package/examples/proof/rdf12-nested-triple-term.pl +5 -5
- package/examples/proof/rdf12-trig-graph-join.pl +6 -6
- package/examples/proof/rdf12-trig-named-graph.pl +16 -16
- package/examples/proof/rdf12-trig-triple-term.pl +5 -5
- package/examples/proof/rdf12-triple-term.pl +5 -5
- package/examples/rdf12-annotated-claims.pl +16 -16
- package/examples/rdf12-annotation.pl +7 -7
- package/examples/rdf12-directional-language.pl +7 -6
- package/examples/rdf12-nested-triple-term.pl +7 -7
- package/examples/rdf12-trig-graph-join.pl +9 -9
- package/examples/rdf12-trig-named-graph.pl +9 -9
- package/examples/rdf12-trig-triple-term.pl +6 -6
- package/examples/rdf12-triple-term.pl +6 -6
- package/examples/sieve.pl +2 -2
- package/package.json +1 -1
- package/src/eyeprolog-library.pl +5 -0
- package/src/library.js +0 -57
- package/test/run-rdf-tools.mjs +1 -1
- package/test/run-regression.mjs +4 -2
- package/the-art-of-eyeprolog.md +11 -15
- package/tools/rdf-codec.mjs +1 -1
package/README.md
CHANGED
|
@@ -35,8 +35,8 @@ Programs may declare their default queries with `%% goal:` comments.
|
|
|
35
35
|
EyeProlog adds 50 public library predicates to its 115-predicate ISO profile.
|
|
36
36
|
**48 of the 50 are ordinary Prolog clauses** in `src/eyeprolog-library.pl` and
|
|
37
37
|
are autoloaded in Node and the browser. Only `uuid/1` and `local_time/1` require
|
|
38
|
-
host support. Portable text predicates use ISO atoms or character lists;
|
|
39
|
-
|
|
38
|
+
host support. Portable text predicates use ISO atoms or character lists; the
|
|
39
|
+
RDF tools emit lexical values as ISO atoms as well.
|
|
40
40
|
|
|
41
41
|
## RDF 1.2
|
|
42
42
|
|
|
@@ -2,31 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
% Run with: eyeprolog --goal 'rdf(S, P, O, G)' program.pl.
|
|
4
4
|
|
|
5
|
-
rdf(iri(
|
|
6
|
-
rdf(iri(
|
|
7
|
-
rdf(iri(
|
|
8
|
-
rdf(iri(
|
|
9
|
-
rdf(iri(
|
|
10
|
-
rdf(iri(
|
|
11
|
-
rdf(iri(
|
|
12
|
-
rdf(iri(
|
|
13
|
-
rdf(iri(
|
|
14
|
-
rdf(iri(
|
|
15
|
-
rdf(iri(
|
|
16
|
-
rdf(iri(
|
|
17
|
-
rdf(iri(
|
|
18
|
-
rdf(iri(
|
|
19
|
-
rdf(iri(
|
|
20
|
-
rdf(iri(
|
|
21
|
-
rdf(iri(
|
|
22
|
-
rdf(iri(
|
|
23
|
-
rdf(iri(
|
|
24
|
-
rdf(iri(
|
|
25
|
-
rdf(iri(
|
|
26
|
-
rdf(iri(
|
|
27
|
-
rdf(iri(
|
|
28
|
-
rdf(iri(
|
|
29
|
-
rdf(iri(
|
|
5
|
+
rdf(iri('https://example.org/alpha_care_process'), iri('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), iri('https://w3id.org/dpv#Process'), default_graph).
|
|
6
|
+
rdf(iri('https://example.org/alpha_care_process'), iri('https://w3id.org/dpv#hasDataController'), iri('https://example.org/hospital_a'), default_graph).
|
|
7
|
+
rdf(iri('https://example.org/alpha_care_process'), iri('https://w3id.org/dpv#hasRecipient'), iri('https://example.org/research_partner'), default_graph).
|
|
8
|
+
rdf(iri('https://example.org/alpha_care_process'), iri('https://w3id.org/dpv#hasPersonalData'), iri('https://example.org/lab_result'), default_graph).
|
|
9
|
+
rdf(iri('https://example.org/alpha_care_process'), iri('https://w3id.org/dpv#hasProcessing'), iri('https://w3id.org/dpv#Use'), default_graph).
|
|
10
|
+
rdf(iri('https://example.org/alpha_care_process'), iri('https://w3id.org/dpv#hasPurpose'), iri('https://w3id.org/dpv#Healthcare'), default_graph).
|
|
11
|
+
rdf(iri('https://example.org/alpha_care_process'), iri('https://w3id.org/dpv#hasLegalBasis'), iri('https://w3id.org/dpv#Consent'), default_graph).
|
|
12
|
+
rdf(iri('https://example.org/alpha_policy'), iri('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), iri('http://www.w3.org/ns/odrl/2/Policy'), default_graph).
|
|
13
|
+
rdf(iri('https://example.org/alpha_policy'), iri('https://example.org/representsProcess'), iri('https://example.org/alpha_care_process'), default_graph).
|
|
14
|
+
rdf(iri('https://example.org/alpha_policy'), iri('http://www.w3.org/ns/odrl/2/permission'), iri('https://example.org/alpha_permission'), default_graph).
|
|
15
|
+
rdf(iri('https://example.org/alpha_permission'), iri('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), iri('http://www.w3.org/ns/odrl/2/Permission'), default_graph).
|
|
16
|
+
rdf(iri('https://example.org/alpha_permission'), iri('http://www.w3.org/ns/odrl/2/assigner'), iri('https://example.org/hospital_a'), default_graph).
|
|
17
|
+
rdf(iri('https://example.org/alpha_permission'), iri('http://www.w3.org/ns/odrl/2/assignee'), iri('https://example.org/research_partner'), default_graph).
|
|
18
|
+
rdf(iri('https://example.org/alpha_permission'), iri('http://www.w3.org/ns/odrl/2/target'), iri('https://example.org/lab_result'), default_graph).
|
|
19
|
+
rdf(iri('https://example.org/alpha_permission'), iri('http://www.w3.org/ns/odrl/2/action'), iri('http://www.w3.org/ns/odrl/2/use'), default_graph).
|
|
20
|
+
rdf(iri('https://example.org/alpha_permission'), iri('http://www.w3.org/ns/odrl/2/constraint'), iri('https://example.org/alpha_purpose_constraint'), default_graph).
|
|
21
|
+
rdf(iri('https://example.org/alpha_permission'), iri('http://www.w3.org/ns/odrl/2/constraint'), iri('https://example.org/alpha_basis_constraint'), default_graph).
|
|
22
|
+
rdf(iri('https://example.org/alpha_purpose_constraint'), iri('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), iri('http://www.w3.org/ns/odrl/2/Constraint'), default_graph).
|
|
23
|
+
rdf(iri('https://example.org/alpha_purpose_constraint'), iri('http://www.w3.org/ns/odrl/2/leftOperand'), iri('http://www.w3.org/ns/odrl/2/purpose'), default_graph).
|
|
24
|
+
rdf(iri('https://example.org/alpha_purpose_constraint'), iri('http://www.w3.org/ns/odrl/2/operator'), iri('http://www.w3.org/ns/odrl/2/isA'), default_graph).
|
|
25
|
+
rdf(iri('https://example.org/alpha_purpose_constraint'), iri('http://www.w3.org/ns/odrl/2/rightOperand'), iri('https://w3id.org/dpv#Healthcare'), default_graph).
|
|
26
|
+
rdf(iri('https://example.org/alpha_basis_constraint'), iri('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), iri('http://www.w3.org/ns/odrl/2/Constraint'), default_graph).
|
|
27
|
+
rdf(iri('https://example.org/alpha_basis_constraint'), iri('http://www.w3.org/ns/odrl/2/leftOperand'), iri('https://example.org/legalBasis'), default_graph).
|
|
28
|
+
rdf(iri('https://example.org/alpha_basis_constraint'), iri('http://www.w3.org/ns/odrl/2/operator'), iri('http://www.w3.org/ns/odrl/2/isA'), default_graph).
|
|
29
|
+
rdf(iri('https://example.org/alpha_basis_constraint'), iri('http://www.w3.org/ns/odrl/2/rightOperand'), iri('https://w3id.org/dpv#Consent'), default_graph).
|
|
30
30
|
|
|
31
31
|
% Rules
|
|
32
32
|
% Source data: examples/input/dpv-odrl-purpose-mapping.ttl
|
|
@@ -84,13 +84,11 @@ iri_term(ex(Name), Iri) :- namespace_iri('https://example.org/', Name, Iri).
|
|
|
84
84
|
iri_term(dpv(Name), Iri) :- namespace_iri('https://w3id.org/dpv#', Name, Iri).
|
|
85
85
|
iri_term(odrl(Name), Iri) :- namespace_iri('http://www.w3.org/ns/odrl/2/', Name, Iri).
|
|
86
86
|
|
|
87
|
-
namespace_iri(Prefix, Name,
|
|
87
|
+
namespace_iri(Prefix, Name, Iri) :-
|
|
88
88
|
atom(Name),
|
|
89
89
|
!,
|
|
90
90
|
atom_string(Name, Local),
|
|
91
|
-
string_concat(Prefix, Local,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
eyeprolog__string_atom(IriString, IriAtom),
|
|
95
|
-
string_concat(Prefix, Local, IriAtom),
|
|
91
|
+
string_concat(Prefix, Local, Iri).
|
|
92
|
+
namespace_iri(Prefix, Name, Iri) :-
|
|
93
|
+
string_concat(Prefix, Local, Iri),
|
|
96
94
|
atom_string(Name, Local).
|
package/examples/goldbach.pl
CHANGED
|
@@ -42,8 +42,9 @@ has_factor(N, L) :-
|
|
|
42
42
|
|
|
43
43
|
% query
|
|
44
44
|
case(N, G) :-
|
|
45
|
-
|
|
45
|
+
% Keep the portable benchmark below the range where repeated interpreted
|
|
46
|
+
% Miller-Rabin searches dominate the example suite.
|
|
47
|
+
between(2, 25, I),
|
|
46
48
|
N is 2^I,
|
|
47
49
|
goldbach(N, G).
|
|
48
50
|
%% goal: case(_, _)
|
|
49
|
-
|
|
@@ -53,13 +53,11 @@ iri_term(ex(Name), Iri) :- namespace_iri('https://example.org/', Name, Iri).
|
|
|
53
53
|
iri_term(dpv(Name), Iri) :- namespace_iri('https://w3id.org/dpv#', Name, Iri).
|
|
54
54
|
iri_term(odrl(Name), Iri) :- namespace_iri('http://www.w3.org/ns/odrl/2/', Name, Iri).
|
|
55
55
|
|
|
56
|
-
namespace_iri(Prefix, Name,
|
|
56
|
+
namespace_iri(Prefix, Name, Iri) :-
|
|
57
57
|
atom(Name),
|
|
58
58
|
!,
|
|
59
59
|
atom_string(Name, Local),
|
|
60
|
-
string_concat(Prefix, Local,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
eyeprolog__string_atom(IriString, IriAtom),
|
|
64
|
-
string_concat(Prefix, Local, IriAtom),
|
|
60
|
+
string_concat(Prefix, Local, Iri).
|
|
61
|
+
namespace_iri(Prefix, Name, Iri) :-
|
|
62
|
+
string_concat(Prefix, Local, Iri),
|
|
65
63
|
atom_string(Name, Local).
|
|
@@ -64,20 +64,17 @@ rdf_link(Subject, Predicate, Object) :-
|
|
|
64
64
|
rdf_number(Subject, Predicate, Number) :-
|
|
65
65
|
iri_term(Subject, SubjectIri),
|
|
66
66
|
iri_term(Predicate, PredicateIri),
|
|
67
|
-
rdf(iri(SubjectIri), iri(PredicateIri), literal(
|
|
68
|
-
eyeprolog__string_atom(TextString, Text),
|
|
67
|
+
rdf(iri(SubjectIri), iri(PredicateIri), literal(Text, datatype(_Datatype)), default_graph),
|
|
69
68
|
number_string(Number, Text).
|
|
70
69
|
|
|
71
70
|
iri_term(ex(Name), Iri) :- namespace_iri('https://example.org/', Name, Iri).
|
|
72
71
|
iri_term(odrl(Name), Iri) :- namespace_iri('http://www.w3.org/ns/odrl/2/', Name, Iri).
|
|
73
72
|
|
|
74
|
-
namespace_iri(Prefix, Name,
|
|
73
|
+
namespace_iri(Prefix, Name, Iri) :-
|
|
75
74
|
atom(Name),
|
|
76
75
|
!,
|
|
77
76
|
atom_string(Name, Local),
|
|
78
|
-
string_concat(Prefix, Local,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
eyeprolog__string_atom(IriString, IriAtom),
|
|
82
|
-
string_concat(Prefix, Local, IriAtom),
|
|
77
|
+
string_concat(Prefix, Local, Iri).
|
|
78
|
+
namespace_iri(Prefix, Name, Iri) :-
|
|
79
|
+
string_concat(Prefix, Local, Iri),
|
|
83
80
|
atom_string(Name, Local).
|
|
@@ -21,8 +21,7 @@ healthcare_risk_report(Ranked) :-
|
|
|
21
21
|
risk_report(Risk, Score, Level, Clause, Mitigation) :-
|
|
22
22
|
risk_profile(_Profile, Risk, Rule, Need, Base, Mitigation),
|
|
23
23
|
risk_triggered(Risk, Rule, Need),
|
|
24
|
-
rdf_text(Rule, ex(clause),
|
|
25
|
-
eyeprolog__string_atom(ClauseString, ClauseText),
|
|
24
|
+
rdf_text(Rule, ex(clause), ClauseText),
|
|
26
25
|
atom_string(Clause, ClauseText),
|
|
27
26
|
rdf_number(Need, ex(importance), Importance),
|
|
28
27
|
Raw is Base + Importance,
|
|
@@ -63,8 +62,7 @@ constraint_text(Rule, LeftOperand, Value) :-
|
|
|
63
62
|
rdf_text(Constraint, odrl('rightOperand'), Value).
|
|
64
63
|
|
|
65
64
|
constraint_number(Rule, LeftOperand, Number) :-
|
|
66
|
-
constraint_text(Rule, LeftOperand,
|
|
67
|
-
eyeprolog__string_atom(TextString, Text),
|
|
65
|
+
constraint_text(Rule, LeftOperand, Text),
|
|
68
66
|
number_string(Number, Text).
|
|
69
67
|
|
|
70
68
|
risk_level(Score, high) :- Score > 79.
|
|
@@ -95,20 +93,17 @@ rdf_text(Subject, Predicate, Text) :-
|
|
|
95
93
|
rdf(iri(SubjectIri), iri(PredicateIri), literal(Text, datatype(_Datatype)), default_graph).
|
|
96
94
|
|
|
97
95
|
rdf_number(Subject, Predicate, Number) :-
|
|
98
|
-
rdf_text(Subject, Predicate,
|
|
99
|
-
eyeprolog__string_atom(TextString, Text),
|
|
96
|
+
rdf_text(Subject, Predicate, Text),
|
|
100
97
|
number_string(Number, Text).
|
|
101
98
|
|
|
102
99
|
iri_term(ex(Name), Iri) :- namespace_iri('https://example.org/', Name, Iri).
|
|
103
100
|
iri_term(odrl(Name), Iri) :- namespace_iri('http://www.w3.org/ns/odrl/2/', Name, Iri).
|
|
104
101
|
|
|
105
|
-
namespace_iri(Prefix, Name,
|
|
102
|
+
namespace_iri(Prefix, Name, Iri) :-
|
|
106
103
|
atom(Name),
|
|
107
104
|
!,
|
|
108
105
|
atom_string(Name, Local),
|
|
109
|
-
string_concat(Prefix, Local,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
eyeprolog__string_atom(IriString, IriAtom),
|
|
113
|
-
string_concat(Prefix, Local, IriAtom),
|
|
106
|
+
string_concat(Prefix, Local, Iri).
|
|
107
|
+
namespace_iri(Prefix, Name, Iri) :-
|
|
108
|
+
string_concat(Prefix, Local, Iri),
|
|
114
109
|
atom_string(Name, Local).
|
|
@@ -21,8 +21,7 @@ consumer_risk_report(Ranked) :-
|
|
|
21
21
|
risk_report(Risk, Score, Level, Clause, Mitigation) :-
|
|
22
22
|
risk_profile(_Profile, Risk, Rule, Need, Base, Mitigation),
|
|
23
23
|
risk_triggered(Risk, Rule, Need),
|
|
24
|
-
rdf_text(Rule, ex(clause),
|
|
25
|
-
eyeprolog__string_atom(ClauseString, ClauseText),
|
|
24
|
+
rdf_text(Rule, ex(clause), ClauseText),
|
|
26
25
|
atom_string(Clause, ClauseText),
|
|
27
26
|
rdf_number(Need, ex(importance), Importance),
|
|
28
27
|
Raw is Base + Importance,
|
|
@@ -73,8 +72,7 @@ constraint_text(Rule, LeftOperand, Value) :-
|
|
|
73
72
|
rdf_text(Constraint, odrl('rightOperand'), Value).
|
|
74
73
|
|
|
75
74
|
constraint_number(Rule, LeftOperand, Number) :-
|
|
76
|
-
constraint_text(Rule, LeftOperand,
|
|
77
|
-
eyeprolog__string_atom(TextString, Text),
|
|
75
|
+
constraint_text(Rule, LeftOperand, Text),
|
|
78
76
|
number_string(Number, Text).
|
|
79
77
|
|
|
80
78
|
risk_level(Score, high) :- Score > 79.
|
|
@@ -107,20 +105,17 @@ rdf_text(Subject, Predicate, Text) :-
|
|
|
107
105
|
rdf(iri(SubjectIri), iri(PredicateIri), literal(Text, datatype(_Datatype)), default_graph).
|
|
108
106
|
|
|
109
107
|
rdf_number(Subject, Predicate, Number) :-
|
|
110
|
-
rdf_text(Subject, Predicate,
|
|
111
|
-
eyeprolog__string_atom(TextString, Text),
|
|
108
|
+
rdf_text(Subject, Predicate, Text),
|
|
112
109
|
number_string(Number, Text).
|
|
113
110
|
|
|
114
111
|
iri_term(ex(Name), Iri) :- namespace_iri('https://example.org/', Name, Iri).
|
|
115
112
|
iri_term(odrl(Name), Iri) :- namespace_iri('http://www.w3.org/ns/odrl/2/', Name, Iri).
|
|
116
113
|
|
|
117
|
-
namespace_iri(Prefix, Name,
|
|
114
|
+
namespace_iri(Prefix, Name, Iri) :-
|
|
118
115
|
atom(Name),
|
|
119
116
|
!,
|
|
120
117
|
atom_string(Name, Local),
|
|
121
|
-
string_concat(Prefix, Local,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
eyeprolog__string_atom(IriString, IriAtom),
|
|
125
|
-
string_concat(Prefix, Local, IriAtom),
|
|
118
|
+
string_concat(Prefix, Local, Iri).
|
|
119
|
+
namespace_iri(Prefix, Name, Iri) :-
|
|
120
|
+
string_concat(Prefix, Local, Iri),
|
|
126
121
|
atom_string(Name, Local).
|
|
@@ -62,29 +62,29 @@ rdf_link(Subject, Predicate, Object) :-
|
|
|
62
62
|
iri_value(Object, ObjectIri),
|
|
63
63
|
rdf(iri(SubjectIri), iri(PredicateIri), iri(ObjectIri), default_graph).
|
|
64
64
|
|
|
65
|
-
iri_value(advanced_policy,
|
|
66
|
-
iri_value(research_permission,
|
|
67
|
-
iri_value(transfer_prohibition,
|
|
68
|
-
iri_value(health_dataset,
|
|
69
|
-
iri_value(research_hospital,
|
|
70
|
-
iri_value(medical_research,
|
|
71
|
-
iri_value(eu,
|
|
72
|
-
iri_value(deidentify_duty,
|
|
73
|
-
iri_value(deidentify,
|
|
74
|
-
iri_value(purpose_constraint,
|
|
75
|
-
iri_value(region_constraint,
|
|
76
|
-
iri_value(permission,
|
|
77
|
-
iri_value(prohibition,
|
|
78
|
-
iri_value(target,
|
|
79
|
-
iri_value(action,
|
|
80
|
-
iri_value(assignee,
|
|
81
|
-
iri_value(constraint,
|
|
82
|
-
iri_value(duty,
|
|
83
|
-
iri_value(left_operand,
|
|
84
|
-
iri_value(operator,
|
|
85
|
-
iri_value(right_operand,
|
|
86
|
-
iri_value(purpose,
|
|
87
|
-
iri_value(spatial,
|
|
88
|
-
iri_value(eq,
|
|
89
|
-
iri_value(use,
|
|
90
|
-
iri_value(transfer,
|
|
65
|
+
iri_value(advanced_policy, 'https://example.org/advanced-policy').
|
|
66
|
+
iri_value(research_permission, 'https://example.org/research-permission').
|
|
67
|
+
iri_value(transfer_prohibition, 'https://example.org/transfer-prohibition').
|
|
68
|
+
iri_value(health_dataset, 'https://example.org/health-dataset').
|
|
69
|
+
iri_value(research_hospital, 'https://example.org/research-hospital').
|
|
70
|
+
iri_value(medical_research, 'https://example.org/medical-research').
|
|
71
|
+
iri_value(eu, 'https://example.org/eu').
|
|
72
|
+
iri_value(deidentify_duty, 'https://example.org/deidentify-duty').
|
|
73
|
+
iri_value(deidentify, 'https://example.org/deidentify').
|
|
74
|
+
iri_value(purpose_constraint, 'https://example.org/purpose-constraint').
|
|
75
|
+
iri_value(region_constraint, 'https://example.org/region-constraint').
|
|
76
|
+
iri_value(permission, 'http://www.w3.org/ns/odrl/2/permission').
|
|
77
|
+
iri_value(prohibition, 'http://www.w3.org/ns/odrl/2/prohibition').
|
|
78
|
+
iri_value(target, 'http://www.w3.org/ns/odrl/2/target').
|
|
79
|
+
iri_value(action, 'http://www.w3.org/ns/odrl/2/action').
|
|
80
|
+
iri_value(assignee, 'http://www.w3.org/ns/odrl/2/assignee').
|
|
81
|
+
iri_value(constraint, 'http://www.w3.org/ns/odrl/2/constraint').
|
|
82
|
+
iri_value(duty, 'http://www.w3.org/ns/odrl/2/duty').
|
|
83
|
+
iri_value(left_operand, 'http://www.w3.org/ns/odrl/2/leftOperand').
|
|
84
|
+
iri_value(operator, 'http://www.w3.org/ns/odrl/2/operator').
|
|
85
|
+
iri_value(right_operand, 'http://www.w3.org/ns/odrl/2/rightOperand').
|
|
86
|
+
iri_value(purpose, 'http://www.w3.org/ns/odrl/2/purpose').
|
|
87
|
+
iri_value(spatial, 'http://www.w3.org/ns/odrl/2/spatial').
|
|
88
|
+
iri_value(eq, 'http://www.w3.org/ns/odrl/2/eq').
|
|
89
|
+
iri_value(use, 'http://www.w3.org/ns/odrl/2/use').
|
|
90
|
+
iri_value(transfer, 'http://www.w3.org/ns/odrl/2/transfer').
|
|
@@ -7,44 +7,44 @@
|
|
|
7
7
|
|
|
8
8
|
odrl_policy_decision(permit(use, research, dataset)) :-
|
|
9
9
|
rdf(
|
|
10
|
-
iri(
|
|
11
|
-
iri(
|
|
10
|
+
iri('https://example.org/policy'),
|
|
11
|
+
iri('http://www.w3.org/ns/odrl/2/permission'),
|
|
12
12
|
Permission,
|
|
13
13
|
default_graph
|
|
14
14
|
),
|
|
15
15
|
rdf(
|
|
16
16
|
Permission,
|
|
17
|
-
iri(
|
|
18
|
-
iri(
|
|
17
|
+
iri('http://www.w3.org/ns/odrl/2/target'),
|
|
18
|
+
iri('https://example.org/dataset'),
|
|
19
19
|
default_graph
|
|
20
20
|
),
|
|
21
21
|
rdf(
|
|
22
22
|
Permission,
|
|
23
|
-
iri(
|
|
24
|
-
iri(
|
|
23
|
+
iri('http://www.w3.org/ns/odrl/2/action'),
|
|
24
|
+
iri('http://www.w3.org/ns/odrl/2/use'),
|
|
25
25
|
default_graph
|
|
26
26
|
),
|
|
27
27
|
rdf(
|
|
28
28
|
Permission,
|
|
29
|
-
iri(
|
|
29
|
+
iri('http://www.w3.org/ns/odrl/2/constraint'),
|
|
30
30
|
Constraint,
|
|
31
31
|
default_graph
|
|
32
32
|
),
|
|
33
33
|
rdf(
|
|
34
34
|
Constraint,
|
|
35
|
-
iri(
|
|
36
|
-
iri(
|
|
35
|
+
iri('http://www.w3.org/ns/odrl/2/leftOperand'),
|
|
36
|
+
iri('http://www.w3.org/ns/odrl/2/purpose'),
|
|
37
37
|
default_graph
|
|
38
38
|
),
|
|
39
39
|
rdf(
|
|
40
40
|
Constraint,
|
|
41
|
-
iri(
|
|
42
|
-
iri(
|
|
41
|
+
iri('http://www.w3.org/ns/odrl/2/operator'),
|
|
42
|
+
iri('http://www.w3.org/ns/odrl/2/eq'),
|
|
43
43
|
default_graph
|
|
44
44
|
),
|
|
45
45
|
rdf(
|
|
46
46
|
Constraint,
|
|
47
|
-
iri(
|
|
48
|
-
iri(
|
|
47
|
+
iri('http://www.w3.org/ns/odrl/2/rightOperand'),
|
|
48
|
+
iri('https://example.org/research'),
|
|
49
49
|
default_graph
|
|
50
50
|
).
|
|
@@ -32,24 +32,24 @@ annotated_status_claim(Status, Source, Score) :-
|
|
|
32
32
|
status_resource(Status, StatusIri),
|
|
33
33
|
source_resource(Source, SourceIri),
|
|
34
34
|
rdf(
|
|
35
|
-
iri(
|
|
36
|
-
iri(
|
|
35
|
+
iri('https://example.org/bridge'),
|
|
36
|
+
iri('https://example.org/status'),
|
|
37
37
|
iri(StatusIri),
|
|
38
38
|
default_graph
|
|
39
39
|
),
|
|
40
40
|
rdf(
|
|
41
41
|
Reifier,
|
|
42
|
-
iri(
|
|
42
|
+
iri('http://www.w3.org/1999/02/22-rdf-syntax-ns#reifies'),
|
|
43
43
|
triple(
|
|
44
|
-
iri(
|
|
45
|
-
iri(
|
|
44
|
+
iri('https://example.org/bridge'),
|
|
45
|
+
iri('https://example.org/status'),
|
|
46
46
|
iri(StatusIri)
|
|
47
47
|
),
|
|
48
48
|
default_graph
|
|
49
49
|
),
|
|
50
50
|
rdf(
|
|
51
51
|
Reifier,
|
|
52
|
-
iri(
|
|
52
|
+
iri('https://example.org/assertedBy'),
|
|
53
53
|
iri(SourceIri),
|
|
54
54
|
default_graph
|
|
55
55
|
),
|
|
@@ -5,19 +5,19 @@ annotated_claim(S, P, O, Reifier, Source, Date) :-
|
|
|
5
5
|
rdf(S, P, O, default_graph),
|
|
6
6
|
rdf(
|
|
7
7
|
Reifier,
|
|
8
|
-
iri(
|
|
8
|
+
iri('http://www.w3.org/1999/02/22-rdf-syntax-ns#reifies'),
|
|
9
9
|
triple(S, P, O),
|
|
10
10
|
default_graph
|
|
11
11
|
),
|
|
12
12
|
rdf(
|
|
13
13
|
Reifier,
|
|
14
|
-
iri(
|
|
14
|
+
iri('https://example.org/statedBy'),
|
|
15
15
|
Source,
|
|
16
16
|
default_graph
|
|
17
17
|
),
|
|
18
18
|
rdf(
|
|
19
19
|
Reifier,
|
|
20
|
-
iri(
|
|
20
|
+
iri('https://example.org/recorded'),
|
|
21
21
|
Date,
|
|
22
22
|
default_graph
|
|
23
23
|
).
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
% Preserve RDF 1.2 base-direction metadata while deriving display labels.
|
|
2
|
-
rdf(
|
|
3
|
-
|
|
2
|
+
%% goal: rdf(X0, X1, X2, X3)
|
|
3
|
+
|
|
4
|
+
rdf(S, iri('https://example.org/displayLabel'), Label, G) :-
|
|
5
|
+
rdf(S, iri('https://example.org/label'), Label, G).
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
% Match nested RDF 1.2 triple terms and derive the innermost relationship.
|
|
2
|
-
rdf(S, iri(
|
|
2
|
+
rdf(S, iri('https://example.org/knows'), O, G) :-
|
|
3
3
|
rdf(
|
|
4
4
|
_,
|
|
5
|
-
iri(
|
|
5
|
+
iri('https://example.org/reviews'),
|
|
6
6
|
triple(
|
|
7
7
|
_,
|
|
8
|
-
iri(
|
|
9
|
-
triple(S, iri(
|
|
8
|
+
iri('https://example.org/claims'),
|
|
9
|
+
triple(S, iri('https://example.org/knows'), O)
|
|
10
10
|
),
|
|
11
11
|
G
|
|
12
12
|
).
|
|
13
|
+
%% goal: rdf(X0, X1, X2, X3)
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
% Join graph metadata in the default graph with data from the named graph.
|
|
2
|
-
rdf(S, iri(
|
|
2
|
+
rdf(S, iri('https://example.org/reportedBy'), Station, default_graph) :-
|
|
3
3
|
rdf(
|
|
4
|
-
iri(
|
|
5
|
-
iri(
|
|
4
|
+
iri('https://example.org/sensorGraph'),
|
|
5
|
+
iri('https://example.org/reportedBy'),
|
|
6
6
|
Station,
|
|
7
7
|
default_graph
|
|
8
8
|
),
|
|
9
9
|
rdf(
|
|
10
10
|
S,
|
|
11
|
-
iri(
|
|
11
|
+
iri('https://example.org/temperature'),
|
|
12
12
|
_,
|
|
13
|
-
iri(
|
|
13
|
+
iri('https://example.org/sensorGraph')
|
|
14
14
|
).
|
|
15
|
+
%% goal: rdf(X0, X1, X2, X3)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
% Derive relationships inside the named graph that supplied the source data.
|
|
2
|
-
rdf(S, iri(
|
|
3
|
-
rdf(S, iri(
|
|
2
|
+
rdf(S, iri('https://example.org/ancestor'), O, G) :-
|
|
3
|
+
rdf(S, iri('https://example.org/parent'), O, G).
|
|
4
4
|
|
|
5
|
-
rdf(S, iri(
|
|
6
|
-
rdf(S, iri(
|
|
7
|
-
rdf(M, iri(
|
|
5
|
+
rdf(S, iri('https://example.org/ancestor'), O, G) :-
|
|
6
|
+
rdf(S, iri('https://example.org/parent'), M, G),
|
|
7
|
+
rdf(M, iri('https://example.org/parent'), O, G).
|
|
8
|
+
%% goal: rdf(X0, X1, X2, X3)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
% Project a triple term while preserving its named-graph context.
|
|
2
|
-
rdf(S, iri(
|
|
2
|
+
rdf(S, iri('https://example.org/knows'), O, G) :-
|
|
3
3
|
rdf(
|
|
4
4
|
_,
|
|
5
|
-
iri(
|
|
6
|
-
triple(S, iri(
|
|
5
|
+
iri('https://example.org/claims'),
|
|
6
|
+
triple(S, iri('https://example.org/knows'), O),
|
|
7
7
|
G
|
|
8
8
|
).
|
|
9
|
+
%% goal: rdf(X0, X1, X2, X3)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
% Project an RDF 1.2 triple term into an ordinary asserted relationship.
|
|
2
|
-
rdf(S, iri(
|
|
2
|
+
rdf(S, iri('https://example.org/knows'), O, G) :-
|
|
3
3
|
rdf(
|
|
4
4
|
_,
|
|
5
|
-
iri(
|
|
6
|
-
triple(S, iri(
|
|
5
|
+
iri('https://example.org/claims'),
|
|
6
|
+
triple(S, iri('https://example.org/knows'), O),
|
|
7
7
|
G
|
|
8
8
|
).
|
|
9
|
+
%% goal: rdf(X0, X1, X2, X3)
|