aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Igne <federico.igne@cs.ox.ac.uk>2021-01-05 09:38:51 +0000
committerFederico Igne <federico.igne@cs.ox.ac.uk>2021-01-05 10:15:12 +0000
commitda6b84225f391a0690d16d8b8c53e9489c75f4b6 (patch)
treef96b09eb20f776b781b0d74642c14913ca04eff7
parent482fd0b64189e76cee28b9303f088bd8a26277b1 (diff)
downloadRSAComb-da6b84225f391a0690d16d8b8c53e9489c75f4b6.tar.gz
RSAComb-da6b84225f391a0690d16d8b8c53e9489c75f4b6.zip
Attempt to force a better ordering of body atoms in filtering rules
This is based on an email from Yavor, suggesting a couple of improvements on the code. In particular this refers to the fact that, when RDFox lacks any information it assumes user ordering in the processing order of a rule body.
-rw-r--r--src/main/scala/uk/ac/ox/cs/rsacomb/FilteringProgram.scala18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/FilteringProgram.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/FilteringProgram.scala
index 4e533c6..9427735 100644
--- a/src/main/scala/uk/ac/ox/cs/rsacomb/FilteringProgram.scala
+++ b/src/main/scala/uk/ac/ox/cs/rsacomb/FilteringProgram.scala
@@ -126,9 +126,9 @@ class FilteringProgram(query: ConjunctiveQuery, constants: List[Term]) {
126 if index2 >= 0 126 if index2 >= 0
127 } yield Rule.create( 127 } yield Rule.create(
128 RSA.FK, 128 RSA.FK,
129 RSA.ID(RSA(index1), RSA(index2)),
129 role1 << Forward, 130 role1 << Forward,
130 role2 << Forward, 131 role2 << Forward,
131 RSA.ID(RSA(index1), RSA(index2)),
132 not(RSA.Congruent(role1.getArguments get 0, role2.getArguments get 0)) 132 not(RSA.Congruent(role1.getArguments get 0, role2.getArguments get 0))
133 ) 133 )
134 val r4b = for { 134 val r4b = for {
@@ -140,9 +140,9 @@ class FilteringProgram(query: ConjunctiveQuery, constants: List[Term]) {
140 if index2 >= 0 140 if index2 >= 0
141 } yield Rule.create( 141 } yield Rule.create(
142 RSA.FK, 142 RSA.FK,
143 RSA.ID(RSA(index1), RSA(index2)),
143 role1 << Forward, 144 role1 << Forward,
144 role2 << Backward, 145 role2 << Backward,
145 RSA.ID(RSA(index1), RSA(index2)),
146 not(RSA.Congruent(role1.getArguments get 0, role2.getArguments get 2)) 146 not(RSA.Congruent(role1.getArguments get 0, role2.getArguments get 2))
147 ) 147 )
148 val r4c = for { 148 val r4c = for {
@@ -154,9 +154,9 @@ class FilteringProgram(query: ConjunctiveQuery, constants: List[Term]) {
154 if index2 >= 0 154 if index2 >= 0
155 } yield Rule.create( 155 } yield Rule.create(
156 RSA.FK, 156 RSA.FK,
157 RSA.ID(RSA(index1), RSA(index2)),
157 role1 << Backward, 158 role1 << Backward,
158 role2 << Backward, 159 role2 << Backward,
159 RSA.ID(RSA(index1), RSA(index2)),
160 not(RSA.Congruent(role1.getArguments get 2, role2.getArguments get 2)) 160 not(RSA.Congruent(role1.getArguments get 2, role2.getArguments get 2))
161 ) 161 )
162 162
@@ -180,13 +180,13 @@ class FilteringProgram(query: ConjunctiveQuery, constants: List[Term]) {
180 RSA(query.bounded indexOf r1arg0), 180 RSA(query.bounded indexOf r1arg0),
181 RSA(query.bounded indexOf r2arg0) 181 RSA(query.bounded indexOf r2arg0)
182 ), 182 ),
183 role1 << Forward,
184 role2 << Forward,
185 RSA.ID( 183 RSA.ID(
186 RSA(query.bounded indexOf r1arg2), 184 RSA(query.bounded indexOf r1arg2),
187 RSA(query.bounded indexOf r2arg2) 185 RSA(query.bounded indexOf r2arg2)
188 ), 186 ),
189 RSA.Congruent(r1arg0, r2arg0), 187 RSA.Congruent(r1arg0, r2arg0),
188 role1 << Forward,
189 role2 << Forward,
190 not(RSA.NI(r1arg0)) 190 not(RSA.NI(r1arg0))
191 ) 191 )
192 val r5b = for { 192 val r5b = for {
@@ -205,13 +205,13 @@ class FilteringProgram(query: ConjunctiveQuery, constants: List[Term]) {
205 RSA(query.bounded indexOf r1arg0), 205 RSA(query.bounded indexOf r1arg0),
206 RSA(query.bounded indexOf r2arg2) 206 RSA(query.bounded indexOf r2arg2)
207 ), 207 ),
208 role1 << Forward,
209 role2 << Backward,
210 RSA.ID( 208 RSA.ID(
211 RSA(query.bounded indexOf r1arg2), 209 RSA(query.bounded indexOf r1arg2),
212 RSA(query.bounded indexOf r2arg0) 210 RSA(query.bounded indexOf r2arg0)
213 ), 211 ),
214 RSA.Congruent(r1arg0, r2arg2), 212 RSA.Congruent(r1arg0, r2arg2),
213 role1 << Forward,
214 role2 << Backward,
215 not(RSA.NI(r1arg0)) 215 not(RSA.NI(r1arg0))
216 ) 216 )
217 val r5c = for { 217 val r5c = for {
@@ -230,13 +230,13 @@ class FilteringProgram(query: ConjunctiveQuery, constants: List[Term]) {
230 RSA(query.bounded indexOf r1arg2), 230 RSA(query.bounded indexOf r1arg2),
231 RSA(query.bounded indexOf r2arg2) 231 RSA(query.bounded indexOf r2arg2)
232 ), 232 ),
233 role1 << Backward,
234 role2 << Backward,
235 RSA.ID( 233 RSA.ID(
236 RSA(query.bounded indexOf r1arg0), 234 RSA(query.bounded indexOf r1arg0),
237 RSA(query.bounded indexOf r2arg0) 235 RSA(query.bounded indexOf r2arg0)
238 ), 236 ),
239 RSA.Congruent(r1arg2, r2arg2), 237 RSA.Congruent(r1arg2, r2arg2),
238 role1 << Backward,
239 role2 << Backward,
240 not(RSA.NI(r1arg2)) 240 not(RSA.NI(r1arg2))
241 ) 241 )
242 242