eyeling 1.16.3 → 1.16.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 +153 -0
- package/README.md +0 -1
- package/examples/auroracare.n3 +528 -0
- package/examples/control-system.n3 +223 -47
- package/examples/delfour.n3 +409 -0
- package/examples/gps.n3 +144 -53
- package/examples/ill-formed-literals.n3 +195 -0
- package/examples/output/auroracare.n3 +118 -0
- package/examples/output/control-system.n3 +24 -1
- package/examples/output/delfour.n3 +40 -0
- package/examples/output/gps.n3 +14 -2
- package/examples/output/ill-formed-literals.n3 +27 -0
- package/examples/output/parcellocker.n3 +15 -0
- package/examples/parcellocker.n3 +164 -0
- package/eyeling.js +16 -1
- package/lib/engine.js +14 -1
- package/lib/prelude.js +2 -0
- package/package.json +2 -3
- package/arctifacts/README.md +0 -59
- package/arctifacts/ackermann.html +0 -678
- package/arctifacts/auroracare.html +0 -1297
- package/arctifacts/bike-trip.html +0 -752
- package/arctifacts/binomial-theorem.html +0 -631
- package/arctifacts/bmi.html +0 -511
- package/arctifacts/building-performance.html +0 -750
- package/arctifacts/clinical-care.html +0 -726
- package/arctifacts/collatz.html +0 -403
- package/arctifacts/complex.html +0 -321
- package/arctifacts/control-system.html +0 -482
- package/arctifacts/delfour.html +0 -849
- package/arctifacts/earthquake-epicenter.html +0 -982
- package/arctifacts/eco-route.html +0 -662
- package/arctifacts/euclid-infinitude.html +0 -564
- package/arctifacts/euler-identity.html +0 -667
- package/arctifacts/exoplanet-transit.html +0 -1000
- package/arctifacts/faltings-theorem.html +0 -1046
- package/arctifacts/fibonacci.html +0 -299
- package/arctifacts/fundamental-theorem-arithmetic.html +0 -398
- package/arctifacts/godel-numbering.html +0 -743
- package/arctifacts/gps-bike.html +0 -759
- package/arctifacts/gps-clinical-bench.html +0 -792
- package/arctifacts/graph-french.html +0 -449
- package/arctifacts/grass-molecular.html +0 -592
- package/arctifacts/group-theory.html +0 -740
- package/arctifacts/health-info.html +0 -833
- package/arctifacts/kaprekar-constant.html +0 -576
- package/arctifacts/lee.html +0 -805
- package/arctifacts/linked-lists.html +0 -502
- package/arctifacts/lldm.html +0 -612
- package/arctifacts/matrix-multiplication.html +0 -502
- package/arctifacts/matrix.html +0 -651
- package/arctifacts/newton-raphson.html +0 -944
- package/arctifacts/peano-factorial.html +0 -456
- package/arctifacts/pi.html +0 -363
- package/arctifacts/polynomial.html +0 -646
- package/arctifacts/prime.html +0 -366
- package/arctifacts/pythagorean-theorem.html +0 -468
- package/arctifacts/rest-path.html +0 -469
- package/arctifacts/roots-of-unity.html +0 -363
- package/arctifacts/turing.html +0 -409
- package/arctifacts/wind-turbines.html +0 -726
package/examples/gps.n3
CHANGED
|
@@ -1,63 +1,154 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
1
|
+
# ===========================================================================
|
|
2
|
+
# GPS — ARC-style goal-driven path example.
|
|
3
|
+
#
|
|
4
|
+
# This example shows a tiny route planner for western Belgium. Starting in Gent,
|
|
5
|
+
# the program works out the available routes to Oostende, compares them, and
|
|
6
|
+
# recommends the better one. It does not only print an answer: it also explains
|
|
7
|
+
# why that route was chosen and checks that the recommendation is consistent
|
|
8
|
+
# with the computed travel metrics.
|
|
9
|
+
# ===========================================================================
|
|
6
10
|
|
|
11
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
|
|
7
12
|
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
8
13
|
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
|
|
9
|
-
@prefix
|
|
10
|
-
@prefix :
|
|
14
|
+
@prefix string: <http://www.w3.org/2000/10/swap/string#>.
|
|
15
|
+
@prefix gps: <https://example.org/gps#>.
|
|
16
|
+
@prefix : <https://example.org/gps-case#>.
|
|
17
|
+
|
|
18
|
+
# -----
|
|
19
|
+
# Facts
|
|
20
|
+
# -----
|
|
11
21
|
|
|
12
|
-
# current state
|
|
13
22
|
:i1 :location :Gent.
|
|
23
|
+
:question :text "Which route should we take from Gent to Oostende?".
|
|
14
24
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{
|
|
28
|
-
(?From ?To (?Act) ?Dur ?Cost ?Belief ?Comfort) :path true.
|
|
29
|
-
}
|
|
30
|
-
<=
|
|
31
|
-
{
|
|
32
|
-
:map-BE gps:description (?From true ?To ?Act ?Dur ?Cost ?Belief ?Comfort).
|
|
33
|
-
}.
|
|
34
|
-
|
|
35
|
-
# Recursive: chain one step + rest path, and aggregate weights
|
|
36
|
-
{
|
|
37
|
-
(?From ?To ?Actions ?Dur ?Cost ?Belief ?Comfort) :path true.
|
|
38
|
-
}
|
|
39
|
-
<=
|
|
40
|
-
{
|
|
41
|
-
:map-BE gps:description (?From true ?Mid ?Act ?Dur1 ?Cost1 ?Bel1 ?Comf1).
|
|
42
|
-
(?Mid ?To ?RestActs ?Dur2 ?Cost2 ?Bel2 ?Comf2) :path true.
|
|
25
|
+
:routeDirect :label "Gent → Brugge → Oostende".
|
|
26
|
+
:routeViaKortrijk :label "Gent → Kortrijk → Brugge → Oostende".
|
|
27
|
+
|
|
28
|
+
# ----------------------------------------------------------------
|
|
29
|
+
# Map of Belgium (kept from the original as backward descriptions)
|
|
30
|
+
# ----------------------------------------------------------------
|
|
31
|
+
|
|
32
|
+
{ :mapBE gps:description ({?S :location :Gent} true {?S :location :Brugge} :drive_gent_brugge 1500.0 0.006 0.96 0.99) }
|
|
33
|
+
<= true.
|
|
34
|
+
|
|
35
|
+
{ :mapBE gps:description ({?S :location :Gent} true {?S :location :Kortrijk} :drive_gent_kortrijk 1600.0 0.007 0.96 0.99) }
|
|
36
|
+
<= true.
|
|
43
37
|
|
|
38
|
+
{ :mapBE gps:description ({?S :location :Kortrijk} true {?S :location :Brugge} :drive_kortrijk_brugge 1600.0 0.007 0.96 0.99) }
|
|
39
|
+
<= true.
|
|
40
|
+
|
|
41
|
+
{ :mapBE gps:description ({?S :location :Brugge} true {?S :location :Oostende} :drive_brugge_oostende 900.0 0.004 0.98 1.0) }
|
|
42
|
+
<= true.
|
|
43
|
+
|
|
44
|
+
# -----------------------------------------------------
|
|
45
|
+
# Logic: compute all paths by chaining map descriptions
|
|
46
|
+
# -----------------------------------------------------
|
|
47
|
+
|
|
48
|
+
# Base: a single map description is already a path.
|
|
49
|
+
{ (?From ?To (?Act) ?Dur ?Cost ?Belief ?Comfort) :path true. }
|
|
50
|
+
<=
|
|
51
|
+
{ :mapBE gps:description (?From true ?To ?Act ?Dur ?Cost ?Belief ?Comfort). }.
|
|
52
|
+
|
|
53
|
+
# Recursive: extend a description with the rest of a path.
|
|
54
|
+
{ (?From ?To ?Actions ?Dur ?Cost ?Belief ?Comfort) :path true. }
|
|
55
|
+
<=
|
|
56
|
+
{ :mapBE gps:description (?From true ?Mid ?Act ?Dur1 ?Cost1 ?Bel1 ?Comf1).
|
|
57
|
+
(?Mid ?To ?RestActs ?Dur2 ?Cost2 ?Bel2 ?Comf2) :path true.
|
|
44
58
|
((?Act) ?RestActs) list:append ?Actions.
|
|
59
|
+
(?Dur1 ?Dur2) math:sum ?Dur.
|
|
60
|
+
(?Cost1 ?Cost2) math:sum ?Cost.
|
|
61
|
+
(?Bel1 ?Bel2) math:product ?Belief.
|
|
62
|
+
(?Comf1 ?Comf2) math:product ?Comfort. }.
|
|
63
|
+
|
|
64
|
+
# Query the path relation for the traveller starting in Gent and aiming for Oostende.
|
|
65
|
+
{ :i1 :location :Gent.
|
|
66
|
+
({:i1 :location :Gent} {:i1 :location :Oostende} ?Acts ?Dur ?Cost ?Bel ?Comf) :path true. }
|
|
67
|
+
=>
|
|
68
|
+
{ :i1 gps:path (?Acts ?Dur ?Cost ?Bel ?Comf). }.
|
|
69
|
+
|
|
70
|
+
# Name the two concrete routes that exist in this tiny map.
|
|
71
|
+
{ :i1 gps:path ((:drive_gent_brugge :drive_brugge_oostende) ?Dur ?Cost ?Bel ?Comf). }
|
|
72
|
+
=>
|
|
73
|
+
{ :routeDirect :duration ?Dur;
|
|
74
|
+
:cost ?Cost;
|
|
75
|
+
:belief ?Bel;
|
|
76
|
+
:comfort ?Comf. }.
|
|
77
|
+
|
|
78
|
+
{ :i1 gps:path ((:drive_gent_kortrijk :drive_kortrijk_brugge :drive_brugge_oostende) ?Dur ?Cost ?Bel ?Comf). }
|
|
79
|
+
=>
|
|
80
|
+
{ :routeViaKortrijk :duration ?Dur;
|
|
81
|
+
:cost ?Cost;
|
|
82
|
+
:belief ?Bel;
|
|
83
|
+
:comfort ?Comf. }.
|
|
84
|
+
|
|
85
|
+
# ------------------------------------
|
|
86
|
+
# Decision: recommend the better route
|
|
87
|
+
# ------------------------------------
|
|
88
|
+
|
|
89
|
+
{ :routeDirect :duration ?D1; :cost ?C1; :belief ?B1; :comfort ?F1.
|
|
90
|
+
:routeViaKortrijk :duration ?D2; :cost ?C2; :belief ?B2; :comfort ?F2.
|
|
91
|
+
?D1 math:lessThan ?D2.
|
|
92
|
+
?C1 math:lessThan ?C2.
|
|
93
|
+
?B1 math:greaterThan ?B2.
|
|
94
|
+
?F1 math:greaterThan ?F2. }
|
|
95
|
+
=>
|
|
96
|
+
{ :decision :recommendedRoute :routeDirect;
|
|
97
|
+
:outcome "Take the direct route via Brugge.". }.
|
|
98
|
+
|
|
99
|
+
# ---------------------------------------------------
|
|
100
|
+
# Presentation: ARC output as one deterministic block
|
|
101
|
+
# ---------------------------------------------------
|
|
102
|
+
|
|
103
|
+
{ :decision :recommendedRoute :routeDirect; :outcome ?Outcome.
|
|
104
|
+
:routeDirect :label ?BestLabel; :duration ?BestDur; :cost ?BestCost; :belief ?BestBel; :comfort ?BestComf.
|
|
105
|
+
:routeViaKortrijk :label ?AltLabel; :duration ?AltDur; :cost ?AltCost; :belief ?AltBel; :comfort ?AltComf.
|
|
106
|
+
(
|
|
107
|
+
"GPS — Goal driven route planning\n\n"
|
|
108
|
+
"Answer\n"
|
|
109
|
+
?Outcome "\n"
|
|
110
|
+
"Recommended route: " ?BestLabel "\n\n"
|
|
111
|
+
"Reason Why\n"
|
|
112
|
+
"From Gent to Oostende, the planner found two routes in this small map. "
|
|
113
|
+
"The direct route (" ?BestLabel ") takes " ?BestDur " seconds at cost " ?BestCost
|
|
114
|
+
", with belief " ?BestBel " and comfort " ?BestComf ". "
|
|
115
|
+
"The alternative (" ?AltLabel ") takes " ?AltDur " seconds at cost " ?AltCost
|
|
116
|
+
", with belief " ?AltBel " and comfort " ?AltComf ". "
|
|
117
|
+
"So the direct route is faster, cheaper, more reliable, and slightly more comfortable.\n\n"
|
|
118
|
+
"Check\n"
|
|
119
|
+
"C1 OK - the direct Gent → Brugge → Oostende route was derived.\n"
|
|
120
|
+
"C2 OK - the alternative Gent → Kortrijk → Brugge → Oostende route was derived.\n"
|
|
121
|
+
"C3 OK - the recommended route is faster than the alternative.\n"
|
|
122
|
+
"C4 OK - the recommended route is cheaper than the alternative.\n"
|
|
123
|
+
"C5 OK - the recommended route has higher belief and comfort scores.\n"
|
|
124
|
+
) string:concatenation ?Block. }
|
|
125
|
+
=>
|
|
126
|
+
{ :report log:outputString ?Block. }.
|
|
127
|
+
|
|
128
|
+
# -----------------------------------------------------------------------
|
|
129
|
+
# Verification: fail loudly if the recommendation contradicts the metrics
|
|
130
|
+
# -----------------------------------------------------------------------
|
|
131
|
+
|
|
132
|
+
{ :decision :recommendedRoute :routeDirect.
|
|
133
|
+
:routeDirect :duration ?D1.
|
|
134
|
+
:routeViaKortrijk :duration ?D2.
|
|
135
|
+
?D1 math:notLessThan ?D2. }
|
|
136
|
+
=> false.
|
|
137
|
+
|
|
138
|
+
{ :decision :recommendedRoute :routeDirect.
|
|
139
|
+
:routeDirect :cost ?C1.
|
|
140
|
+
:routeViaKortrijk :cost ?C2.
|
|
141
|
+
?C1 math:notLessThan ?C2. }
|
|
142
|
+
=> false.
|
|
45
143
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
# ------------------------------------------------------
|
|
53
|
-
# "Query": derive gps:path facts for i1, goal = Oostende
|
|
54
|
-
# ------------------------------------------------------
|
|
55
|
-
{
|
|
56
|
-
:i1 :location :Gent.
|
|
57
|
-
({:i1 :location :Gent} {:i1 :location :Oostende} ?Acts ?Dur ?Cost ?Bel ?Comf) :path true.
|
|
58
|
-
}
|
|
59
|
-
=>
|
|
60
|
-
{
|
|
61
|
-
:i1 gps:path (?Acts ?Dur ?Cost ?Bel ?Comf).
|
|
62
|
-
}.
|
|
144
|
+
{ :decision :recommendedRoute :routeDirect.
|
|
145
|
+
:routeDirect :belief ?B1.
|
|
146
|
+
:routeViaKortrijk :belief ?B2.
|
|
147
|
+
?B1 math:notGreaterThan ?B2. }
|
|
148
|
+
=> false.
|
|
63
149
|
|
|
150
|
+
{ :decision :recommendedRoute :routeDirect.
|
|
151
|
+
:routeDirect :comfort ?F1.
|
|
152
|
+
:routeViaKortrijk :comfort ?F2.
|
|
153
|
+
?F1 math:notGreaterThan ?F2. }
|
|
154
|
+
=> false.
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# ==========================
|
|
2
|
+
# Ill-formed literal checker
|
|
3
|
+
#
|
|
4
|
+
# Datatypes covered
|
|
5
|
+
# - xsd:boolean
|
|
6
|
+
# - integer family
|
|
7
|
+
# - xsd:decimal
|
|
8
|
+
# - xsd:float / xsd:double
|
|
9
|
+
# - xsd:date
|
|
10
|
+
# - xsd:dateTime
|
|
11
|
+
# - xsd:duration
|
|
12
|
+
# ==========================
|
|
13
|
+
|
|
14
|
+
@prefix : <http://example.org/#>.
|
|
15
|
+
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
|
|
16
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
|
|
17
|
+
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
18
|
+
@prefix string: <http://www.w3.org/2000/10/swap/string#>.
|
|
19
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
|
|
20
|
+
|
|
21
|
+
# ---------
|
|
22
|
+
# Demo data
|
|
23
|
+
# ---------
|
|
24
|
+
|
|
25
|
+
# well-formed examples
|
|
26
|
+
:okInt :p "42"^^xsd:integer.
|
|
27
|
+
:okBool1 :p "true"^^xsd:boolean.
|
|
28
|
+
:okBool2 :p "0"^^xsd:boolean.
|
|
29
|
+
:okDecimal :p "-12.50"^^xsd:decimal.
|
|
30
|
+
:okDouble :p "6.022e23"^^xsd:double.
|
|
31
|
+
:okDate :p "2025-01-31"^^xsd:date.
|
|
32
|
+
:okDateTime :p "2025-01-31T23:59:59Z"^^xsd:dateTime.
|
|
33
|
+
:okDuration :p "PT900S"^^xsd:duration.
|
|
34
|
+
|
|
35
|
+
# ill-formed examples
|
|
36
|
+
:badInt1 :p "abc"^^xsd:integer.
|
|
37
|
+
:badInt2 :p "12.3"^^xsd:int.
|
|
38
|
+
:badBool :p "truish"^^xsd:boolean.
|
|
39
|
+
:badDecimal :p "12.3.4"^^xsd:decimal.
|
|
40
|
+
:badDouble :p "1e"^^xsd:double.
|
|
41
|
+
:badDate :p "yesterday"^^xsd:dateTime.
|
|
42
|
+
:badDateTime :p "not-a-datetime"^^xsd:dateTime.
|
|
43
|
+
:badDuration :p "not-a-duration"^^xsd:duration.
|
|
44
|
+
|
|
45
|
+
# ---------------------------------
|
|
46
|
+
# Rules: detect ill-formed literals
|
|
47
|
+
# ---------------------------------
|
|
48
|
+
|
|
49
|
+
# xsd:boolean
|
|
50
|
+
{
|
|
51
|
+
?s ?p ?lit.
|
|
52
|
+
?lit log:rawType log:Literal.
|
|
53
|
+
(?lex xsd:boolean) log:dtlit ?lit.
|
|
54
|
+
?lex string:notMatches "^(true|false|1|0)$".
|
|
55
|
+
}
|
|
56
|
+
=>
|
|
57
|
+
{
|
|
58
|
+
(?s ?p ?lit)
|
|
59
|
+
:illFormedLiteral true;
|
|
60
|
+
:datatype xsd:boolean;
|
|
61
|
+
:lexicalForm ?lex;
|
|
62
|
+
:reason "invalid xsd:boolean lexical form".
|
|
63
|
+
}.
|
|
64
|
+
|
|
65
|
+
# integer family
|
|
66
|
+
{
|
|
67
|
+
?s ?p ?lit.
|
|
68
|
+
?lit log:rawType log:Literal.
|
|
69
|
+
(?lex ?dt) log:dtlit ?lit.
|
|
70
|
+
?dt list:in (
|
|
71
|
+
xsd:integer
|
|
72
|
+
xsd:long
|
|
73
|
+
xsd:int
|
|
74
|
+
xsd:short
|
|
75
|
+
xsd:byte
|
|
76
|
+
xsd:nonNegativeInteger
|
|
77
|
+
xsd:positiveInteger
|
|
78
|
+
xsd:nonPositiveInteger
|
|
79
|
+
xsd:negativeInteger
|
|
80
|
+
xsd:unsignedLong
|
|
81
|
+
xsd:unsignedInt
|
|
82
|
+
xsd:unsignedShort
|
|
83
|
+
xsd:unsignedByte
|
|
84
|
+
).
|
|
85
|
+
?lex string:notMatches "^[+-]?[0-9]+$".
|
|
86
|
+
}
|
|
87
|
+
=>
|
|
88
|
+
{
|
|
89
|
+
(?s ?p ?lit)
|
|
90
|
+
:illFormedLiteral true;
|
|
91
|
+
:datatype ?dt;
|
|
92
|
+
:lexicalForm ?lex;
|
|
93
|
+
:reason "invalid integer-family lexical form".
|
|
94
|
+
}.
|
|
95
|
+
|
|
96
|
+
# xsd:decimal
|
|
97
|
+
{
|
|
98
|
+
?s ?p ?lit.
|
|
99
|
+
?lit log:rawType log:Literal.
|
|
100
|
+
(?lex xsd:decimal) log:dtlit ?lit.
|
|
101
|
+
?lex string:notMatches "^[+-]?(?:[0-9]+\\.[0-9]*|\\.[0-9]+|[0-9]+)$".
|
|
102
|
+
}
|
|
103
|
+
=>
|
|
104
|
+
{
|
|
105
|
+
(?s ?p ?lit)
|
|
106
|
+
:illFormedLiteral true;
|
|
107
|
+
:datatype xsd:decimal;
|
|
108
|
+
:lexicalForm ?lex;
|
|
109
|
+
:reason "invalid xsd:decimal lexical form".
|
|
110
|
+
}.
|
|
111
|
+
|
|
112
|
+
# xsd:float / xsd:double
|
|
113
|
+
{
|
|
114
|
+
?s ?p ?lit.
|
|
115
|
+
?lit log:rawType log:Literal.
|
|
116
|
+
(?lex ?dt) log:dtlit ?lit.
|
|
117
|
+
?dt list:in ( xsd:float xsd:double ).
|
|
118
|
+
?lex string:notMatches "^(?:NaN|INF|-INF|[+-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?)$".
|
|
119
|
+
}
|
|
120
|
+
=>
|
|
121
|
+
{
|
|
122
|
+
(?s ?p ?lit)
|
|
123
|
+
:illFormedLiteral true;
|
|
124
|
+
:datatype ?dt;
|
|
125
|
+
:lexicalForm ?lex;
|
|
126
|
+
:reason "invalid xsd:float/xsd:double lexical form".
|
|
127
|
+
}.
|
|
128
|
+
|
|
129
|
+
# xsd:date
|
|
130
|
+
{
|
|
131
|
+
?s ?p ?lit.
|
|
132
|
+
?lit log:rawType log:Literal.
|
|
133
|
+
(?lex xsd:date) log:dtlit ?lit.
|
|
134
|
+
1 log:notIncludes { ?lit math:equalTo ?lit. }.
|
|
135
|
+
}
|
|
136
|
+
=>
|
|
137
|
+
{
|
|
138
|
+
(?s ?p ?lit)
|
|
139
|
+
:illFormedLiteral true;
|
|
140
|
+
:datatype xsd:date;
|
|
141
|
+
:lexicalForm ?lex;
|
|
142
|
+
:reason "xsd:date literal is not parseable by the reasoner".
|
|
143
|
+
}.
|
|
144
|
+
|
|
145
|
+
# xsd:dateTime
|
|
146
|
+
{
|
|
147
|
+
?s ?p ?lit.
|
|
148
|
+
?lit log:rawType log:Literal.
|
|
149
|
+
(?lex xsd:dateTime) log:dtlit ?lit.
|
|
150
|
+
1 log:notIncludes { ?lit math:equalTo ?lit. }.
|
|
151
|
+
}
|
|
152
|
+
=>
|
|
153
|
+
{
|
|
154
|
+
(?s ?p ?lit)
|
|
155
|
+
:illFormedLiteral true;
|
|
156
|
+
:datatype xsd:dateTime;
|
|
157
|
+
:lexicalForm ?lex;
|
|
158
|
+
:reason "xsd:dateTime literal is not parseable by the reasoner".
|
|
159
|
+
}.
|
|
160
|
+
|
|
161
|
+
# xsd:duration
|
|
162
|
+
{
|
|
163
|
+
?s ?p ?lit.
|
|
164
|
+
?lit log:rawType log:Literal.
|
|
165
|
+
(?lex xsd:duration) log:dtlit ?lit.
|
|
166
|
+
1 log:notIncludes { ?lit math:equalTo ?lit. }.
|
|
167
|
+
}
|
|
168
|
+
=>
|
|
169
|
+
{
|
|
170
|
+
(?s ?p ?lit)
|
|
171
|
+
:illFormedLiteral true;
|
|
172
|
+
:datatype xsd:duration;
|
|
173
|
+
:lexicalForm ?lex;
|
|
174
|
+
:reason "xsd:duration literal is not parseable by the reasoner".
|
|
175
|
+
}.
|
|
176
|
+
|
|
177
|
+
# -----------------
|
|
178
|
+
# Output projection
|
|
179
|
+
# -----------------
|
|
180
|
+
|
|
181
|
+
{
|
|
182
|
+
?issue :illFormedLiteral true;
|
|
183
|
+
:datatype ?dt;
|
|
184
|
+
:lexicalForm ?lex;
|
|
185
|
+
:reason ?why.
|
|
186
|
+
}
|
|
187
|
+
log:query
|
|
188
|
+
{
|
|
189
|
+
?issue :datatype ?dt;
|
|
190
|
+
:lexicalForm ?lex;
|
|
191
|
+
:reason ?why.
|
|
192
|
+
}.
|
|
193
|
+
|
|
194
|
+
# Optional hard-fail mode:
|
|
195
|
+
# { ?issue :illFormedLiteral true. } => false.
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
@prefix : <https://example.org/auroracare#> .
|
|
2
|
+
@prefix ac: <https://example.org/auroracare#> .
|
|
3
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
4
|
+
|
|
5
|
+
:scenario_C :decision "DENY" .
|
|
6
|
+
:scenario_C :reason "Denied: no policy matched (purpose, environment, TOMs, or categories out of scope)." .
|
|
7
|
+
:scenario_C :trace "urn:policy:qi-2025-aurora:deny:odrl:no_permission_matched" .
|
|
8
|
+
:scenario_D :matchedProhibition :policy_deny_insurance .
|
|
9
|
+
:scenario_D :decision "DENY" .
|
|
10
|
+
:scenario_D :reason "Denied: the requested purpose (insurance management) is prohibited by policy." .
|
|
11
|
+
:scenario_D :trace "deny:prohibited_purpose" .
|
|
12
|
+
:scenario_D :trace "urn:policy:deny-insurance:deny:odrl:prohibition_matched" .
|
|
13
|
+
:scenario_C :checkC1 "SKIPPED - not a prohibited purpose" .
|
|
14
|
+
:scenario_C :checkC2 "SKIPPED" .
|
|
15
|
+
:scenario_C :checkC3 "SKIPPED" .
|
|
16
|
+
:scenario_C :checkC4 "OK - denied because opt-in missing or no policy match" .
|
|
17
|
+
:scenario_C :checkC5 "SKIPPED" .
|
|
18
|
+
:scenario_C :checkC6 "SKIPPED - no prohibition matched" .
|
|
19
|
+
:scenario_C :checkC7 "SKIPPED" .
|
|
20
|
+
:scenario_C :checkC8 "SKIPPED - no matched policy or no duties" .
|
|
21
|
+
:scenario_C :checkC9 "SKIPPED" .
|
|
22
|
+
:scenario_C :checkC10Text "SKIPPED - no matched policy" .
|
|
23
|
+
:out_030_C log:outputString "=== C – Quality improvement (out of scope) ===\nQI analyst with only lab results; policy expects labs + summary.\n\nAnswer\nDENY\n\nReason Why\nDenied: no policy matched (purpose, environment, TOMs, or categories out of scope).\n\nCheck\nC1 SKIPPED - not a prohibited purpose\nC2 SKIPPED\nC3 SKIPPED\nC4 OK - denied because opt-in missing or no policy match\nC5 SKIPPED\nC6 SKIPPED - no prohibition matched\nC7 SKIPPED\nC8 SKIPPED - no matched policy or no duties\nC9 SKIPPED\nC10 SKIPPED - no matched policy\n\n" .
|
|
24
|
+
:scenario_D :checkC1 "OK - denied prohibited purpose" .
|
|
25
|
+
:scenario_D :checkC2 "SKIPPED" .
|
|
26
|
+
:scenario_D :checkC3 "SKIPPED" .
|
|
27
|
+
:scenario_D :checkC4 "SKIPPED" .
|
|
28
|
+
:scenario_D :checkC5 "SKIPPED" .
|
|
29
|
+
:scenario_D :checkC6 "OK - denied due to prohibition" .
|
|
30
|
+
:scenario_D :checkC7 "SKIPPED" .
|
|
31
|
+
:scenario_D :checkC8 "SKIPPED - no matched policy or no duties" .
|
|
32
|
+
:scenario_D :checkC9 "SKIPPED" .
|
|
33
|
+
:scenario_D :checkC10Text "SKIPPED - no matched policy" .
|
|
34
|
+
:out_040_D log:outputString "=== D – Insurance management ===\nInsurance bot attempting to use health data for insurance management (prohibited purpose).\n\nAnswer\nDENY\n\nReason Why\nDenied: the requested purpose (insurance management) is prohibited by policy.\n\nCheck\nC1 OK - denied prohibited purpose\nC2 SKIPPED\nC3 SKIPPED\nC4 SKIPPED\nC5 SKIPPED\nC6 OK - denied due to prohibition\nC7 SKIPPED\nC8 SKIPPED - no matched policy or no duties\nC9 SKIPPED\nC10 SKIPPED - no matched policy\n\n" .
|
|
35
|
+
:scenario_A :careTeamLinked "yes" .
|
|
36
|
+
:scenario_E :careTeamLinked "yes" .
|
|
37
|
+
:scenario_F :subjectOptIn "yes" .
|
|
38
|
+
:scenario_G :subjectOptOut "yes" .
|
|
39
|
+
:scenario_A :matchedPolicy :policy_primary .
|
|
40
|
+
:scenario_A :matchedPolicyUid "urn:policy:primary-care-001" .
|
|
41
|
+
:scenario_A :decision "PERMIT" .
|
|
42
|
+
:scenario_A :reason "Permitted: clinician in the patient's care team, and the primary-care policy matched." .
|
|
43
|
+
:scenario_A :trace "permit:primary_care_allowed" .
|
|
44
|
+
:scenario_A :trace "urn:policy:primary-care-001:permit:odrl:permission_matched" .
|
|
45
|
+
:scenario_E :matchedPolicy :policy_primary .
|
|
46
|
+
:scenario_E :matchedPolicyUid "urn:policy:primary-care-001" .
|
|
47
|
+
:scenario_E :decision "PERMIT" .
|
|
48
|
+
:scenario_E :reason "Permitted: clinician in the patient's care team, and the primary-care policy matched." .
|
|
49
|
+
:scenario_E :trace "permit:primary_care_allowed" .
|
|
50
|
+
:scenario_E :trace "urn:policy:primary-care-001:permit:odrl:permission_matched" .
|
|
51
|
+
:scenario_B :matchedPolicy :policy_qi .
|
|
52
|
+
:scenario_B :matchedPolicyUid "urn:policy:qi-2025-aurora" .
|
|
53
|
+
:scenario_B :decision "PERMIT" .
|
|
54
|
+
:scenario_B :reason "Permitted: ODRL/DPV policy matched for secondary use." .
|
|
55
|
+
:scenario_B :trace "urn:policy:qi-2025-aurora:permit:odrl:permission_matched" .
|
|
56
|
+
:scenario_F :matchedPolicy :policy_research .
|
|
57
|
+
:scenario_F :matchedPolicyUid "urn:policy:research-aurora-diabetes" .
|
|
58
|
+
:scenario_F :decision "PERMIT" .
|
|
59
|
+
:scenario_F :reason "Permitted: subject opted in and an ODRL/DPV policy matched (anonymised dataset in secure environment)." .
|
|
60
|
+
:scenario_F :trace "urn:policy:research-aurora-diabetes:permit:odrl:permission_matched" .
|
|
61
|
+
:scenario_G :decision "DENY" .
|
|
62
|
+
:scenario_G :reason "Denied: you opted out of your data being used to train AI systems." .
|
|
63
|
+
:scenario_G :trace "deny:subject_opted_out_ai_training" .
|
|
64
|
+
:scenario_A :checkC1 "SKIPPED - not a prohibited purpose" .
|
|
65
|
+
:scenario_A :checkC2 "OK - clinician" .
|
|
66
|
+
:scenario_A :checkC3 "OK - care-team linked" .
|
|
67
|
+
:scenario_A :checkC4 "SKIPPED" .
|
|
68
|
+
:scenario_A :checkC5 "OK - operator=isAnyOf, allowed=[\"https://example.org/health#PATIENT_SUMMARY\",\"https://example.org/health#LAB_RESULTS\"], requested=[\"https://example.org/health#PATIENT_SUMMARY\"]" .
|
|
69
|
+
:scenario_A :checkC6 "SKIPPED - no prohibition matched" .
|
|
70
|
+
:scenario_A :checkC7 "OK - trace shows matching permission" .
|
|
71
|
+
:scenario_A :checkC8 "SKIPPED - no matched policy or no duties" .
|
|
72
|
+
:scenario_A :checkC9 "SKIPPED - policy has no environment constraint" .
|
|
73
|
+
:scenario_A :checkC10Text "INFO - matched policy: urn:policy:primary-care-001" .
|
|
74
|
+
:out_010_A log:outputString "=== A – Primary care visit ===\nClinician in the patient's care team accessing the patient summary for primary care management.\n\nAnswer\nPERMIT\n\nReason Why\nPermitted: clinician in the patient's care team, and the primary-care policy matched.\n\nCheck\nC1 SKIPPED - not a prohibited purpose\nC2 OK - clinician\nC3 OK - care-team linked\nC4 SKIPPED\nC5 OK - operator=isAnyOf, allowed=[\"https://example.org/health#PATIENT_SUMMARY\",\"https://example.org/health#LAB_RESULTS\"], requested=[\"https://example.org/health#PATIENT_SUMMARY\"]\nC6 SKIPPED - no prohibition matched\nC7 OK - trace shows matching permission\nC8 SKIPPED - no matched policy or no duties\nC9 SKIPPED - policy has no environment constraint\nC10 INFO - matched policy: urn:policy:primary-care-001\n\n" .
|
|
75
|
+
:scenario_E :checkC1 "SKIPPED - not a prohibited purpose" .
|
|
76
|
+
:scenario_E :checkC2 "OK - clinician" .
|
|
77
|
+
:scenario_E :checkC3 "OK - care-team linked" .
|
|
78
|
+
:scenario_E :checkC4 "SKIPPED" .
|
|
79
|
+
:scenario_E :checkC5 "OK - operator=isAnyOf, allowed=[\"https://example.org/health#PATIENT_SUMMARY\",\"https://example.org/health#LAB_RESULTS\"], requested=[\"https://example.org/health#LAB_RESULTS\"]" .
|
|
80
|
+
:scenario_E :checkC6 "SKIPPED - no prohibition matched" .
|
|
81
|
+
:scenario_E :checkC7 "OK - trace shows matching permission" .
|
|
82
|
+
:scenario_E :checkC8 "SKIPPED - no matched policy or no duties" .
|
|
83
|
+
:scenario_E :checkC9 "SKIPPED - policy has no environment constraint" .
|
|
84
|
+
:scenario_E :checkC10Text "INFO - matched policy: urn:policy:primary-care-001" .
|
|
85
|
+
:out_050_E log:outputString "=== E – GP checks labs ===\nGP for the same patient checking lab results via the API gateway.\n\nAnswer\nPERMIT\n\nReason Why\nPermitted: clinician in the patient's care team, and the primary-care policy matched.\n\nCheck\nC1 SKIPPED - not a prohibited purpose\nC2 OK - clinician\nC3 OK - care-team linked\nC4 SKIPPED\nC5 OK - operator=isAnyOf, allowed=[\"https://example.org/health#PATIENT_SUMMARY\",\"https://example.org/health#LAB_RESULTS\"], requested=[\"https://example.org/health#LAB_RESULTS\"]\nC6 SKIPPED - no prohibition matched\nC7 OK - trace shows matching permission\nC8 SKIPPED - no matched policy or no duties\nC9 SKIPPED - policy has no environment constraint\nC10 INFO - matched policy: urn:policy:primary-care-001\n\n" .
|
|
86
|
+
:scenario_B :checkC1 "SKIPPED - not a prohibited purpose" .
|
|
87
|
+
:scenario_B :checkC2 "SKIPPED" .
|
|
88
|
+
:scenario_B :checkC3 "SKIPPED" .
|
|
89
|
+
:scenario_B :checkC4 "OK - opt-in present and policy matched" .
|
|
90
|
+
:scenario_B :checkC5 "OK - operator=isAllOf, allowed=[\"https://example.org/health#LAB_RESULTS\",\"https://example.org/health#PATIENT_SUMMARY\"], requested=[\"https://example.org/health#LAB_RESULTS\",\"https://example.org/health#PATIENT_SUMMARY\"]" .
|
|
91
|
+
:scenario_B :checkC6 "SKIPPED - no prohibition matched" .
|
|
92
|
+
:scenario_B :checkC7 "OK - trace shows matching permission" .
|
|
93
|
+
:scenario_B :checkC8 "INFO - duties attached: duty:https://w3id.org/dpv/legal/eu/ehds#requireConsent, duty:https://w3id.org/dpv/legal/eu/ehds#noExfiltration" .
|
|
94
|
+
:scenario_B :checkC9 "OK - operator=eq, allowed=\"secure_env\", requested=\"secure_env\"" .
|
|
95
|
+
:scenario_B :checkC10Text "INFO - matched policy: urn:policy:qi-2025-aurora" .
|
|
96
|
+
:out_020_B log:outputString "=== B – Quality improvement (in scope) ===\nQI analyst using lab results + summary in a secure environment.\n\nAnswer\nPERMIT\n\nReason Why\nPermitted: ODRL/DPV policy matched for secondary use.\n\nCheck\nC1 SKIPPED - not a prohibited purpose\nC2 SKIPPED\nC3 SKIPPED\nC4 OK - opt-in present and policy matched\nC5 OK - operator=isAllOf, allowed=[\"https://example.org/health#LAB_RESULTS\",\"https://example.org/health#PATIENT_SUMMARY\"], requested=[\"https://example.org/health#LAB_RESULTS\",\"https://example.org/health#PATIENT_SUMMARY\"]\nC6 SKIPPED - no prohibition matched\nC7 OK - trace shows matching permission\nC8 INFO - duties attached: duty:https://w3id.org/dpv/legal/eu/ehds#requireConsent, duty:https://w3id.org/dpv/legal/eu/ehds#noExfiltration\nC9 OK - operator=eq, allowed=\"secure_env\", requested=\"secure_env\"\nC10 INFO - matched policy: urn:policy:qi-2025-aurora\n\n" .
|
|
97
|
+
:scenario_F :checkC1 "SKIPPED - not a prohibited purpose" .
|
|
98
|
+
:scenario_F :checkC2 "SKIPPED" .
|
|
99
|
+
:scenario_F :checkC3 "SKIPPED" .
|
|
100
|
+
:scenario_F :checkC4 "OK - opt-in present and policy matched" .
|
|
101
|
+
:scenario_F :checkC5 "OK - operator=isAnyOf, allowed=[\"https://example.org/health#LAB_RESULTS\",\"https://example.org/health#PATIENT_SUMMARY\",\"https://example.org/health#IMAGING_REPORT\"], requested=[\"https://example.org/health#PATIENT_SUMMARY\",\"https://example.org/health#LAB_RESULTS\"]" .
|
|
102
|
+
:scenario_F :checkC6 "SKIPPED - no prohibition matched" .
|
|
103
|
+
:scenario_F :checkC7 "OK - trace shows matching permission" .
|
|
104
|
+
:scenario_F :checkC8 "INFO - duties attached: duty:https://w3id.org/dpv/legal/eu/ehds#annualOutcomeReport, duty:https://w3id.org/dpv/legal/eu/ehds#noReidentification, duty:https://w3id.org/dpv/legal/eu/ehds#noExfiltration" .
|
|
105
|
+
:scenario_F :checkC9 "OK - operator=eq, allowed=\"secure_env\", requested=\"secure_env\"" .
|
|
106
|
+
:scenario_F :checkC10Text "INFO - matched policy: urn:policy:research-aurora-diabetes" .
|
|
107
|
+
:out_060_F log:outputString "=== F – Research on anonymised dataset ===\nResearcher using anonymised labs + summary in a secure environment, with opt-in.\n\nAnswer\nPERMIT\n\nReason Why\nPermitted: subject opted in and an ODRL/DPV policy matched (anonymised dataset in secure environment).\n\nCheck\nC1 SKIPPED - not a prohibited purpose\nC2 SKIPPED\nC3 SKIPPED\nC4 OK - opt-in present and policy matched\nC5 OK - operator=isAnyOf, allowed=[\"https://example.org/health#LAB_RESULTS\",\"https://example.org/health#PATIENT_SUMMARY\",\"https://example.org/health#IMAGING_REPORT\"], requested=[\"https://example.org/health#PATIENT_SUMMARY\",\"https://example.org/health#LAB_RESULTS\"]\nC6 SKIPPED - no prohibition matched\nC7 OK - trace shows matching permission\nC8 INFO - duties attached: duty:https://w3id.org/dpv/legal/eu/ehds#annualOutcomeReport, duty:https://w3id.org/dpv/legal/eu/ehds#noReidentification, duty:https://w3id.org/dpv/legal/eu/ehds#noExfiltration\nC9 OK - operator=eq, allowed=\"secure_env\", requested=\"secure_env\"\nC10 INFO - matched policy: urn:policy:research-aurora-diabetes\n\n" .
|
|
108
|
+
:scenario_G :checkC1 "SKIPPED - not a prohibited purpose" .
|
|
109
|
+
:scenario_G :checkC2 "SKIPPED" .
|
|
110
|
+
:scenario_G :checkC3 "SKIPPED" .
|
|
111
|
+
:scenario_G :checkC4 "OK - denied because opt-in missing or no policy match" .
|
|
112
|
+
:scenario_G :checkC5 "SKIPPED" .
|
|
113
|
+
:scenario_G :checkC6 "SKIPPED - no prohibition matched" .
|
|
114
|
+
:scenario_G :checkC7 "SKIPPED" .
|
|
115
|
+
:scenario_G :checkC8 "SKIPPED - no matched policy or no duties" .
|
|
116
|
+
:scenario_G :checkC9 "SKIPPED" .
|
|
117
|
+
:scenario_G :checkC10Text "SKIPPED - no matched policy" .
|
|
118
|
+
:out_070_G log:outputString "=== G – AI training (opt-out) ===\nData user wants to train AI, but the subject opted out of AI training.\n\nAnswer\nDENY\n\nReason Why\nDenied: you opted out of your data being used to train AI systems.\n\nCheck\nC1 SKIPPED - not a prohibited purpose\nC2 SKIPPED\nC3 SKIPPED\nC4 OK - denied because opt-in missing or no policy match\nC5 SKIPPED\nC6 SKIPPED - no prohibition matched\nC7 SKIPPED\nC8 SKIPPED - no matched policy or no duties\nC9 SKIPPED\nC10 SKIPPED - no matched policy\n\n" .
|
|
@@ -1,5 +1,28 @@
|
|
|
1
|
-
@prefix : <https://
|
|
1
|
+
@prefix : <https://example.org/control-system#> .
|
|
2
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
2
3
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
3
4
|
|
|
4
5
|
:actuator1 :control1 "39.27346198678276"^^xsd:decimal .
|
|
5
6
|
:actuator2 :control1 "26.08"^^xsd:decimal .
|
|
7
|
+
:why :sensorTrend "rising" .
|
|
8
|
+
:why :sensorLow 6 .
|
|
9
|
+
:why :sensorHigh 11 .
|
|
10
|
+
:why :sensorGap 5 .
|
|
11
|
+
:why :normalizedMeasurement "2.23606797749979"^^xsd:decimal .
|
|
12
|
+
:why :feedforwardProportional "43.82693235899588"^^xsd:decimal .
|
|
13
|
+
:why :disturbanceMagnitude 35766 .
|
|
14
|
+
:why :disturbanceCompensation "4.553470372213121"^^xsd:decimal .
|
|
15
|
+
:why :feedforwardCommand "39.27346198678276"^^xsd:decimal .
|
|
16
|
+
:why :observedState 22 .
|
|
17
|
+
:why :measuredOutput 24 .
|
|
18
|
+
:why :targetOutput 29 .
|
|
19
|
+
:why :trackingError 5 .
|
|
20
|
+
:why :differentialError -2 .
|
|
21
|
+
:why :feedbackProportional "29"^^xsd:decimal .
|
|
22
|
+
:why :feedbackFactor "1.46"^^xsd:decimal .
|
|
23
|
+
:why :feedbackDifferential "-2.92"^^xsd:decimal .
|
|
24
|
+
:why :feedbackCommand "26.08"^^xsd:decimal .
|
|
25
|
+
:decision :answer "Send both actuator commands now." .
|
|
26
|
+
:decision :actuator1Command "39.27346198678276"^^xsd:decimal .
|
|
27
|
+
:decision :actuator2Command "26.08"^^xsd:decimal .
|
|
28
|
+
:report log:outputString "Control System — ARC explanation of two control signals\n\nAnswer\nSend both actuator commands now.\nActuator 1 command: 39.27346198678276\nActuator 2 command: 26.08\n\nReason Why\nThe first sensor pair is 6 and 11, so the reading is rising and the controller normalizes the gap 5 into 2.23606797749979. That normalized value creates a feedforward term of 43.82693235899588, while the known disturbance 35766 contributes a compensation term of 4.553470372213121. Subtracting that compensation gives actuator 1 the command 39.27346198678276. For actuator 2, the target is 5 units above the measured output, so the tracking error is positive. The observed state is -2 relative units below the measured output, so the differential correction is negative. That yields a proportional feedback part of 29, a nonlinear factor of 1.46, and a differential contribution of -2.92. Together they produce actuator 2 command 26.08.\n\nCheck\nC1 OK - the first sensor pair is rising, so the normalization uses the rising-branch rule.\nC2 OK - the normalized measurement is positive and smaller than the raw gap, which is consistent with a square-root normalization.\nC3 OK - actuator 1 is lower than its proportional feedforward term because disturbance compensation is subtracted.\nC4 OK - the target is above the measured output, so the tracking error is positive.\nC5 OK - the observed state is below the measured output, so the differential error is negative.\nC6 OK - actuator 2 is lower than its pure proportional term because the differential part reduces it.\nC7 OK - actuator 1 matches an independently reconstructed feedforward calculation.\nC8 OK - actuator 2 matches an independently reconstructed feedback calculation.\nC9 OK - both actuator commands stay positive.\n" .
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@prefix : <https://example.org/delfour#> .
|
|
2
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
3
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
4
|
+
|
|
5
|
+
:check :filesWrittenExpected true .
|
|
6
|
+
:case :needsLowSugar true .
|
|
7
|
+
:check :signatureVerifies true .
|
|
8
|
+
<https://example.org/insight/delfour> :derivedFromNeed "low_sugar" .
|
|
9
|
+
:out20 log:outputString "signature verifies : yes\n" .
|
|
10
|
+
:check :payloadHashMatches true .
|
|
11
|
+
:check :minimizationStripsSensitiveTerms true .
|
|
12
|
+
:check :scopeComplete true .
|
|
13
|
+
:decision :at "2025-10-05T20:35:48.907163+00:00"^^xsd:dateTime .
|
|
14
|
+
:decision :outcome "Allowed" .
|
|
15
|
+
:decision :target <https://example.org/insight/delfour> .
|
|
16
|
+
:check :authorizationAllowed true .
|
|
17
|
+
:banner :headline "Track sugar per serving while you scan" .
|
|
18
|
+
:banner :note "High sugar" .
|
|
19
|
+
:check :bannerFlagsHighSugar true .
|
|
20
|
+
:check :dutyTimingConsistent true .
|
|
21
|
+
:check :marketingProhibited true .
|
|
22
|
+
:out10 log:outputString "threshold : 10.0\n" .
|
|
23
|
+
:out13 log:outputString "signature alg : HMAC-SHA256\n" .
|
|
24
|
+
:out14 log:outputString "banner headline : Track sugar per serving while you scan\n" .
|
|
25
|
+
:out16 log:outputString "reason.txt : Household requires low-sugar guidance (diabetes in POD). A neutral Insight is scoped to device 'self-scanner', event 'pick_up_scanner', retailer 'Delfour', and expires soon; the policy confines use to shopping assistance.\n" .
|
|
26
|
+
:out17 log:outputString "audit entries : 1\n" .
|
|
27
|
+
:out18 log:outputString "bus files written : 6\n" .
|
|
28
|
+
:out21 log:outputString "payload hash matches : yes\n" .
|
|
29
|
+
:out22 log:outputString "minimization strips sensitive terms: yes\n" .
|
|
30
|
+
:out23 log:outputString "scope complete : yes\n" .
|
|
31
|
+
:out24 log:outputString "authorization allowed : yes\n" .
|
|
32
|
+
:out25 log:outputString "high-sugar banner : yes\n" .
|
|
33
|
+
:out27 log:outputString "duty timing consistent : yes\n" .
|
|
34
|
+
:out28 log:outputString "marketing prohibited : yes\n" .
|
|
35
|
+
:case :suggestedAlternative :prod_BIS_101 .
|
|
36
|
+
:banner :suggestedAlternative "Low-Sugar Tea Biscuits" .
|
|
37
|
+
:check :alternativeIsLowerSugar true .
|
|
38
|
+
:result :allChecksPass true .
|
|
39
|
+
:out06 log:outputString "suggested alternative: Low-Sugar Tea Biscuits\n" .
|
|
40
|
+
:out26 log:outputString "alternative lowers sugar : yes\n" .
|
package/examples/output/gps.n3
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
@prefix : <https://
|
|
2
|
-
@prefix gps: <https://
|
|
1
|
+
@prefix : <https://example.org/gps-case#> .
|
|
2
|
+
@prefix gps: <https://example.org/gps#> .
|
|
3
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
3
4
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
4
5
|
|
|
5
6
|
:i1 gps:path ((:drive_gent_brugge :drive_brugge_oostende) "2400"^^xsd:decimal "0.01"^^xsd:decimal "0.9408"^^xsd:decimal "0.99"^^xsd:decimal) .
|
|
6
7
|
:i1 gps:path ((:drive_gent_kortrijk :drive_kortrijk_brugge :drive_brugge_oostende) "4100"^^xsd:decimal "0.018"^^xsd:decimal "0.903168"^^xsd:decimal "0.9801"^^xsd:decimal) .
|
|
8
|
+
:routeDirect :duration "2400"^^xsd:decimal .
|
|
9
|
+
:routeDirect :cost "0.01"^^xsd:decimal .
|
|
10
|
+
:routeDirect :belief "0.9408"^^xsd:decimal .
|
|
11
|
+
:routeDirect :comfort "0.99"^^xsd:decimal .
|
|
12
|
+
:routeViaKortrijk :duration "4100"^^xsd:decimal .
|
|
13
|
+
:routeViaKortrijk :cost "0.018"^^xsd:decimal .
|
|
14
|
+
:routeViaKortrijk :belief "0.903168"^^xsd:decimal .
|
|
15
|
+
:routeViaKortrijk :comfort "0.9801"^^xsd:decimal .
|
|
16
|
+
:decision :recommendedRoute :routeDirect .
|
|
17
|
+
:decision :outcome "Take the direct route via Brugge." .
|
|
18
|
+
:report log:outputString "GPS — Goal driven route planning\n\nAnswer\nTake the direct route via Brugge.\nRecommended route: Gent → Brugge → Oostende\n\nReason Why\nFrom Gent to Oostende, the planner found two routes in this small map. The direct route (Gent → Brugge → Oostende) takes 2400 seconds at cost 0.01, with belief 0.9408 and comfort 0.99. The alternative (Gent → Kortrijk → Brugge → Oostende) takes 4100 seconds at cost 0.018, with belief 0.903168 and comfort 0.9801. So the direct route is faster, cheaper, more reliable, and slightly more comfortable.\n\nCheck\nC1 OK - the direct Gent → Brugge → Oostende route was derived.\nC2 OK - the alternative Gent → Kortrijk → Brugge → Oostende route was derived.\nC3 OK - the recommended route is faster than the alternative.\nC4 OK - the recommended route is cheaper than the alternative.\nC5 OK - the recommended route has higher belief and comfort scores.\n" .
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@prefix : <http://example.org/#> .
|
|
2
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
3
|
+
|
|
4
|
+
(:badBool :p "truish"^^xsd:boolean) :datatype xsd:boolean .
|
|
5
|
+
(:badBool :p "truish"^^xsd:boolean) :lexicalForm "truish" .
|
|
6
|
+
(:badBool :p "truish"^^xsd:boolean) :reason "invalid xsd:boolean lexical form" .
|
|
7
|
+
(:badDate :p "yesterday"^^xsd:dateTime) :datatype xsd:dateTime .
|
|
8
|
+
(:badDate :p "yesterday"^^xsd:dateTime) :lexicalForm "yesterday" .
|
|
9
|
+
(:badDate :p "yesterday"^^xsd:dateTime) :reason "xsd:dateTime literal is not parseable by the reasoner" .
|
|
10
|
+
(:badDateTime :p "not-a-datetime"^^xsd:dateTime) :datatype xsd:dateTime .
|
|
11
|
+
(:badDateTime :p "not-a-datetime"^^xsd:dateTime) :lexicalForm "not-a-datetime" .
|
|
12
|
+
(:badDateTime :p "not-a-datetime"^^xsd:dateTime) :reason "xsd:dateTime literal is not parseable by the reasoner" .
|
|
13
|
+
(:badDecimal :p "12.3.4"^^xsd:decimal) :datatype xsd:decimal .
|
|
14
|
+
(:badDecimal :p "12.3.4"^^xsd:decimal) :lexicalForm "12.3.4" .
|
|
15
|
+
(:badDecimal :p "12.3.4"^^xsd:decimal) :reason "invalid xsd:decimal lexical form" .
|
|
16
|
+
(:badDouble :p "1e"^^xsd:double) :datatype xsd:double .
|
|
17
|
+
(:badDouble :p "1e"^^xsd:double) :lexicalForm "1e" .
|
|
18
|
+
(:badDouble :p "1e"^^xsd:double) :reason "invalid xsd:float/xsd:double lexical form" .
|
|
19
|
+
(:badDuration :p "not-a-duration"^^xsd:duration) :datatype xsd:duration .
|
|
20
|
+
(:badDuration :p "not-a-duration"^^xsd:duration) :lexicalForm "not-a-duration" .
|
|
21
|
+
(:badDuration :p "not-a-duration"^^xsd:duration) :reason "xsd:duration literal is not parseable by the reasoner" .
|
|
22
|
+
(:badInt1 :p "abc"^^xsd:integer) :datatype xsd:integer .
|
|
23
|
+
(:badInt1 :p "abc"^^xsd:integer) :lexicalForm "abc" .
|
|
24
|
+
(:badInt1 :p "abc"^^xsd:integer) :reason "invalid integer-family lexical form" .
|
|
25
|
+
(:badInt2 :p "12.3"^^xsd:int) :datatype xsd:int .
|
|
26
|
+
(:badInt2 :p "12.3"^^xsd:int) :lexicalForm "12.3" .
|
|
27
|
+
(:badInt2 :p "12.3"^^xsd:int) :reason "invalid integer-family lexical form" .
|