diff options
| author | RncLsn <rnc.lsn@gmail.com> | 2015-07-03 12:33:55 +0100 |
|---|---|---|
| committer | RncLsn <rnc.lsn@gmail.com> | 2015-07-03 12:33:55 +0100 |
| commit | 133dab6e21f263df2baca913d3d0b7a4fd152d08 (patch) | |
| tree | 88b2783fcb84c0511bf5919ce5602e967b2bdd39 | |
| parent | afb949a595bf351d4c9f1a8984ed82edbd13b725 (diff) | |
| download | ACQuA-133dab6e21f263df2baca913d3d0b7a4fd152d08.tar.gz ACQuA-133dab6e21f263df2baca913d3d0b7a4fd152d08.zip | |
Reactome test: standard and sygenia queries.
3 files changed, 932 insertions, 0 deletions
diff --git a/data/reactome/reactome_sygenia_queries.sparql b/data/reactome/reactome_sygenia_queries.sparql new file mode 100644 index 0000000..97ba1c9 --- /dev/null +++ b/data/reactome/reactome_sygenia_queries.sparql | |||
| @@ -0,0 +1,649 @@ | |||
| 1 | ^[query1] | ||
| 2 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 3 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 4 | SELECT ?x | ||
| 5 | WHERE { | ||
| 6 | ?x rdf:type reactome:CellVocabulary | ||
| 7 | } | ||
| 8 | |||
| 9 | ^[query2] | ||
| 10 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 11 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 12 | SELECT ?x | ||
| 13 | WHERE { | ||
| 14 | ?x reactome:cofactor _:y | ||
| 15 | } | ||
| 16 | |||
| 17 | ^[query3] | ||
| 18 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 19 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 20 | SELECT ?x | ||
| 21 | WHERE { | ||
| 22 | ?x reactome:participant _:y . | ||
| 23 | _:y rdf:type reactome:PhysicalEntity | ||
| 24 | } | ||
| 25 | |||
| 26 | ^[query4] | ||
| 27 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 28 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 29 | SELECT ?x | ||
| 30 | WHERE { | ||
| 31 | ?x rdf:type reactome:SequenceRegionVocabulary | ||
| 32 | } | ||
| 33 | |||
| 34 | ^[query5] | ||
| 35 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 36 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 37 | SELECT ?x ?y | ||
| 38 | WHERE { | ||
| 39 | ?x reactome:bindsTo ?y | ||
| 40 | } | ||
| 41 | |||
| 42 | ^[query6] | ||
| 43 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 44 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 45 | SELECT ?x | ||
| 46 | WHERE { | ||
| 47 | ?x rdf:type reactome:EntityFeature | ||
| 48 | } | ||
| 49 | |||
| 50 | ^[query7] | ||
| 51 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 52 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 53 | SELECT ?x | ||
| 54 | WHERE { | ||
| 55 | ?x rdf:type reactome:Score | ||
| 56 | } | ||
| 57 | |||
| 58 | ^[query8] | ||
| 59 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 60 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 61 | SELECT ?x | ||
| 62 | WHERE { | ||
| 63 | ?x rdf:type reactome:ExperimentalForm | ||
| 64 | } | ||
| 65 | |||
| 66 | ^[query9] | ||
| 67 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 68 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 69 | SELECT ?x | ||
| 70 | WHERE { | ||
| 71 | ?x reactome:stepProcess _:y . | ||
| 72 | _:y rdf:type reactome:Conversion | ||
| 73 | } | ||
| 74 | |||
| 75 | ^[query10] | ||
| 76 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 77 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 78 | SELECT ?x | ||
| 79 | WHERE { | ||
| 80 | ?x reactome:stepProcess _:y . | ||
| 81 | _:y rdf:type reactome:Entity | ||
| 82 | } | ||
| 83 | |||
| 84 | ^[query11] | ||
| 85 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 86 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 87 | SELECT ?x | ||
| 88 | WHERE { | ||
| 89 | ?x rdf:type reactome:PathwayStep | ||
| 90 | } | ||
| 91 | |||
| 92 | ^[query12] | ||
| 93 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 94 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 95 | SELECT ?x | ||
| 96 | WHERE { | ||
| 97 | ?x rdf:type reactome:RelationshipTypeVocabulary | ||
| 98 | } | ||
| 99 | |||
| 100 | ^[query13] | ||
| 101 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 102 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 103 | SELECT ?x | ||
| 104 | WHERE { | ||
| 105 | ?x rdf:type reactome:TissueVocabulary | ||
| 106 | } | ||
| 107 | |||
| 108 | ^[query14] | ||
| 109 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 110 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 111 | SELECT ?x | ||
| 112 | WHERE { | ||
| 113 | _:y reactome:bindsTo ?x | ||
| 114 | } | ||
| 115 | |||
| 116 | ^[query15] | ||
| 117 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 118 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 119 | SELECT ?x | ||
| 120 | WHERE { | ||
| 121 | ?x reactome:stepConversion _:y | ||
| 122 | } | ||
| 123 | |||
| 124 | ^[query16] | ||
| 125 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 126 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 127 | SELECT ?x | ||
| 128 | WHERE { | ||
| 129 | ?x rdf:type reactome:Conversion | ||
| 130 | } | ||
| 131 | |||
| 132 | ^[query17] | ||
| 133 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 134 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 135 | SELECT ?x | ||
| 136 | WHERE { | ||
| 137 | ?x rdf:type reactome:Control | ||
| 138 | } | ||
| 139 | |||
| 140 | ^[query18] | ||
| 141 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 142 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 143 | SELECT ?x | ||
| 144 | WHERE { | ||
| 145 | ?x rdf:type reactome:Catalysis | ||
| 146 | } | ||
| 147 | |||
| 148 | ^[query19] | ||
| 149 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 150 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 151 | SELECT ?x | ||
| 152 | WHERE { | ||
| 153 | ?x reactome:stepConversion _:y . | ||
| 154 | _:y rdf:type reactome:Conversion | ||
| 155 | } | ||
| 156 | |||
| 157 | ^[query20] | ||
| 158 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 159 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 160 | SELECT ?x | ||
| 161 | WHERE { | ||
| 162 | ?x reactome:right _:y . | ||
| 163 | _:y rdf:type reactome:Entity | ||
| 164 | } | ||
| 165 | |||
| 166 | ^[query21] | ||
| 167 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 168 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 169 | SELECT ?x ?y | ||
| 170 | WHERE { | ||
| 171 | ?x reactome:participant ?y | ||
| 172 | } | ||
| 173 | |||
| 174 | ^[query22] | ||
| 175 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 176 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 177 | SELECT ?x | ||
| 178 | WHERE { | ||
| 179 | ?x reactome:left _:y | ||
| 180 | } | ||
| 181 | |||
| 182 | ^[query23] | ||
| 183 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 184 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 185 | SELECT ?x | ||
| 186 | WHERE { | ||
| 187 | ?x reactome:product _:y | ||
| 188 | } | ||
| 189 | |||
| 190 | ^[query24] | ||
| 191 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 192 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 193 | SELECT ?x | ||
| 194 | WHERE { | ||
| 195 | ?x rdf:type reactome:PhenotypeVocabulary | ||
| 196 | } | ||
| 197 | |||
| 198 | ^[query25] | ||
| 199 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 200 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 201 | SELECT ?x | ||
| 202 | WHERE { | ||
| 203 | ?x reactome:stepProcess _:y | ||
| 204 | } | ||
| 205 | |||
| 206 | ^[query26] | ||
| 207 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 208 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 209 | SELECT ?x | ||
| 210 | WHERE { | ||
| 211 | _:y reactome:bindsTo ?x . | ||
| 212 | _:y rdf:type reactome:EntityFeature | ||
| 213 | } | ||
| 214 | |||
| 215 | ^[query27] | ||
| 216 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 217 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 218 | SELECT ?x | ||
| 219 | WHERE { | ||
| 220 | ?x reactome:cofactor _:y . | ||
| 221 | _:y rdf:type reactome:PhysicalEntity | ||
| 222 | } | ||
| 223 | |||
| 224 | ^[query28] | ||
| 225 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 226 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 227 | SELECT ?x ?y | ||
| 228 | WHERE { | ||
| 229 | ?x reactome:stepProcess ?y | ||
| 230 | } | ||
| 231 | |||
| 232 | ^[query29] | ||
| 233 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 234 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 235 | SELECT ?x | ||
| 236 | WHERE { | ||
| 237 | ?x rdf:type reactome:Stoichiometry | ||
| 238 | } | ||
| 239 | |||
| 240 | ^[query30] | ||
| 241 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 242 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 243 | SELECT ?x | ||
| 244 | WHERE { | ||
| 245 | ?x rdf:type reactome:UtilityClass | ||
| 246 | } | ||
| 247 | |||
| 248 | ^[query31] | ||
| 249 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 250 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 251 | SELECT ?x | ||
| 252 | WHERE { | ||
| 253 | ?x rdf:type reactome:ChemicalStructure | ||
| 254 | } | ||
| 255 | |||
| 256 | ^[query32] | ||
| 257 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 258 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 259 | SELECT ?x | ||
| 260 | WHERE { | ||
| 261 | ?x rdf:type reactome:SequenceSite | ||
| 262 | } | ||
| 263 | |||
| 264 | ^[query33] | ||
| 265 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 266 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 267 | SELECT ?x | ||
| 268 | WHERE { | ||
| 269 | ?x rdf:type reactome:BioSource | ||
| 270 | } | ||
| 271 | |||
| 272 | ^[query34] | ||
| 273 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 274 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 275 | SELECT ?x | ||
| 276 | WHERE { | ||
| 277 | _:y reactome:bindsTo ?x . | ||
| 278 | _:y rdf:type reactome:UtilityClass | ||
| 279 | } | ||
| 280 | |||
| 281 | ^[query35] | ||
| 282 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 283 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 284 | SELECT ?x | ||
| 285 | WHERE { | ||
| 286 | ?x rdf:type reactome:ControlledVocabulary | ||
| 287 | } | ||
| 288 | |||
| 289 | ^[query36] | ||
| 290 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 291 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 292 | SELECT ?x | ||
| 293 | WHERE { | ||
| 294 | ?x rdf:type reactome:Transport | ||
| 295 | } | ||
| 296 | |||
| 297 | ^[query37] | ||
| 298 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 299 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 300 | SELECT ?x | ||
| 301 | WHERE { | ||
| 302 | ?x reactome:bindsTo _:y | ||
| 303 | } | ||
| 304 | |||
| 305 | ^[query38] | ||
| 306 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 307 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 308 | SELECT ?x | ||
| 309 | WHERE { | ||
| 310 | ?x reactome:template _:y | ||
| 311 | } | ||
| 312 | |||
| 313 | ^[query39] | ||
| 314 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 315 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 316 | SELECT ?x | ||
| 317 | WHERE { | ||
| 318 | ?x reactome:participant _:y | ||
| 319 | } | ||
| 320 | |||
| 321 | ^[query40] | ||
| 322 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 323 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 324 | SELECT ?x | ||
| 325 | WHERE { | ||
| 326 | ?x reactome:controlled _:y | ||
| 327 | } | ||
| 328 | |||
| 329 | ^[query41] | ||
| 330 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 331 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 332 | SELECT ?x | ||
| 333 | WHERE { | ||
| 334 | ?x rdf:type reactome:ModificationFeature | ||
| 335 | } | ||
| 336 | |||
| 337 | ^[query42] | ||
| 338 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 339 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 340 | SELECT ?x ?y | ||
| 341 | WHERE { | ||
| 342 | ?y reactome:bindsTo ?x | ||
| 343 | } | ||
| 344 | |||
| 345 | ^[query43] | ||
| 346 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 347 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 348 | SELECT ?x | ||
| 349 | WHERE { | ||
| 350 | ?x rdf:type reactome:InteractionVocabulary | ||
| 351 | } | ||
| 352 | |||
| 353 | ^[query44] | ||
| 354 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 355 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 356 | SELECT ?x | ||
| 357 | WHERE { | ||
| 358 | ?x rdf:type reactome:SequenceModificationVocabulary | ||
| 359 | } | ||
| 360 | |||
| 361 | ^[query45] | ||
| 362 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 363 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 364 | SELECT ?x | ||
| 365 | WHERE { | ||
| 366 | ?x reactome:right _:y . | ||
| 367 | _:y rdf:type reactome:PhysicalEntity | ||
| 368 | } | ||
| 369 | |||
| 370 | ^[query46] | ||
| 371 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 372 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 373 | SELECT ?x | ||
| 374 | WHERE { | ||
| 375 | ?x reactome:participant _:y . | ||
| 376 | _:y rdf:type reactome:Entity | ||
| 377 | } | ||
| 378 | |||
| 379 | ^[query47] | ||
| 380 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 381 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 382 | SELECT ?x | ||
| 383 | WHERE { | ||
| 384 | ?x rdf:type reactome:EvidenceCodeVocabulary | ||
| 385 | } | ||
| 386 | |||
| 387 | ^[query48] | ||
| 388 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 389 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 390 | SELECT ?x | ||
| 391 | WHERE { | ||
| 392 | ?x rdf:type reactome:Complex | ||
| 393 | } | ||
| 394 | |||
| 395 | ^[query49] | ||
| 396 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 397 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 398 | SELECT ?x | ||
| 399 | WHERE { | ||
| 400 | ?x rdf:type reactome:Provenance | ||
| 401 | } | ||
| 402 | |||
| 403 | ^[query50] | ||
| 404 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 405 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 406 | SELECT ?x | ||
| 407 | WHERE { | ||
| 408 | ?x rdf:type reactome:SequenceLocation | ||
| 409 | } | ||
| 410 | |||
| 411 | ^[query51] | ||
| 412 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 413 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 414 | SELECT ?x | ||
| 415 | WHERE { | ||
| 416 | ?x reactome:right _:y | ||
| 417 | } | ||
| 418 | |||
| 419 | ^[query52] | ||
| 420 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 421 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 422 | SELECT ?x | ||
| 423 | WHERE { | ||
| 424 | ?x rdf:type reactome:Evidence | ||
| 425 | } | ||
| 426 | |||
| 427 | ^[query53] | ||
| 428 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 429 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 430 | SELECT ?x | ||
| 431 | WHERE { | ||
| 432 | ?x rdf:type reactome:TemplateReaction | ||
| 433 | } | ||
| 434 | |||
| 435 | ^[query54] | ||
| 436 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 437 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 438 | SELECT ?x | ||
| 439 | WHERE { | ||
| 440 | ?x rdf:type reactome:Entity | ||
| 441 | } | ||
| 442 | |||
| 443 | ^[query55] | ||
| 444 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 445 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 446 | SELECT ?x | ||
| 447 | WHERE { | ||
| 448 | ?x reactome:bindsTo _:y . | ||
| 449 | _:y rdf:type reactome:BindingFeature | ||
| 450 | } | ||
| 451 | |||
| 452 | ^[query56] | ||
| 453 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 454 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 455 | SELECT ?x | ||
| 456 | WHERE { | ||
| 457 | ?x rdf:type reactome:Xref | ||
| 458 | } | ||
| 459 | |||
| 460 | ^[query57] | ||
| 461 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 462 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 463 | SELECT ?x | ||
| 464 | WHERE { | ||
| 465 | ?x rdf:type reactome:BiochemicalReaction | ||
| 466 | } | ||
| 467 | |||
| 468 | ^[query58] | ||
| 469 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 470 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 471 | SELECT ?x | ||
| 472 | WHERE { | ||
| 473 | ?x reactome:stepProcess _:y . | ||
| 474 | _:y rdf:type reactome:Interaction | ||
| 475 | } | ||
| 476 | |||
| 477 | ^[query59] | ||
| 478 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 479 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 480 | SELECT ?x | ||
| 481 | WHERE { | ||
| 482 | ?x rdf:type reactome:BindingFeature | ||
| 483 | } | ||
| 484 | |||
| 485 | ^[query60] | ||
| 486 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 487 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 488 | SELECT ?x | ||
| 489 | WHERE { | ||
| 490 | ?x rdf:type reactome:RelationshipXref | ||
| 491 | } | ||
| 492 | |||
| 493 | ^[query61] | ||
| 494 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 495 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 496 | SELECT ?x | ||
| 497 | WHERE { | ||
| 498 | ?x rdf:type reactome:PhysicalEntity | ||
| 499 | } | ||
| 500 | |||
| 501 | ^[query62] | ||
| 502 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 503 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 504 | SELECT ?x | ||
| 505 | WHERE { | ||
| 506 | ?x rdf:type reactome:CellularLocationVocabulary | ||
| 507 | } | ||
| 508 | |||
| 509 | ^[query63] | ||
| 510 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 511 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 512 | SELECT ?x | ||
| 513 | WHERE { | ||
| 514 | ?x rdf:type reactome:EntityReference | ||
| 515 | } | ||
| 516 | |||
| 517 | ^[query64] | ||
| 518 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 519 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 520 | SELECT ?x | ||
| 521 | WHERE { | ||
| 522 | ?x reactome:bindsTo _:y . | ||
| 523 | _:y rdf:type reactome:UtilityClass | ||
| 524 | } | ||
| 525 | |||
| 526 | ^[query65] | ||
| 527 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 528 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 529 | SELECT ?x | ||
| 530 | WHERE { | ||
| 531 | ?x reactome:left _:y . | ||
| 532 | _:y rdf:type reactome:Entity | ||
| 533 | } | ||
| 534 | |||
| 535 | ^[query66] | ||
| 536 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 537 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 538 | SELECT ?x | ||
| 539 | WHERE { | ||
| 540 | ?x rdf:type reactome:KPrime | ||
| 541 | } | ||
| 542 | |||
| 543 | ^[query67] | ||
| 544 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 545 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 546 | SELECT ?x | ||
| 547 | WHERE { | ||
| 548 | ?x rdf:type reactome:GeneticInteraction | ||
| 549 | } | ||
| 550 | |||
| 551 | ^[query68] | ||
| 552 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 553 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 554 | SELECT ?x | ||
| 555 | WHERE { | ||
| 556 | ?x reactome:bindsTo _:y . | ||
| 557 | _:y rdf:type reactome:EntityFeature | ||
| 558 | } | ||
| 559 | |||
| 560 | ^[query69] | ||
| 561 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 562 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 563 | SELECT ?x | ||
| 564 | WHERE { | ||
| 565 | ?x rdf:type reactome:Interaction | ||
| 566 | } | ||
| 567 | |||
| 568 | ^[query70] | ||
| 569 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 570 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 571 | SELECT ?x | ||
| 572 | WHERE { | ||
| 573 | ?x rdf:type reactome:ExperimentalFormVocabulary | ||
| 574 | } | ||
| 575 | |||
| 576 | ^[query71] | ||
| 577 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 578 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 579 | SELECT ?x | ||
| 580 | WHERE { | ||
| 581 | ?x reactome:left _:y . | ||
| 582 | _:y rdf:type reactome:PhysicalEntity | ||
| 583 | } | ||
| 584 | |||
| 585 | ^[query72] | ||
| 586 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 587 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 588 | SELECT ?x | ||
| 589 | WHERE { | ||
| 590 | ?x rdf:type reactome:SequenceInterval | ||
| 591 | } | ||
| 592 | |||
| 593 | ^[query73] | ||
| 594 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 595 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 596 | SELECT ?x | ||
| 597 | WHERE { | ||
| 598 | ?x rdf:type reactome:BiochemicalPathwayStep | ||
| 599 | } | ||
| 600 | |||
| 601 | ^[query74] | ||
| 602 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 603 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 604 | SELECT ?x | ||
| 605 | WHERE { | ||
| 606 | ?x rdf:type reactome:Pathway | ||
| 607 | } | ||
| 608 | |||
| 609 | ^[query75] | ||
| 610 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 611 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 612 | SELECT ?x | ||
| 613 | WHERE { | ||
| 614 | ?x reactome:controller _:y | ||
| 615 | } | ||
| 616 | |||
| 617 | ^[query76] | ||
| 618 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 619 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 620 | SELECT ?x | ||
| 621 | WHERE { | ||
| 622 | _:y reactome:bindsTo ?x . | ||
| 623 | _:y rdf:type reactome:BindingFeature | ||
| 624 | } | ||
| 625 | |||
| 626 | ^[query77] | ||
| 627 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 628 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 629 | SELECT ?x | ||
| 630 | WHERE { | ||
| 631 | ?x rdf:type reactome:SmallMoleculeReference | ||
| 632 | } | ||
| 633 | |||
| 634 | ^[query78] | ||
| 635 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 636 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 637 | SELECT ?x | ||
| 638 | WHERE { | ||
| 639 | ?x rdf:type reactome:DeltaG | ||
| 640 | } | ||
| 641 | |||
| 642 | ^[query79] | ||
| 643 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
| 644 | PREFIX reactome: <http://www.biopax.org/release/biopax-level3.owl#> | ||
| 645 | SELECT ?x | ||
| 646 | WHERE { | ||
| 647 | ?x rdf:type reactome:EntityReferenceTypeVocabulary | ||
| 648 | } | ||
| 649 | |||
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/SkolemisationTests.java b/test/uk/ac/ox/cs/pagoda/global_tests/SkolemisationTests.java new file mode 100644 index 0000000..2fc682b --- /dev/null +++ b/test/uk/ac/ox/cs/pagoda/global_tests/SkolemisationTests.java | |||
| @@ -0,0 +1,269 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.global_tests; | ||
| 2 | |||
| 3 | import org.semanticweb.owlapi.apibinding.OWLManager; | ||
| 4 | import org.semanticweb.owlapi.model.*; | ||
| 5 | import org.testng.Assert; | ||
| 6 | import org.testng.annotations.Test; | ||
| 7 | import uk.ac.ox.cs.pagoda.query.AnswerTuple; | ||
| 8 | import uk.ac.ox.cs.pagoda.query.AnswerTuples; | ||
| 9 | import uk.ac.ox.cs.pagoda.query.QueryRecord; | ||
| 10 | import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner; | ||
| 11 | import uk.ac.ox.cs.pagoda.util.TestUtil; | ||
| 12 | |||
| 13 | import java.io.IOException; | ||
| 14 | import java.nio.file.Files; | ||
| 15 | import java.nio.file.Paths; | ||
| 16 | |||
| 17 | public class SkolemisationTests { | ||
| 18 | |||
| 19 | public static final String NS = "http://example.org/test#%s"; | ||
| 20 | |||
| 21 | private IRI getEntityIRI(String name) { | ||
| 22 | return IRI.create(String.format(NS, name)); | ||
| 23 | } | ||
| 24 | |||
| 25 | // @Test | ||
| 26 | public void commonSuccessorTest() throws OWLOntologyCreationException, IOException, OWLOntologyStorageException { | ||
| 27 | |||
| 28 | /* | ||
| 29 | * Build test ontology | ||
| 30 | * */ | ||
| 31 | |||
| 32 | OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); | ||
| 33 | OWLDataFactory factory = manager.getOWLDataFactory(); | ||
| 34 | OWLOntology ontology = manager.createOntology(); | ||
| 35 | |||
| 36 | OWLClass classA = factory.getOWLClass(getEntityIRI("A")); | ||
| 37 | manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classA)); | ||
| 38 | OWLClass classB = factory.getOWLClass(getEntityIRI("B")); | ||
| 39 | manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classB)); | ||
| 40 | OWLClass classC = factory.getOWLClass(getEntityIRI("C")); | ||
| 41 | manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classC)); | ||
| 42 | OWLNamedIndividual c = factory.getOWLNamedIndividual(getEntityIRI("c")); | ||
| 43 | OWLNamedIndividual d = factory.getOWLNamedIndividual(getEntityIRI("d")); | ||
| 44 | OWLObjectProperty roleR = factory.getOWLObjectProperty(IRI.create(String.format(NS, "R"))); | ||
| 45 | manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleR)); | ||
| 46 | |||
| 47 | // Class assertions | ||
| 48 | manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(classA, c)); // A(c) | ||
| 49 | manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(classA, d)); // A(d) | ||
| 50 | |||
| 51 | // Minimum cardinality axiom | ||
| 52 | manager.addAxiom(ontology, | ||
| 53 | factory.getOWLSubClassOfAxiom(classA, | ||
| 54 | factory.getOWLObjectUnionOf( | ||
| 55 | factory.getOWLObjectSomeValuesFrom(roleR, classB), | ||
| 56 | factory.getOWLObjectSomeValuesFrom(roleR, classC)))); | ||
| 57 | |||
| 58 | /* | ||
| 59 | * Save the ontology | ||
| 60 | * */ | ||
| 61 | |||
| 62 | // manager.saveOntology(ontology, Files.newOutputStream(Paths.get("/home/alessandro/Desktop/test-ontology.owl"))); | ||
| 63 | |||
| 64 | /* | ||
| 65 | * Test one query | ||
| 66 | * */ | ||
| 67 | |||
| 68 | QueryReasoner pagoda = QueryReasoner.getInstance(ontology); | ||
| 69 | pagoda.loadOntology(ontology); | ||
| 70 | if(pagoda.preprocess()) { | ||
| 71 | String queryStr = "select distinct ?x ?y " + | ||
| 72 | " where { " | ||
| 73 | + " ?x <" + roleR.toStringID() + "> _:z . " | ||
| 74 | + " ?y <" + roleR.toStringID() + "> _:z " + | ||
| 75 | " }"; | ||
| 76 | QueryRecord queryRecord = pagoda.getQueryManager().create(queryStr); | ||
| 77 | pagoda.evaluate(queryRecord); | ||
| 78 | AnswerTuples answers = queryRecord.getAnswers(); | ||
| 79 | System.out.println("Difficulty: " + queryRecord.getDifficulty()); | ||
| 80 | int count = 0; | ||
| 81 | for(AnswerTuple ans; answers.isValid(); answers.moveNext()) { | ||
| 82 | ans = answers.getTuple(); | ||
| 83 | TestUtil.logInfo(ans); | ||
| 84 | count++; | ||
| 85 | } | ||
| 86 | Assert.assertEquals(count, 2); | ||
| 87 | } | ||
| 88 | pagoda.dispose(); | ||
| 89 | } | ||
| 90 | |||
| 91 | // @Test | ||
| 92 | public void yTest() throws OWLOntologyCreationException, IOException, OWLOntologyStorageException { | ||
| 93 | |||
| 94 | /* | ||
| 95 | * Build test ontology | ||
| 96 | * */ | ||
| 97 | |||
| 98 | OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); | ||
| 99 | OWLDataFactory factory = manager.getOWLDataFactory(); | ||
| 100 | OWLOntology ontology = manager.createOntology(); | ||
| 101 | |||
| 102 | OWLClass classA = factory.getOWLClass(getEntityIRI("A")); | ||
| 103 | manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classA)); | ||
| 104 | OWLClass classB = factory.getOWLClass(getEntityIRI("B")); | ||
| 105 | manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classB)); | ||
| 106 | OWLClass classC = factory.getOWLClass(getEntityIRI("C")); | ||
| 107 | manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classC)); | ||
| 108 | OWLClass classD = factory.getOWLClass(getEntityIRI("D")); | ||
| 109 | manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classD)); | ||
| 110 | OWLNamedIndividual a = factory.getOWLNamedIndividual(getEntityIRI("a")); | ||
| 111 | OWLNamedIndividual b = factory.getOWLNamedIndividual(getEntityIRI("b")); | ||
| 112 | OWLNamedIndividual c = factory.getOWLNamedIndividual(getEntityIRI("c")); | ||
| 113 | OWLNamedIndividual d = factory.getOWLNamedIndividual(getEntityIRI("d")); | ||
| 114 | OWLObjectProperty roleR = factory.getOWLObjectProperty(IRI.create(String.format(NS, "R"))); | ||
| 115 | manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleR)); | ||
| 116 | OWLObjectProperty roleS = factory.getOWLObjectProperty(IRI.create(String.format(NS, "S"))); | ||
| 117 | manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleS)); | ||
| 118 | OWLObjectProperty roleP = factory.getOWLObjectProperty(IRI.create(String.format(NS, "P"))); | ||
| 119 | manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleP)); | ||
| 120 | |||
| 121 | // Class assertions | ||
| 122 | manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(classD, a)); // D(a) | ||
| 123 | manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(classD, b)); // D(b) | ||
| 124 | manager.addAxiom(ontology, factory.getOWLObjectPropertyAssertionAxiom(roleS, c, a)); // S(c,a) | ||
| 125 | manager.addAxiom(ontology, factory.getOWLObjectPropertyAssertionAxiom(roleP, d, b)); // P(d,b) | ||
| 126 | |||
| 127 | // Axioms | ||
| 128 | // subsetOf(D someValuesFrom(R owl:Thing)) | ||
| 129 | manager.addAxiom(ontology, | ||
| 130 | factory.getOWLSubClassOfAxiom(classD, | ||
| 131 | factory.getOWLObjectSomeValuesFrom(roleR, | ||
| 132 | factory.getOWLThing()))); | ||
| 133 | // subsetOf(someValuesFrom(inverseOf(S) owl:Thing) allValuesFrom(R A)) | ||
| 134 | manager.addAxiom(ontology, | ||
| 135 | factory.getOWLSubClassOfAxiom(factory.getOWLObjectSomeValuesFrom(roleS.getInverseProperty(), | ||
| 136 | factory.getOWLThing()), | ||
| 137 | factory.getOWLObjectAllValuesFrom(roleR, classA))); | ||
| 138 | // subsetOf(someValuesFrom(inverseOf(P) owl:Thing) B) | ||
| 139 | manager.addAxiom(ontology, | ||
| 140 | factory.getOWLSubClassOfAxiom(factory.getOWLObjectSomeValuesFrom(roleP.getInverseProperty(), | ||
| 141 | factory.getOWLThing()), | ||
| 142 | classB)); | ||
| 143 | // subsetOf(someValuesFrom(R A) C) | ||
| 144 | manager.addAxiom(ontology, | ||
| 145 | factory.getOWLSubClassOfAxiom(factory.getOWLObjectSomeValuesFrom(roleR, classA), classC)); | ||
| 146 | |||
| 147 | /* | ||
| 148 | * Save the ontology | ||
| 149 | * */ | ||
| 150 | |||
| 151 | manager.saveOntology(ontology, Files.newOutputStream(Paths.get("/home/alessandro/Desktop/test-ontology.owl"))); | ||
| 152 | |||
| 153 | /* | ||
| 154 | * Test one query | ||
| 155 | * */ | ||
| 156 | |||
| 157 | QueryReasoner pagoda = QueryReasoner.getInstance(ontology); | ||
| 158 | pagoda.loadOntology(ontology); | ||
| 159 | if(pagoda.preprocess()) { | ||
| 160 | String queryStr = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " + | ||
| 161 | "select distinct ?x" + | ||
| 162 | " where { " | ||
| 163 | // + " ?x rdf:type " + classB + " ." | ||
| 164 | // + " ?x " + roleR + " "+ "_:y . " | ||
| 165 | + " ?x rdf:type " + classC + | ||
| 166 | " }"; | ||
| 167 | QueryRecord queryRecord = pagoda.getQueryManager().create(queryStr); | ||
| 168 | System.out.println(queryRecord); | ||
| 169 | pagoda.evaluate(queryRecord); | ||
| 170 | AnswerTuples answers = queryRecord.getAnswers(); | ||
| 171 | System.out.println("Difficulty: " + queryRecord.getDifficulty()); | ||
| 172 | int count = 0; | ||
| 173 | for(AnswerTuple ans; answers.isValid(); answers.moveNext()) { | ||
| 174 | ans = answers.getTuple(); | ||
| 175 | TestUtil.logInfo(ans); | ||
| 176 | count++; | ||
| 177 | } | ||
| 178 | // Assert.assertEquals(count, 1); | ||
| 179 | } | ||
| 180 | pagoda.dispose(); | ||
| 181 | } | ||
| 182 | |||
| 183 | @Test | ||
| 184 | public void rTest() throws OWLOntologyCreationException, IOException, OWLOntologyStorageException { | ||
| 185 | |||
| 186 | /* | ||
| 187 | * Build test ontology | ||
| 188 | * */ | ||
| 189 | |||
| 190 | OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); | ||
| 191 | OWLDataFactory factory = manager.getOWLDataFactory(); | ||
| 192 | OWLOntology ontology = manager.createOntology(); | ||
| 193 | |||
| 194 | OWLClass classA = factory.getOWLClass(getEntityIRI("A")); | ||
| 195 | manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classA)); | ||
| 196 | OWLClass classB = factory.getOWLClass(getEntityIRI("B")); | ||
| 197 | manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classB)); | ||
| 198 | // OWLClass classC = factory.getOWLClass(getEntityIRI("C")); | ||
| 199 | // manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classC)); | ||
| 200 | // OWLClass classD = factory.getOWLClass(getEntityIRI("D")); | ||
| 201 | // manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classD)); | ||
| 202 | OWLNamedIndividual a = factory.getOWLNamedIndividual(getEntityIRI("a")); | ||
| 203 | OWLNamedIndividual b = factory.getOWLNamedIndividual(getEntityIRI("b")); | ||
| 204 | OWLNamedIndividual c = factory.getOWLNamedIndividual(getEntityIRI("c")); | ||
| 205 | // OWLNamedIndividual d = factory.getOWLNamedIndividual(getEntityIRI("d")); | ||
| 206 | OWLObjectProperty roleR = factory.getOWLObjectProperty(IRI.create(String.format(NS, "R"))); | ||
| 207 | manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleR)); | ||
| 208 | // OWLObjectProperty roleF = factory.getOWLObjectProperty(IRI.create(String.format(NS, "F"))); | ||
| 209 | // manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleF)); | ||
| 210 | OWLObjectProperty roleP = factory.getOWLObjectProperty(IRI.create(String.format(NS, "P"))); | ||
| 211 | manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleP)); | ||
| 212 | // OWLObjectProperty roleL = factory.getOWLObjectProperty(IRI.create(String.format(NS, "L"))); | ||
| 213 | // manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleL)); | ||
| 214 | |||
| 215 | // Class assertions | ||
| 216 | manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(classA, a)); // A(a) | ||
| 217 | manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(classA, b)); // A(b) | ||
| 218 | manager.addAxiom(ontology, factory.getOWLObjectPropertyAssertionAxiom(roleP, c, a)); // P(c,a) | ||
| 219 | |||
| 220 | // Axioms | ||
| 221 | // subsetOf(A someValuesFrom(R owl:Thing)) | ||
| 222 | manager.addAxiom(ontology, | ||
| 223 | factory.getOWLSubClassOfAxiom(classA, | ||
| 224 | factory.getOWLObjectSomeValuesFrom(roleR, | ||
| 225 | factory.getOWLThing()))); | ||
| 226 | |||
| 227 | // inverseFunctional(R) | ||
| 228 | manager.addAxiom(ontology, | ||
| 229 | factory.getOWLInverseFunctionalObjectPropertyAxiom(roleR)); | ||
| 230 | |||
| 231 | // subsetOf(someValuesFrom(inverseOf(P) owl:thing) B) | ||
| 232 | manager.addAxiom(ontology, | ||
| 233 | factory.getOWLSubClassOfAxiom(factory.getOWLObjectSomeValuesFrom(roleP.getInverseProperty(), | ||
| 234 | factory.getOWLThing()), | ||
| 235 | classB)); | ||
| 236 | /* | ||
| 237 | * Save the ontology | ||
| 238 | * */ | ||
| 239 | |||
| 240 | manager.saveOntology(ontology, Files.newOutputStream(Paths.get("/home/alessandro/Desktop/test-ontology.owl"))); | ||
| 241 | |||
| 242 | /* | ||
| 243 | * Test one query | ||
| 244 | * */ | ||
| 245 | |||
| 246 | QueryReasoner pagoda = QueryReasoner.getInstance(ontology); | ||
| 247 | pagoda.loadOntology(ontology); | ||
| 248 | if(pagoda.preprocess()) { | ||
| 249 | String queryStr = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " + | ||
| 250 | "select distinct ?x" + | ||
| 251 | " where { " | ||
| 252 | + " ?x rdf:type " + classB + | ||
| 253 | " }"; | ||
| 254 | QueryRecord queryRecord = pagoda.getQueryManager().create(queryStr); | ||
| 255 | System.out.println(queryRecord); | ||
| 256 | pagoda.evaluate(queryRecord); | ||
| 257 | AnswerTuples answers = queryRecord.getAnswers(); | ||
| 258 | System.out.println("Difficulty: " + queryRecord.getDifficulty()); | ||
| 259 | int count = 0; | ||
| 260 | for(AnswerTuple ans; answers.isValid(); answers.moveNext()) { | ||
| 261 | ans = answers.getTuple(); | ||
| 262 | TestUtil.logInfo(ans); | ||
| 263 | count++; | ||
| 264 | } | ||
| 265 | // Assert.assertEquals(count, 1); | ||
| 266 | } | ||
| 267 | pagoda.dispose(); | ||
| 268 | } | ||
| 269 | } | ||
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaReactome.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaReactome.java index 5c05b94..30f3d93 100644 --- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaReactome.java +++ b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaReactome.java | |||
| @@ -23,4 +23,18 @@ public class TestPagodaReactome { | |||
| 23 | .run(); | 23 | .run(); |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | @Test(groups = {"sygenia"}) | ||
| 27 | public void justExecute_sygenia() throws IOException { | ||
| 28 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 29 | |||
| 30 | Pagoda.builder() | ||
| 31 | .ontology(Paths.get(ontoDir, "reactome/biopax-level3-processed.owl")) | ||
| 32 | .data(Paths.get(ontoDir, "reactome/data/sample_10.ttl")) | ||
| 33 | .query(Paths.get(ontoDir, "reactome/reactome_sygenia_queries.sparql")) | ||
| 34 | .classify(true) | ||
| 35 | .hermit(true) | ||
| 36 | .build() | ||
| 37 | .run(); | ||
| 38 | } | ||
| 39 | |||
| 26 | } | 40 | } |
