eyeling 1.5.22 → 1.5.24
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 +1 -2
- package/examples/age.n3 +2 -3
- package/examples/backward.n3 +2 -3
- package/examples/basic-monadic.n3 +2 -3
- package/examples/cat-koko.n3 +5 -6
- package/examples/collect-all-in.n3 +6 -6
- package/examples/complex.n3 +2 -3
- package/examples/control-system.n3 +2 -2
- package/examples/crypto-builtins-tests.n3 +2 -2
- package/examples/deep-taxonomy-10.n3 +5 -0
- package/examples/deep-taxonomy-100.n3 +5 -0
- package/examples/deep-taxonomy-1000.n3 +5 -0
- package/examples/deep-taxonomy-10000.n3 +5 -0
- package/examples/derived-backward-rule-2.n3 +2 -3
- package/examples/derived-backward-rule.n3 +2 -2
- package/examples/derived-rule.n3 +2 -2
- package/examples/dijkstra.n3 +2 -3
- package/examples/dog.n3 +2 -3
- package/examples/drone-corridor-planner-v2.n3 +237 -0
- package/examples/drone-corridor-planner.n3 +131 -0
- package/examples/equals.n3 +3 -4
- package/examples/existential-rule.n3 +2 -2
- package/examples/expression-eval.n3 +2 -6
- package/examples/family-cousins.n3 +2 -4
- package/examples/fibonacci.n3 +2 -3
- package/examples/for-all-in.n3 +2 -2
- package/examples/french-cities.n3 +2 -3
- package/examples/fuse.n3 +2 -2
- package/examples/good-cobbler.n3 +2 -3
- package/examples/gps.n3 +2 -4
- package/examples/gray-code-counter.n3 +2 -5
- package/examples/hanoi.n3 +2 -3
- package/examples/liar.n3 +5 -0
- package/examples/light-eaters.n3 +2 -4
- package/examples/list-builtins-tests.n3 +27 -15
- package/examples/lldm.n3 +3 -4
- package/examples/math-builtins-tests.n3 +32 -134
- package/examples/monkey.n3 +2 -3
- package/examples/odrl-trust.n3 +2 -6
- package/examples/output/drone-corridor-planner-v2.n3 +819 -0
- package/examples/output/drone-corridor-planner.n3 +153 -0
- package/examples/output/list-builtins-tests.n3 +32 -0
- package/examples/output/pillar.n3 +36 -0
- package/examples/peano.n3 +2 -3
- package/examples/pi.n3 +2 -3
- package/examples/pillar.n3 +23 -0
- package/examples/polygon.n3 +2 -3
- package/examples/reordering.n3 +2 -3
- package/examples/rule-matching.n3 +2 -3
- package/examples/self-referential.n3 +3 -4
- package/examples/similar.n3 +3 -4
- package/examples/skolem.n3 +2 -2
- package/examples/snaf.n3 +2 -2
- package/examples/socrates.n3 +2 -2
- package/examples/spectral-week.n3 +2 -7
- package/examples/string-builtins-tests.n3 +19 -51
- package/examples/turing.n3 +2 -3
- package/examples/uri.n3 +2 -2
- package/examples/witch.n3 +2 -2
- package/examples/zebra.n3 +2 -2
- package/eyeling.js +30 -0
- package/package.json +1 -1
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
@prefix : <https://eyereasoner.github.io/eye/reasoning#> .
|
|
2
|
+
@prefix gps: <https://eyereasoner.github.io/eye/reasoning/gps/gps-schema#> .
|
|
3
|
+
|
|
4
|
+
# ----------------------------------------------------------------------
|
|
5
|
+
# Proof for derived triple:
|
|
6
|
+
# :d1 gps:plan ((:fly_gent_kortrijk :get_zone_permit :fly_kortrijk_brugge :quick_charge_brugge :cross_corridor_brugge_oostende) 5000 0.023 0.958577964498 0.9506969999999999 (:t)) .
|
|
7
|
+
# It holds because the following instance of the rule body is provable:
|
|
8
|
+
# :fuel6 :value (:t :t :t :t :t :t) .
|
|
9
|
+
# ({
|
|
10
|
+
# :d1 :location :Gent .
|
|
11
|
+
# :d1 :battery :full .
|
|
12
|
+
# :d1 :permit :none .
|
|
13
|
+
# } {
|
|
14
|
+
# :d1 :location :Oostende .
|
|
15
|
+
# :d1 :battery :mid .
|
|
16
|
+
# :d1 :permit :yes .
|
|
17
|
+
# } (:fly_gent_kortrijk :get_zone_permit :fly_kortrijk_brugge :quick_charge_brugge :cross_corridor_brugge_oostende) 5000 0.023 0.958577964498 0.9506969999999999 (:t :t :t :t :t :t) (:t)) :path true .
|
|
18
|
+
# 0.958577964498 math:greaterThan 0.95 .
|
|
19
|
+
# 0.023 math:lessThan 0.05 .
|
|
20
|
+
# via the schematic forward rule:
|
|
21
|
+
# {
|
|
22
|
+
# :fuel6 :value ?Fuel .
|
|
23
|
+
# ({
|
|
24
|
+
# :d1 :location :Gent .
|
|
25
|
+
# :d1 :battery :full .
|
|
26
|
+
# :d1 :permit :none .
|
|
27
|
+
# } {
|
|
28
|
+
# :d1 :location :Oostende .
|
|
29
|
+
# :d1 :battery ?B .
|
|
30
|
+
# :d1 :permit ?P .
|
|
31
|
+
# } ?Acts ?Dur ?Cost ?Bel ?Comf ?Fuel ?FuelLeft) :path true .
|
|
32
|
+
# ?Bel math:greaterThan 0.95 .
|
|
33
|
+
# ?Cost math:lessThan 0.05 .
|
|
34
|
+
# } => {
|
|
35
|
+
# :d1 gps:plan (?Acts ?Dur ?Cost ?Bel ?Comf ?FuelLeft) .
|
|
36
|
+
# :d1 :finalBattery ?B .
|
|
37
|
+
# :d1 :finalPermit ?P .
|
|
38
|
+
# } .
|
|
39
|
+
# with substitution (on rule variables):
|
|
40
|
+
# ?Acts = (:fly_gent_kortrijk :get_zone_permit :fly_kortrijk_brugge :quick_charge_brugge :cross_corridor_brugge_oostende)
|
|
41
|
+
# ?B = :mid
|
|
42
|
+
# ?Bel = 0.958577964498
|
|
43
|
+
# ?Comf = 0.9506969999999999
|
|
44
|
+
# ?Cost = 0.023
|
|
45
|
+
# ?Dur = 5000
|
|
46
|
+
# ?Fuel = (:t :t :t :t :t :t)
|
|
47
|
+
# ?FuelLeft = (:t)
|
|
48
|
+
# ?P = :yes
|
|
49
|
+
# Therefore the derived triple above is entailed by the rules and facts.
|
|
50
|
+
# ----------------------------------------------------------------------
|
|
51
|
+
|
|
52
|
+
:d1 gps:plan ((:fly_gent_kortrijk :get_zone_permit :fly_kortrijk_brugge :quick_charge_brugge :cross_corridor_brugge_oostende) 5000 0.023 0.958577964498 0.9506969999999999 (:t)) .
|
|
53
|
+
|
|
54
|
+
# ----------------------------------------------------------------------
|
|
55
|
+
# Proof for derived triple:
|
|
56
|
+
# :d1 :finalBattery :mid .
|
|
57
|
+
# It holds because the following instance of the rule body is provable:
|
|
58
|
+
# :fuel6 :value (:t :t :t :t :t :t) .
|
|
59
|
+
# ({
|
|
60
|
+
# :d1 :location :Gent .
|
|
61
|
+
# :d1 :battery :full .
|
|
62
|
+
# :d1 :permit :none .
|
|
63
|
+
# } {
|
|
64
|
+
# :d1 :location :Oostende .
|
|
65
|
+
# :d1 :battery :mid .
|
|
66
|
+
# :d1 :permit :yes .
|
|
67
|
+
# } (:fly_gent_kortrijk :get_zone_permit :fly_kortrijk_brugge :quick_charge_brugge :cross_corridor_brugge_oostende) 5000 0.023 0.958577964498 0.9506969999999999 (:t :t :t :t :t :t) (:t)) :path true .
|
|
68
|
+
# 0.958577964498 math:greaterThan 0.95 .
|
|
69
|
+
# 0.023 math:lessThan 0.05 .
|
|
70
|
+
# via the schematic forward rule:
|
|
71
|
+
# {
|
|
72
|
+
# :fuel6 :value ?Fuel .
|
|
73
|
+
# ({
|
|
74
|
+
# :d1 :location :Gent .
|
|
75
|
+
# :d1 :battery :full .
|
|
76
|
+
# :d1 :permit :none .
|
|
77
|
+
# } {
|
|
78
|
+
# :d1 :location :Oostende .
|
|
79
|
+
# :d1 :battery ?B .
|
|
80
|
+
# :d1 :permit ?P .
|
|
81
|
+
# } ?Acts ?Dur ?Cost ?Bel ?Comf ?Fuel ?FuelLeft) :path true .
|
|
82
|
+
# ?Bel math:greaterThan 0.95 .
|
|
83
|
+
# ?Cost math:lessThan 0.05 .
|
|
84
|
+
# } => {
|
|
85
|
+
# :d1 gps:plan (?Acts ?Dur ?Cost ?Bel ?Comf ?FuelLeft) .
|
|
86
|
+
# :d1 :finalBattery ?B .
|
|
87
|
+
# :d1 :finalPermit ?P .
|
|
88
|
+
# } .
|
|
89
|
+
# with substitution (on rule variables):
|
|
90
|
+
# ?Acts = (:fly_gent_kortrijk :get_zone_permit :fly_kortrijk_brugge :quick_charge_brugge :cross_corridor_brugge_oostende)
|
|
91
|
+
# ?B = :mid
|
|
92
|
+
# ?Bel = 0.958577964498
|
|
93
|
+
# ?Comf = 0.9506969999999999
|
|
94
|
+
# ?Cost = 0.023
|
|
95
|
+
# ?Dur = 5000
|
|
96
|
+
# ?Fuel = (:t :t :t :t :t :t)
|
|
97
|
+
# ?FuelLeft = (:t)
|
|
98
|
+
# ?P = :yes
|
|
99
|
+
# Therefore the derived triple above is entailed by the rules and facts.
|
|
100
|
+
# ----------------------------------------------------------------------
|
|
101
|
+
|
|
102
|
+
:d1 :finalBattery :mid .
|
|
103
|
+
|
|
104
|
+
# ----------------------------------------------------------------------
|
|
105
|
+
# Proof for derived triple:
|
|
106
|
+
# :d1 :finalPermit :yes .
|
|
107
|
+
# It holds because the following instance of the rule body is provable:
|
|
108
|
+
# :fuel6 :value (:t :t :t :t :t :t) .
|
|
109
|
+
# ({
|
|
110
|
+
# :d1 :location :Gent .
|
|
111
|
+
# :d1 :battery :full .
|
|
112
|
+
# :d1 :permit :none .
|
|
113
|
+
# } {
|
|
114
|
+
# :d1 :location :Oostende .
|
|
115
|
+
# :d1 :battery :mid .
|
|
116
|
+
# :d1 :permit :yes .
|
|
117
|
+
# } (:fly_gent_kortrijk :get_zone_permit :fly_kortrijk_brugge :quick_charge_brugge :cross_corridor_brugge_oostende) 5000 0.023 0.958577964498 0.9506969999999999 (:t :t :t :t :t :t) (:t)) :path true .
|
|
118
|
+
# 0.958577964498 math:greaterThan 0.95 .
|
|
119
|
+
# 0.023 math:lessThan 0.05 .
|
|
120
|
+
# via the schematic forward rule:
|
|
121
|
+
# {
|
|
122
|
+
# :fuel6 :value ?Fuel .
|
|
123
|
+
# ({
|
|
124
|
+
# :d1 :location :Gent .
|
|
125
|
+
# :d1 :battery :full .
|
|
126
|
+
# :d1 :permit :none .
|
|
127
|
+
# } {
|
|
128
|
+
# :d1 :location :Oostende .
|
|
129
|
+
# :d1 :battery ?B .
|
|
130
|
+
# :d1 :permit ?P .
|
|
131
|
+
# } ?Acts ?Dur ?Cost ?Bel ?Comf ?Fuel ?FuelLeft) :path true .
|
|
132
|
+
# ?Bel math:greaterThan 0.95 .
|
|
133
|
+
# ?Cost math:lessThan 0.05 .
|
|
134
|
+
# } => {
|
|
135
|
+
# :d1 gps:plan (?Acts ?Dur ?Cost ?Bel ?Comf ?FuelLeft) .
|
|
136
|
+
# :d1 :finalBattery ?B .
|
|
137
|
+
# :d1 :finalPermit ?P .
|
|
138
|
+
# } .
|
|
139
|
+
# with substitution (on rule variables):
|
|
140
|
+
# ?Acts = (:fly_gent_kortrijk :get_zone_permit :fly_kortrijk_brugge :quick_charge_brugge :cross_corridor_brugge_oostende)
|
|
141
|
+
# ?B = :mid
|
|
142
|
+
# ?Bel = 0.958577964498
|
|
143
|
+
# ?Comf = 0.9506969999999999
|
|
144
|
+
# ?Cost = 0.023
|
|
145
|
+
# ?Dur = 5000
|
|
146
|
+
# ?Fuel = (:t :t :t :t :t :t)
|
|
147
|
+
# ?FuelLeft = (:t)
|
|
148
|
+
# ?P = :yes
|
|
149
|
+
# Therefore the derived triple above is entailed by the rules and facts.
|
|
150
|
+
# ----------------------------------------------------------------------
|
|
151
|
+
|
|
152
|
+
:d1 :finalPermit :yes .
|
|
153
|
+
|
|
@@ -146,3 +146,35 @@
|
|
|
146
146
|
|
|
147
147
|
:ok_list_remove_1 a :Pass .
|
|
148
148
|
|
|
149
|
+
# ----------------------------------------------------------------------
|
|
150
|
+
# Proof for derived triple:
|
|
151
|
+
# :ok_list_rest_1 a :Pass .
|
|
152
|
+
# It holds because the following instance of the rule body is provable:
|
|
153
|
+
# (1 2 3 4) list:rest (2 3 4) .
|
|
154
|
+
# via the schematic forward rule:
|
|
155
|
+
# {
|
|
156
|
+
# (1 2 3 4) list:rest (2 3 4) .
|
|
157
|
+
# } => {
|
|
158
|
+
# :ok_list_rest_1 a :Pass .
|
|
159
|
+
# } .
|
|
160
|
+
# Therefore the derived triple above is entailed by the rules and facts.
|
|
161
|
+
# ----------------------------------------------------------------------
|
|
162
|
+
|
|
163
|
+
:ok_list_rest_1 a :Pass .
|
|
164
|
+
|
|
165
|
+
# ----------------------------------------------------------------------
|
|
166
|
+
# Proof for derived triple:
|
|
167
|
+
# :ok_list_firstRest_1 a :Pass .
|
|
168
|
+
# It holds because the following instance of the rule body is provable:
|
|
169
|
+
# (1 2 3 4) list:firstRest (1 (2 3 4)) .
|
|
170
|
+
# via the schematic forward rule:
|
|
171
|
+
# {
|
|
172
|
+
# (1 2 3 4) list:firstRest (1 (2 3 4)) .
|
|
173
|
+
# } => {
|
|
174
|
+
# :ok_list_firstRest_1 a :Pass .
|
|
175
|
+
# } .
|
|
176
|
+
# Therefore the derived triple above is entailed by the rules and facts.
|
|
177
|
+
# ----------------------------------------------------------------------
|
|
178
|
+
|
|
179
|
+
:ok_list_firstRest_1 a :Pass .
|
|
180
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@prefix : <http://example.org/socrates#> .
|
|
2
|
+
|
|
3
|
+
# ----------------------------------------------------------------------
|
|
4
|
+
# Proof for derived triple:
|
|
5
|
+
# :result :is :Post .
|
|
6
|
+
# It holds because the following instance of the rule body is provable:
|
|
7
|
+
# :Pillar :to :Post .
|
|
8
|
+
# via the schematic forward rule:
|
|
9
|
+
# {
|
|
10
|
+
# :Pillar :to ?What .
|
|
11
|
+
# } => {
|
|
12
|
+
# :result :is ?What .
|
|
13
|
+
# } .
|
|
14
|
+
# with substitution (on rule variables):
|
|
15
|
+
# ?What = :Post
|
|
16
|
+
# Therefore the derived triple above is entailed by the rules and facts.
|
|
17
|
+
# ----------------------------------------------------------------------
|
|
18
|
+
|
|
19
|
+
:result :is :Post .
|
|
20
|
+
|
|
21
|
+
# ----------------------------------------------------------------------
|
|
22
|
+
# Proof for derived triple:
|
|
23
|
+
# :test :is true .
|
|
24
|
+
# It holds because the following instance of the rule body is provable:
|
|
25
|
+
# :result :is :Post .
|
|
26
|
+
# via the schematic forward rule:
|
|
27
|
+
# {
|
|
28
|
+
# :result :is :Post .
|
|
29
|
+
# } => {
|
|
30
|
+
# :test :is true .
|
|
31
|
+
# } .
|
|
32
|
+
# Therefore the derived triple above is entailed by the rules and facts.
|
|
33
|
+
# ----------------------------------------------------------------------
|
|
34
|
+
|
|
35
|
+
:test :is true .
|
|
36
|
+
|
package/examples/peano.n3
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ==============================================
|
|
2
2
|
# Peano arithmetic
|
|
3
|
-
# ----------------
|
|
4
|
-
#
|
|
5
3
|
# See https://en.wikipedia.org/wiki/Peano_axioms
|
|
4
|
+
# ==============================================
|
|
6
5
|
|
|
7
6
|
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
|
|
8
7
|
@prefix : <http://example.org/#>.
|
package/examples/pi.n3
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# =======================================
|
|
2
2
|
# Calculate pi using Nilakantha series
|
|
3
|
-
# ------------------------------------
|
|
4
|
-
#
|
|
5
3
|
# See http://www.wikihow.com/Calculate-Pi
|
|
4
|
+
# =======================================
|
|
6
5
|
|
|
7
6
|
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
8
7
|
@prefix : <https://eyereasoner.github.io/eye/reasoning#>.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# =================================
|
|
2
|
+
# Pillar example
|
|
3
|
+
# Example from Patrick Hochstenbach
|
|
4
|
+
# =================================
|
|
5
|
+
|
|
6
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
|
|
7
|
+
@prefix : <http://example.org/socrates#>.
|
|
8
|
+
|
|
9
|
+
:Post :to :Pillar .
|
|
10
|
+
|
|
11
|
+
{ :Pillar :to ?What } <= { ?What :to :Pillar }.
|
|
12
|
+
|
|
13
|
+
{ ?What :to :Pillar } <= { :Pillar :to ?What }.
|
|
14
|
+
|
|
15
|
+
{ :Pillar :to ?What } => { :result :is ?What }.
|
|
16
|
+
|
|
17
|
+
{
|
|
18
|
+
:result :is :Post
|
|
19
|
+
}
|
|
20
|
+
=>
|
|
21
|
+
{
|
|
22
|
+
:test :is true
|
|
23
|
+
}.
|
package/examples/polygon.n3
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# =====================================================
|
|
2
2
|
# Polygon
|
|
3
|
-
# -------
|
|
4
|
-
#
|
|
5
3
|
# Calculate the area of a polygon.
|
|
6
4
|
# See https://www.mathopenref.com/coordpolygonarea.html
|
|
5
|
+
# =====================================================
|
|
7
6
|
|
|
8
7
|
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
9
8
|
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
|
package/examples/reordering.n3
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# =================================
|
|
2
2
|
# Premise reordering example
|
|
3
|
-
# --------------------------
|
|
4
|
-
#
|
|
5
3
|
# Example from Patrick Hochstenbach
|
|
4
|
+
# =================================
|
|
6
5
|
|
|
7
6
|
@prefix : <https://eyereasoner.github.io/ns#>.
|
|
8
7
|
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# =================================
|
|
2
2
|
# Self referential
|
|
3
|
-
# ----------------
|
|
4
|
-
#
|
|
5
3
|
# Example from Patrick Hochstenbach
|
|
4
|
+
# =================================
|
|
6
5
|
|
|
7
6
|
@prefix : <https://eyereasoner.github.io/ns#>.
|
|
8
7
|
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
|
|
@@ -26,7 +25,7 @@
|
|
|
26
25
|
{
|
|
27
26
|
:answer :contains :contains, log:implies .
|
|
28
27
|
}
|
|
29
|
-
=>
|
|
28
|
+
=>
|
|
30
29
|
{
|
|
31
30
|
:test :is true
|
|
32
31
|
}.
|
package/examples/similar.n3
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# =================================
|
|
2
2
|
# Similar
|
|
3
|
-
# -------
|
|
4
|
-
#
|
|
5
3
|
# Example from Patrick Hochstenbach
|
|
4
|
+
# =================================
|
|
6
5
|
|
|
7
6
|
@prefix : <https://eyereasoner.github.io/ns#>.
|
|
8
7
|
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
|
|
@@ -25,4 +24,4 @@
|
|
|
25
24
|
{
|
|
26
25
|
?A ?Pred ?Obj .
|
|
27
26
|
?B ?Pred ?Obj .
|
|
28
|
-
}.
|
|
27
|
+
}.
|
package/examples/skolem.n3
CHANGED
package/examples/snaf.n3
CHANGED
package/examples/socrates.n3
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# =============
|
|
2
2
|
# Spectral week
|
|
3
|
-
#
|
|
3
|
+
# =============
|
|
4
4
|
|
|
5
5
|
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
|
|
6
6
|
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
# ------------------------------------------------------------
|
|
10
10
|
# Spectral light intake (red + blue) and weekly energy storage
|
|
11
11
|
# ------------------------------------------------------------
|
|
12
|
-
|
|
13
12
|
# Locations: daily hours of red/blue light, and intensity per hour.
|
|
14
13
|
:Greenhouse :redHours 8.0; :blueHours 2.0;
|
|
15
14
|
:redIntensity 120.0;
|
|
@@ -32,7 +31,6 @@
|
|
|
32
31
|
# Ered = redIntensity * redHours
|
|
33
32
|
# Eblue = blueIntensity * blueHours
|
|
34
33
|
# ------------------------------------
|
|
35
|
-
|
|
36
34
|
{
|
|
37
35
|
?Loc :redIntensity ?RI; :redHours ?RH.
|
|
38
36
|
(?RI ?RH) math:product ?Ered.
|
|
@@ -53,7 +51,6 @@
|
|
|
53
51
|
# Ablue = Loc.blueEnergy * Plant.absorbBlue
|
|
54
52
|
# absorbed = Ared + Ablue
|
|
55
53
|
# -------------------------------------------
|
|
56
|
-
|
|
57
54
|
{
|
|
58
55
|
?P a :Plant; :location ?Loc; :absorbRed ?AR.
|
|
59
56
|
?Loc :redEnergy ?Ered.
|
|
@@ -81,7 +78,6 @@
|
|
|
81
78
|
# -------------------------------------------------
|
|
82
79
|
# Daily stored energy = absorbedEnergy * conversion
|
|
83
80
|
# -------------------------------------------------
|
|
84
|
-
|
|
85
81
|
{
|
|
86
82
|
?P :absorbedEnergy ?Abs; :conversion ?C.
|
|
87
83
|
(?Abs ?C) math:product ?Stored.
|
|
@@ -92,7 +88,6 @@
|
|
|
92
88
|
# ------------------------------------
|
|
93
89
|
# Weekly stored energy = dailyStored*7
|
|
94
90
|
# ------------------------------------
|
|
95
|
-
|
|
96
91
|
{
|
|
97
92
|
?P :dailyStored ?D.
|
|
98
93
|
(?D 7) math:product ?W.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# =====================
|
|
2
2
|
# string builtins tests
|
|
3
|
-
#
|
|
3
|
+
# =====================
|
|
4
4
|
|
|
5
5
|
@prefix : <https://eyereasoner.github.io/ns#> .
|
|
6
6
|
@prefix string: <http://www.w3.org/2000/10/swap/string#> .
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
# derives a single marker triple:
|
|
14
14
|
# :ok_string_<name>_1 a :Pass .
|
|
15
15
|
|
|
16
|
-
#
|
|
17
|
-
# 4.6.1 string:concatenation
|
|
18
|
-
# ----------------------------------------------------------------------
|
|
16
|
+
# string:concatenation
|
|
19
17
|
|
|
20
18
|
{
|
|
21
19
|
("hello" " " "world!") string:concatenation "hello world!" .
|
|
@@ -25,9 +23,7 @@
|
|
|
25
23
|
:ok_string_concatenation_1 a :Pass .
|
|
26
24
|
} .
|
|
27
25
|
|
|
28
|
-
#
|
|
29
|
-
# 4.6.2 string:contains
|
|
30
|
-
# ----------------------------------------------------------------------
|
|
26
|
+
# string:contains
|
|
31
27
|
|
|
32
28
|
{
|
|
33
29
|
"hello world!" string:contains "llo worl" .
|
|
@@ -37,9 +33,7 @@
|
|
|
37
33
|
:ok_string_contains_1 a :Pass .
|
|
38
34
|
} .
|
|
39
35
|
|
|
40
|
-
#
|
|
41
|
-
# 4.6.3 string:containsIgnoringCase
|
|
42
|
-
# ----------------------------------------------------------------------
|
|
36
|
+
# string:containsIgnoringCase
|
|
43
37
|
|
|
44
38
|
{
|
|
45
39
|
"hello world!" string:containsIgnoringCase "lLO woRl" .
|
|
@@ -49,9 +43,7 @@
|
|
|
49
43
|
:ok_string_containsIgnoringCase_1 a :Pass .
|
|
50
44
|
} .
|
|
51
45
|
|
|
52
|
-
#
|
|
53
|
-
# 4.6.4 string:endsWith
|
|
54
|
-
# ----------------------------------------------------------------------
|
|
46
|
+
# string:endsWith
|
|
55
47
|
|
|
56
48
|
{
|
|
57
49
|
"hello world!" string:endsWith "orld!" .
|
|
@@ -61,9 +53,7 @@
|
|
|
61
53
|
:ok_string_endsWith_1 a :Pass .
|
|
62
54
|
} .
|
|
63
55
|
|
|
64
|
-
#
|
|
65
|
-
# 4.6.5 string:equalIgnoringCase
|
|
66
|
-
# ----------------------------------------------------------------------
|
|
56
|
+
# string:equalIgnoringCase
|
|
67
57
|
|
|
68
58
|
{
|
|
69
59
|
"hello world!" string:equalIgnoringCase "hELLo wORld!" .
|
|
@@ -73,13 +63,11 @@
|
|
|
73
63
|
:ok_string_equalIgnoringCase_1 a :Pass .
|
|
74
64
|
} .
|
|
75
65
|
|
|
76
|
-
#
|
|
77
|
-
# 4.6.6 string:format
|
|
66
|
+
# string:format
|
|
78
67
|
# (eyeling implementation: only %s and %% are required / used here)
|
|
79
|
-
# ----------------------------------------------------------------------
|
|
80
68
|
|
|
81
69
|
{
|
|
82
|
-
("%s://%s/%s" "https" "w3c.github.io" "N3/spec/")
|
|
70
|
+
("%s://%s/%s" "https" "w3c.github.io" "N3/spec/")
|
|
83
71
|
string:format "https://w3c.github.io/N3/spec/" .
|
|
84
72
|
}
|
|
85
73
|
=>
|
|
@@ -87,9 +75,7 @@
|
|
|
87
75
|
:ok_string_format_1 a :Pass .
|
|
88
76
|
} .
|
|
89
77
|
|
|
90
|
-
#
|
|
91
|
-
# 4.6.7 string:greaterThan
|
|
92
|
-
# ----------------------------------------------------------------------
|
|
78
|
+
# string:greaterThan
|
|
93
79
|
|
|
94
80
|
{
|
|
95
81
|
"Penguin" string:greaterThan "Cat" .
|
|
@@ -99,9 +85,7 @@
|
|
|
99
85
|
:ok_string_greaterThan_1 a :Pass .
|
|
100
86
|
} .
|
|
101
87
|
|
|
102
|
-
#
|
|
103
|
-
# 4.6.8 string:lessThan
|
|
104
|
-
# ----------------------------------------------------------------------
|
|
88
|
+
# string:lessThan
|
|
105
89
|
|
|
106
90
|
{
|
|
107
91
|
"Cat" string:lessThan "Penguin" .
|
|
@@ -111,9 +95,7 @@
|
|
|
111
95
|
:ok_string_lessThan_1 a :Pass .
|
|
112
96
|
} .
|
|
113
97
|
|
|
114
|
-
#
|
|
115
|
-
# 4.6.9 string:matches
|
|
116
|
-
# ----------------------------------------------------------------------
|
|
98
|
+
# string:matches
|
|
117
99
|
|
|
118
100
|
{
|
|
119
101
|
"hello world!" string:matches ".*(l)+o wo.*" .
|
|
@@ -123,9 +105,7 @@
|
|
|
123
105
|
:ok_string_matches_1 a :Pass .
|
|
124
106
|
} .
|
|
125
107
|
|
|
126
|
-
#
|
|
127
|
-
# 4.6.10 string:notEqualIgnoringCase
|
|
128
|
-
# ----------------------------------------------------------------------
|
|
108
|
+
# string:notEqualIgnoringCase
|
|
129
109
|
|
|
130
110
|
{
|
|
131
111
|
"hello world!" string:notEqualIgnoringCase "hELLo dunia!" .
|
|
@@ -135,9 +115,7 @@
|
|
|
135
115
|
:ok_string_notEqualIgnoringCase_1 a :Pass .
|
|
136
116
|
} .
|
|
137
117
|
|
|
138
|
-
#
|
|
139
|
-
# 4.6.11 string:notGreaterThan
|
|
140
|
-
# ----------------------------------------------------------------------
|
|
118
|
+
# string:notGreaterThan
|
|
141
119
|
|
|
142
120
|
{
|
|
143
121
|
"Cat" string:notGreaterThan "Penguin" .
|
|
@@ -147,9 +125,7 @@
|
|
|
147
125
|
:ok_string_notGreaterThan_1 a :Pass .
|
|
148
126
|
} .
|
|
149
127
|
|
|
150
|
-
#
|
|
151
|
-
# 4.6.12 string:notLessThan
|
|
152
|
-
# ----------------------------------------------------------------------
|
|
128
|
+
# string:notLessThan
|
|
153
129
|
|
|
154
130
|
{
|
|
155
131
|
"Penguin" string:notLessThan "Cat" .
|
|
@@ -159,9 +135,7 @@
|
|
|
159
135
|
:ok_string_notLessThan_1 a :Pass .
|
|
160
136
|
} .
|
|
161
137
|
|
|
162
|
-
#
|
|
163
|
-
# 4.6.13 string:notMatches
|
|
164
|
-
# ----------------------------------------------------------------------
|
|
138
|
+
# string:notMatches
|
|
165
139
|
|
|
166
140
|
{
|
|
167
141
|
"hello world!" string:notMatches ".*(l)+o dunia.*" .
|
|
@@ -171,9 +145,7 @@
|
|
|
171
145
|
:ok_string_notMatches_1 a :Pass .
|
|
172
146
|
} .
|
|
173
147
|
|
|
174
|
-
#
|
|
175
|
-
# 4.6.14 string:replace
|
|
176
|
-
# ----------------------------------------------------------------------
|
|
148
|
+
# string:replace
|
|
177
149
|
|
|
178
150
|
{
|
|
179
151
|
("fofof bar" "of" "baz") string:replace "fbazbaz bar" .
|
|
@@ -183,10 +155,8 @@
|
|
|
183
155
|
:ok_string_replace_1 a :Pass .
|
|
184
156
|
} .
|
|
185
157
|
|
|
186
|
-
#
|
|
187
|
-
# 4.6.15 string:scrape
|
|
158
|
+
# string:scrape
|
|
188
159
|
# (extracts the first capturing group)
|
|
189
|
-
# ----------------------------------------------------------------------
|
|
190
160
|
|
|
191
161
|
{
|
|
192
162
|
("id=abc&x=123&y=zzz" "x=([0-9]+)") string:scrape "123" .
|
|
@@ -196,9 +166,7 @@
|
|
|
196
166
|
:ok_string_scrape_1 a :Pass .
|
|
197
167
|
} .
|
|
198
168
|
|
|
199
|
-
#
|
|
200
|
-
# 4.6.16 string:startsWith
|
|
201
|
-
# ----------------------------------------------------------------------
|
|
169
|
+
# string:startsWith
|
|
202
170
|
|
|
203
171
|
{
|
|
204
172
|
"hello world!" string:startsWith "hello" .
|
package/examples/turing.n3
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ===========================================================
|
|
2
2
|
# Turing Machine
|
|
3
|
-
# --------------
|
|
4
|
-
#
|
|
5
3
|
# Turing completeness test case.
|
|
6
4
|
# See http://en.wikipedia.org/wiki/Prolog#Turing_completeness
|
|
5
|
+
# ===========================================================
|
|
7
6
|
|
|
8
7
|
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
|
|
9
8
|
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
|
package/examples/uri.n3
CHANGED
package/examples/witch.n3
CHANGED
package/examples/zebra.n3
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ============================================================================================================
|
|
2
2
|
# Einstein Riddle
|
|
3
|
-
# ---------------
|
|
4
3
|
#
|
|
5
4
|
# The situation:
|
|
6
5
|
# - There are 5 houses in five different colors.
|
|
@@ -10,6 +9,7 @@
|
|
|
10
9
|
#
|
|
11
10
|
# The question is:
|
|
12
11
|
# Who owns the fish?
|
|
12
|
+
# ============================================================================================================
|
|
13
13
|
|
|
14
14
|
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
|
|
15
15
|
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
|