Class Expression | 117 |SPARQL Query | 118 |
---|---|
A | BASE <http://example.org/ontology/> 120 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 121 | 122 | SELECT DISTINCT ?x 123 | WHERE 124 | { ?x rdf:type <A>} 125 | |
A 127 | and (B or (not (r some Thing))) | BASE <http://example.org/ontology/> 128 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 129 | 130 | SELECT DISTINCT ?x 131 | WHERE 132 | { ?x rdf:type <A> 133 | { ?x rdf:type <B>} 134 | UNION 135 | { ?x ?p ?o 136 | FILTER NOT EXISTS {?x <r> ?s0} 137 | } 138 | } 139 | |
A 141 | and (not (B)) | BASE <http://example.org/ontology/> 142 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 143 | 144 | SELECT DISTINCT ?x 145 | WHERE 146 | { ?x rdf:type <A> 147 | FILTER NOT EXISTS {?x rdf:type <B>} 148 | } 149 | |
A 151 | and (not (r some B)) | BASE <http://example.org/ontology/> 152 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 153 | 154 | SELECT DISTINCT ?x 155 | WHERE 156 | { ?x rdf:type <A> 157 | FILTER NOT EXISTS {?x <r> ?s0 . 158 | ?s0 rdf:type <B> 159 | } 160 | } 161 | |
A 163 | and (r some Self ) | BASE <http://example.org/ontology/> 164 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 165 | 166 | SELECT DISTINCT ?x 167 | WHERE 168 | { ?x rdf:type <A> . 169 | ?x <r> ?x 170 | } 171 | |
A 173 | and (t some boolean) | BASE <http://example.org/ontology/> 174 | PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 175 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 176 | 177 | SELECT DISTINCT ?x 178 | WHERE 179 | { ?x rdf:type <A> . 180 | ?x <t> ?s0 181 | FILTER ( datatype(?s0) = xsd:boolean ) 182 | } 183 | |
A 185 | and (t some not boolean) | BASE <http://example.org/ontology/> 186 | PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 187 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 188 | 189 | SELECT DISTINCT ?x 190 | WHERE 191 | { ?x rdf:type <A> . 192 | ?x <t> ?s0 193 | FILTER ( datatype(?s0) != xsd:boolean ) 194 | } 195 | |
A 197 | and (t value 1) | BASE <http://example.org/ontology/> 198 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 199 | 200 | SELECT DISTINCT ?x 201 | WHERE 202 | { ?x rdf:type <A> . 203 | ?x <t> 1 204 | } 205 | |
A 207 | and (t min 2 boolean) | BASE <http://example.org/ontology/> 208 | PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 209 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 210 | 211 | SELECT DISTINCT ?x 212 | WHERE 213 | { ?x rdf:type <A> 214 | { SELECT ?x 215 | WHERE 216 | { ?x <t> ?s0 217 | FILTER ( datatype(?s0) = xsd:boolean ) 218 | } 219 | GROUP BY ?x 220 | HAVING ( COUNT(?s0) >= 2 ) 221 | } 222 | } 223 | |
B 225 | and (r some B) | BASE <http://example.org/ontology/> 226 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 227 | 228 | SELECT DISTINCT ?x 229 | WHERE 230 | { ?x rdf:type <B> . 231 | ?x <r> ?s0 . 232 | ?s0 rdf:type <B> 233 | } 234 | |
B 236 | and (r some B) 237 | and (s some A) | BASE <http://example.org/ontology/> 238 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 239 | 240 | SELECT DISTINCT ?x 241 | WHERE 242 | { ?x rdf:type <B> . 243 | ?x <r> ?s0 . 244 | ?s0 rdf:type <B> . 245 | ?x <s> ?s1 . 246 | ?s1 rdf:type <A> 247 | } 248 | |
B 250 | and (r some 251 | (C 252 | and (s some A))) | BASE <http://example.org/ontology/> 253 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 254 | 255 | SELECT DISTINCT ?x 256 | WHERE 257 | { ?x rdf:type <B> . 258 | ?x <r> ?s0 . 259 | ?s0 rdf:type <C> . 260 | ?s0 <s> ?s1 . 261 | ?s1 rdf:type <A> 262 | } 263 | |
Place 265 | and (language min 2 Language) | BASE <http://example.org/ontology/> 266 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 267 | 268 | SELECT DISTINCT ?x 269 | WHERE 270 | { ?x rdf:type <Place> 271 | { SELECT ?x 272 | WHERE 273 | { ?x <language> ?s0 . 274 | ?s0 rdf:type <Language> 275 | } 276 | GROUP BY ?x 277 | HAVING ( COUNT(?s0) >= 2 ) 278 | } 279 | } 280 | |
(not (A)) 282 | and (r some (s some (not (B)))) | BASE <http://example.org/ontology/> 283 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 284 | 285 | SELECT DISTINCT ?x 286 | WHERE 287 | { FILTER NOT EXISTS {?x rdf:type <A>} 288 | ?x <r> ?s0 . 289 | ?s0 <s> ?s1 290 | FILTER NOT EXISTS {?s1 rdf:type <B>} 291 | } 292 | |
A or B | BASE <http://example.org/ontology/> 294 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 295 | 296 | SELECT DISTINCT ?x 297 | WHERE 298 | { { ?x rdf:type <A>} 299 | UNION 300 | { ?x rdf:type <B>} 301 | } 302 | |
(not (A)) or (not (B)) | BASE <http://example.org/ontology/> 304 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 305 | 306 | SELECT DISTINCT ?x 307 | WHERE 308 | { { ?x ?p ?o 309 | FILTER NOT EXISTS {?x rdf:type <A>} 310 | } 311 | UNION 312 | { ?x ?p ?o 313 | FILTER NOT EXISTS {?x rdf:type <B>} 314 | } 315 | } 316 | |
not (B) | BASE <http://example.org/ontology/> 318 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 319 | 320 | SELECT DISTINCT ?x 321 | WHERE 322 | { ?x ?p ?o 323 | FILTER NOT EXISTS {?x rdf:type <B>} 324 | } 325 | |
{a , b} | BASE <http://example.org/ontology/> 327 | 328 | SELECT DISTINCT ?x 329 | WHERE 330 | { VALUES ?x { <a> <b> }} 331 | |
r some B | BASE <http://example.org/ontology/> 333 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 334 | 335 | SELECT DISTINCT ?x 336 | WHERE 337 | { ?x <r> ?s0 . 338 | ?s0 rdf:type <B> 339 | } 340 | |
r some 342 | (A 343 | and (not (B))) | BASE <http://example.org/ontology/> 344 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 345 | 346 | SELECT DISTINCT ?x 347 | WHERE 348 | { ?x <r> ?s0 . 349 | ?s0 rdf:type <A> 350 | FILTER NOT EXISTS {?s0 rdf:type <B>} 351 | } 352 | |
r some ({a}) 354 | (logically equivalent to 355 | r value a) | BASE <http://example.org/ontology/> 356 | 357 | SELECT DISTINCT ?x 358 | WHERE 359 | { ?x <r> <a>} 360 | |
r some ({a , b}) | BASE <http://example.org/ontology/> 362 | 363 | SELECT DISTINCT ?x 364 | WHERE 365 | { ?x <r> ?s0 366 | VALUES ?s0 { <a> <b> } 367 | } 368 | |
language only Language | BASE <http://example.org/ontology/> 370 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 371 | 372 | SELECT DISTINCT ?x 373 | WHERE 374 | { ?x ?p ?o 375 | FILTER NOT EXISTS {?x <language> ?s1 376 | FILTER NOT EXISTS {?s1 rdf:type <Language>} 377 | } 378 | } 379 | |
r only B | BASE <http://example.org/ontology/> 381 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 382 | 383 | SELECT DISTINCT ?x 384 | WHERE 385 | { ?x ?p ?o 386 | FILTER NOT EXISTS {?x <r> ?s1 387 | FILTER NOT EXISTS {?s1 rdf:type <B>} 388 | } 389 | } 390 | |
r only Thing 392 | (logically equivalent to 393 | Thing) | BASE <http://example.org/ontology/> 394 | 395 | SELECT DISTINCT ?x 396 | WHERE 397 | { ?x ?p ?o} 398 | |
r only 400 | (A 401 | and (s only Thing)) 402 | (logically equivalent to 403 | r only A) | BASE <http://example.org/ontology/> 404 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 405 | 406 | SELECT DISTINCT ?x 407 | WHERE 408 | { ?x ?p ?o 409 | FILTER NOT EXISTS {?x <r> ?s1 410 | FILTER NOT EXISTS {?s1 rdf:type <A>} 411 | } 412 | } 413 | |
r only 415 | (A or (s only Thing)) 416 | (logically equivalent to 417 | Thing) | BASE <http://example.org/ontology/> 418 | 419 | SELECT DISTINCT ?x 420 | WHERE 421 | { ?x ?p ?o} 422 | |
r only (s only Thing) 424 | (logically equivalent to 425 | Thing) | BASE <http://example.org/ontology/> 426 | 427 | SELECT DISTINCT ?x 428 | WHERE 429 | { ?x ?p ?o} 430 | |
r value a | BASE <http://example.org/ontology/> 432 | 433 | SELECT DISTINCT ?x 434 | WHERE 435 | { ?x <r> <a>} 436 | |
language min 2 Language | BASE <http://example.org/ontology/> 438 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 439 | 440 | SELECT DISTINCT ?x 441 | WHERE 442 | { ?x <language> ?s0 . 443 | ?s0 rdf:type <Language> 444 | } 445 | GROUP BY ?x 446 | HAVING ( COUNT(?s0) >= 2 ) 447 | |
t some (integer or (boolean and {1 , 2})) | BASE <http://example.org/ontology/> 449 | PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 450 | 451 | SELECT DISTINCT ?x 452 | WHERE 453 | { ?x <t> ?s0 454 | FILTER ( ( datatype(?s0) = xsd:integer ) || ( ( datatype(?s0) = xsd:boolean ) && ( ?s0 IN (1, 2) ) ) ) 455 | } 456 | |
t some not ({1 , 2}) | BASE <http://example.org/ontology/> 458 | 459 | SELECT DISTINCT ?x 460 | WHERE 461 | { ?x <t> ?s0 462 | FILTER ( ?s0 NOT IN (1, 2) ) 463 | } 464 | |
t some {1 , 2} | BASE <http://example.org/ontology/> 466 | 467 | SELECT DISTINCT ?x 468 | WHERE 469 | { ?x <t> ?s0 470 | FILTER ( ?s0 IN (1, 2) ) 471 | } 472 | |
t some (boolean and {1 , 2}) | BASE <http://example.org/ontology/> 474 | PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 475 | 476 | SELECT DISTINCT ?x 477 | WHERE 478 | { ?x <t> ?s0 479 | FILTER ( ( datatype(?s0) = xsd:boolean ) && ( ?s0 IN (1, 2) ) ) 480 | } 481 | |
t some PlainLiteral[length 10] | BASE <http://example.org/ontology/> 483 | 484 | SELECT DISTINCT ?x 485 | WHERE 486 | { ?x <t> ?s0 487 | FILTER strlen(( str(?s0) = 10 )) 488 | } 489 | |
t some integer[>= 3 , < 10] | BASE <http://example.org/ontology/> 491 | 492 | SELECT DISTINCT ?x 493 | WHERE 494 | { ?x <t> ?s0 495 | FILTER ( ( ?s0 >= 3 ) && ( ?s0 < 10 ) ) 496 | } 497 | |
t only boolean | BASE <http://example.org/ontology/> 499 | PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 500 | 501 | SELECT DISTINCT ?x 502 | WHERE 503 | { ?x ?p ?o 504 | FILTER NOT EXISTS {?x <t> ?s1 505 | FILTER ( datatype(?s1) != xsd:boolean ) 506 | } 507 | } 508 | |
t only {1} | BASE <http://example.org/ontology/> 510 | 511 | SELECT DISTINCT ?x 512 | WHERE 513 | { ?x ?p ?o 514 | FILTER NOT EXISTS {?x <t> ?s1 515 | FILTER ( ?s1 NOT IN (1) ) 516 | } 517 | } 518 | |
Class Expression | 51 |SPARQL Query | 52 |
---|---|
A | BASE <http://example.org/ontology/> 54 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 55 | 56 | SELECT DISTINCT ?x 57 | WHERE 58 | { ?x rdf:type <A>} 59 | |
A 61 | and (B or (not (r some Thing))) | BASE <http://example.org/ontology/> 62 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 63 | 64 | SELECT DISTINCT ?x 65 | WHERE 66 | { ?x rdf:type <A> 67 | { ?x rdf:type <B>} 68 | UNION 69 | { ?x ?p ?o 70 | FILTER NOT EXISTS {?x <r> ?s0} 71 | } 72 | } 73 | |
A 75 | and (not (B)) | BASE <http://example.org/ontology/> 76 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 77 | 78 | SELECT DISTINCT ?x 79 | WHERE 80 | { ?x rdf:type <A> 81 | FILTER NOT EXISTS {?x rdf:type <B>} 82 | } 83 | |
A 85 | and (not (r some B)) | BASE <http://example.org/ontology/> 86 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 87 | 88 | SELECT DISTINCT ?x 89 | WHERE 90 | { ?x rdf:type <A> 91 | FILTER NOT EXISTS {?x <r> ?s0 . 92 | ?s0 rdf:type <B> 93 | } 94 | } 95 | |
A 97 | and (r some Self ) | BASE <http://example.org/ontology/> 98 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 99 | 100 | SELECT DISTINCT ?x 101 | WHERE 102 | { ?x rdf:type <A> . 103 | ?x <r> ?x 104 | } 105 | |
A 107 | and (t some boolean) | BASE <http://example.org/ontology/> 108 | PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 109 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 110 | 111 | SELECT DISTINCT ?x 112 | WHERE 113 | { ?x rdf:type <A> . 114 | ?x <t> ?s0 115 | FILTER ( datatype(?s0) = xsd:boolean ) 116 | } 117 | |
A 119 | and (t some not boolean) | BASE <http://example.org/ontology/> 120 | PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 121 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 122 | 123 | SELECT DISTINCT ?x 124 | WHERE 125 | { ?x rdf:type <A> . 126 | ?x <t> ?s0 127 | FILTER ( datatype(?s0) != xsd:boolean ) 128 | } 129 | |
A 131 | and (t value 1) | BASE <http://example.org/ontology/> 132 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 133 | 134 | SELECT DISTINCT ?x 135 | WHERE 136 | { ?x rdf:type <A> . 137 | ?x <t> 1 138 | } 139 | |
A 141 | and (t min 2 boolean) | BASE <http://example.org/ontology/> 142 | PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 143 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 144 | 145 | SELECT DISTINCT ?x 146 | WHERE 147 | { ?x rdf:type <A> 148 | { SELECT ?x 149 | WHERE 150 | { ?x <t> ?s0 151 | FILTER ( datatype(?s0) = xsd:boolean ) 152 | } 153 | GROUP BY ?x 154 | HAVING ( COUNT(?s0) >= 2 ) 155 | } 156 | } 157 | |
B 159 | and (r some B) | BASE <http://example.org/ontology/> 160 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 161 | 162 | SELECT DISTINCT ?x 163 | WHERE 164 | { ?x rdf:type <B> . 165 | ?x <r> ?s0 . 166 | ?s0 rdf:type <B> 167 | } 168 | |
B 170 | and (r some B) 171 | and (s some A) | BASE <http://example.org/ontology/> 172 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 173 | 174 | SELECT DISTINCT ?x 175 | WHERE 176 | { ?x rdf:type <B> . 177 | ?x <r> ?s0 . 178 | ?s0 rdf:type <B> . 179 | ?x <s> ?s1 . 180 | ?s1 rdf:type <A> 181 | } 182 | |
B 184 | and (r some 185 | (C 186 | and (s some A))) | BASE <http://example.org/ontology/> 187 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 188 | 189 | SELECT DISTINCT ?x 190 | WHERE 191 | { ?x rdf:type <B> . 192 | ?x <r> ?s0 . 193 | ?s0 rdf:type <C> . 194 | ?s0 <s> ?s1 . 195 | ?s1 rdf:type <A> 196 | } 197 | |
Place 199 | and (language min 2 Language) | BASE <http://example.org/ontology/> 200 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 201 | 202 | SELECT DISTINCT ?x 203 | WHERE 204 | { ?x rdf:type <Place> 205 | { SELECT ?x 206 | WHERE 207 | { ?x <language> ?s0 . 208 | ?s0 rdf:type <Language> 209 | } 210 | GROUP BY ?x 211 | HAVING ( COUNT(?s0) >= 2 ) 212 | } 213 | } 214 | |
(not (A)) 216 | and (r some (s some (not (B)))) | BASE <http://example.org/ontology/> 217 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 218 | 219 | SELECT DISTINCT ?x 220 | WHERE 221 | { FILTER NOT EXISTS {?x rdf:type <A>} 222 | ?x <r> ?s0 . 223 | ?s0 <s> ?s1 224 | FILTER NOT EXISTS {?s1 rdf:type <B>} 225 | } 226 | |
A or B | BASE <http://example.org/ontology/> 228 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 229 | 230 | SELECT DISTINCT ?x 231 | WHERE 232 | { { ?x rdf:type <A>} 233 | UNION 234 | { ?x rdf:type <B>} 235 | } 236 | |
(not (A)) or (not (B)) | BASE <http://example.org/ontology/> 238 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 239 | 240 | SELECT DISTINCT ?x 241 | WHERE 242 | { { ?x ?p ?o 243 | FILTER NOT EXISTS {?x rdf:type <A>} 244 | } 245 | UNION 246 | { ?x ?p ?o 247 | FILTER NOT EXISTS {?x rdf:type <B>} 248 | } 249 | } 250 | |
not (B) | BASE <http://example.org/ontology/> 252 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 253 | 254 | SELECT DISTINCT ?x 255 | WHERE 256 | { ?x ?p ?o 257 | FILTER NOT EXISTS {?x rdf:type <B>} 258 | } 259 | |
{a , b} | BASE <http://example.org/ontology/> 261 | 262 | SELECT DISTINCT ?x 263 | WHERE 264 | { VALUES ?x { <a> <b> }} 265 | |
r some B | BASE <http://example.org/ontology/> 267 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 268 | 269 | SELECT DISTINCT ?x 270 | WHERE 271 | { ?x <r> ?s0 . 272 | ?s0 rdf:type <B> 273 | } 274 | |
r some 276 | (A 277 | and (not (B))) | BASE <http://example.org/ontology/> 278 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 279 | 280 | SELECT DISTINCT ?x 281 | WHERE 282 | { ?x <r> ?s0 . 283 | ?s0 rdf:type <A> 284 | FILTER NOT EXISTS {?s0 rdf:type <B>} 285 | } 286 | |
r some ({a}) 288 | (logically equivalent to 289 | r value a) | BASE <http://example.org/ontology/> 290 | 291 | SELECT DISTINCT ?x 292 | WHERE 293 | { ?x <r> <a>} 294 | |
r some ({a , b}) | BASE <http://example.org/ontology/> 296 | 297 | SELECT DISTINCT ?x 298 | WHERE 299 | { ?x <r> ?s0 300 | VALUES ?s0 { <a> <b> } 301 | } 302 | |
language only Language | BASE <http://example.org/ontology/> 304 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 305 | 306 | SELECT DISTINCT ?x 307 | WHERE 308 | { ?x ?p ?o 309 | FILTER NOT EXISTS {?x <language> ?s1 310 | FILTER NOT EXISTS {?s1 rdf:type <Language>} 311 | } 312 | } 313 | |
r only B | BASE <http://example.org/ontology/> 315 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 316 | 317 | SELECT DISTINCT ?x 318 | WHERE 319 | { ?x ?p ?o 320 | FILTER NOT EXISTS {?x <r> ?s1 321 | FILTER NOT EXISTS {?s1 rdf:type <B>} 322 | } 323 | } 324 | |
r only Thing 326 | (logically equivalent to 327 | Thing) | BASE <http://example.org/ontology/> 328 | 329 | SELECT DISTINCT ?x 330 | WHERE 331 | { ?x ?p ?o} 332 | |
r only 334 | (A 335 | and (s only Thing)) 336 | (logically equivalent to 337 | r only A) | BASE <http://example.org/ontology/> 338 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 339 | 340 | SELECT DISTINCT ?x 341 | WHERE 342 | { ?x ?p ?o 343 | FILTER NOT EXISTS {?x <r> ?s1 344 | FILTER NOT EXISTS {?s1 rdf:type <A>} 345 | } 346 | } 347 | |
r only 349 | (A or (s only Thing)) 350 | (logically equivalent to 351 | Thing) | BASE <http://example.org/ontology/> 352 | 353 | SELECT DISTINCT ?x 354 | WHERE 355 | { ?x ?p ?o} 356 | |
r only (s only Thing) 358 | (logically equivalent to 359 | Thing) | BASE <http://example.org/ontology/> 360 | 361 | SELECT DISTINCT ?x 362 | WHERE 363 | { ?x ?p ?o} 364 | |
r value a | BASE <http://example.org/ontology/> 366 | 367 | SELECT DISTINCT ?x 368 | WHERE 369 | { ?x <r> <a>} 370 | |
language min 2 Language | BASE <http://example.org/ontology/> 372 | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 373 | 374 | SELECT DISTINCT ?x 375 | WHERE 376 | { ?x <language> ?s0 . 377 | ?s0 rdf:type <Language> 378 | } 379 | GROUP BY ?x 380 | HAVING ( COUNT(?s0) >= 2 ) 381 | |
t some (integer or (boolean and {1 , 2})) | BASE <http://example.org/ontology/> 383 | PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 384 | 385 | SELECT DISTINCT ?x 386 | WHERE 387 | { ?x <t> ?s0 388 | FILTER ( ( datatype(?s0) = xsd:integer ) || ( ( datatype(?s0) = xsd:boolean ) && ( ?s0 IN (1, 2) ) ) ) 389 | } 390 | |
t some not ({1 , 2}) | BASE <http://example.org/ontology/> 392 | 393 | SELECT DISTINCT ?x 394 | WHERE 395 | { ?x <t> ?s0 396 | FILTER ( ?s0 NOT IN (1, 2) ) 397 | } 398 | |
t some {1 , 2} | BASE <http://example.org/ontology/> 400 | 401 | SELECT DISTINCT ?x 402 | WHERE 403 | { ?x <t> ?s0 404 | FILTER ( ?s0 IN (1, 2) ) 405 | } 406 | |
t some (boolean and {1 , 2}) | BASE <http://example.org/ontology/> 408 | PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 409 | 410 | SELECT DISTINCT ?x 411 | WHERE 412 | { ?x <t> ?s0 413 | FILTER ( ( datatype(?s0) = xsd:boolean ) && ( ?s0 IN (1, 2) ) ) 414 | } 415 | |
t some PlainLiteral[length 10] | BASE <http://example.org/ontology/> 417 | 418 | SELECT DISTINCT ?x 419 | WHERE 420 | { ?x <t> ?s0 421 | FILTER strlen(( str(?s0) = 10 )) 422 | } 423 | |
t some integer[>= 3 , < 10] | BASE <http://example.org/ontology/> 425 | 426 | SELECT DISTINCT ?x 427 | WHERE 428 | { ?x <t> ?s0 429 | FILTER ( ( ?s0 >= 3 ) && ( ?s0 < 10 ) ) 430 | } 431 | |
t only boolean | BASE <http://example.org/ontology/> 433 | PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 434 | 435 | SELECT DISTINCT ?x 436 | WHERE 437 | { ?x ?p ?o 438 | FILTER NOT EXISTS {?x <t> ?s1 439 | FILTER ( datatype(?s1) != xsd:boolean ) 440 | } 441 | } 442 | |
t only {1} | BASE <http://example.org/ontology/> 444 | 445 | SELECT DISTINCT ?x 446 | WHERE 447 | { ?x ?p ?o 448 | FILTER NOT EXISTS {?x <t> ?s1 449 | FILTER ( ?s1 NOT IN (1) ) 450 | } 451 | } 452 | |
targetSubjectVariable
122 | * as single projection variable.
123 | * @param axiom the OWL axiom to convert
124 | * @param targetSubjectVariable the name of the projection variable in the SPARQL
125 | * query
126 | *
127 | * @return the SPARQL query
128 | */
129 | public String convert(OWLAxiom axiom, String targetSubjectVariable){
130 | return convert(axiom, targetSubjectVariable, objectVar);
131 | }
132 |
133 | /**
134 | * Converts an OWL axiom into a SPARQL query with targetSubjectVariable
135 | * as single projection variable.
136 | * @param axiom the OWL axiom to convert
137 | * @param targetSubjectVariable the name of the subject projection variable in the SPARQL
138 | * query
139 | * @param targetObjectVariable the name of the object projection variable in the SPARQL
140 | * query
141 | * @return the SPARQL query
142 | */
143 | public String convert(OWLAxiom axiom, String targetSubjectVariable, String targetObjectVariable) {
144 | this.subjectVar = targetSubjectVariable;
145 | this.objectVar = targetObjectVariable;
146 |
147 | LOGGER.debug("Converting axiom {}", axiom);
148 | sparql = "";
149 |
150 | String queryString = createSelectClause() + createWhereClause(axiom);
151 |
152 | return queryString;
153 | }
154 |
155 | /**
156 | * Converts an OWL axiom into a SPARQL query using the default variable as
157 | * projection variable.
158 | *
159 | * @param axiom the OWL axiom
160 | * @return the SPARQL query
161 | */
162 | public Query asQuery(OWLAxiom axiom){
163 | return asQuery(axiom, subjectVar, objectVar);
164 | }
165 |
166 | /**
167 | * Converts an OWL axiom into a SPARQL query with targetSubjectVariable
168 | * as single projection variable.
169 | * @param axiom the OWL axiom to convert
170 | * @param targetSubjectVariable the name of the projection variable in the SPARQL
171 | * query
172 | *
173 | * @return the SPARQL query
174 | */
175 | public Query asQuery(OWLAxiom axiom, String targetSubjectVariable){
176 | return asQuery(axiom, targetSubjectVariable, objectVar);
177 | }
178 |
179 | /**
180 | * Converts an OWL axiom into a SPARQL query with targetSubjectVariable
181 | * as single projection variable.
182 | * @param axiom the OWL axiom to convert
183 | * @param targetSubjectVariable the name of the subject projection variable in the SPARQL
184 | * query
185 | * @param targetObjectVariable the name of the object projection variable in the SPARQL
186 | * query
187 | * @return the SPARQL query
188 | */
189 | public Query asQuery(OWLAxiom axiom, String targetSubjectVariable, String targetObjectVariable){
190 |
191 | String queryString = convert(axiom, targetSubjectVariable, targetObjectVariable);
192 |
193 | return QueryFactory.create(queryString, Syntax.syntaxARQ);
194 | }
195 |
196 | /**
197 | * Whether to return SPARQL queries with DISTINCT keyword.
198 | * @param useDistinct true
if use DISTINCT, otherwise false
199 | */
200 | public void setUseDistinct(boolean useDistinct) {
201 | this.useDistinct = useDistinct;
202 | }
203 |
204 | private String createSelectClause() {
205 | return "SELECT " + (useDistinct ? " DISTINCT " : "") + subjectVar;
206 | }
207 |
208 | private String createWhereClause(OWLAxiom axiom){
209 | return " WHERE " + createGroupGraphPattern(axiom);
210 | }
211 |
212 | private String createGroupGraphPattern(OWLAxiom axiom) {
213 | expressionConverter = new OWLClassExpressionToSPARQLConverter();
214 | axiom.accept(this);
215 | return "{" + sparql + "}";
216 | }
217 |
218 | private String notExists(String pattern){
219 | return "FILTER NOT EXISTS{" + pattern + "}";
220 | }
221 |
222 | private String notExists(String targetVar, ListrootVariable
as projection variable. It's possible to
116 | * return it as COUNT query if wanted.
117 | *
118 | * @param ce the OWL class expression to convert
119 | * @param rootVariable the name of the projection variable in the SPARQL
120 | * query
121 | * @param countQuery whether to return a SELECT (COUNT(?var) as ?cnt) query
122 | * @return the SPARQL query
123 | */
124 | public String convert(OWLClassExpression ce, String rootVariable, boolean countQuery){
125 | return createSelectClause(countQuery) + createWhereClause(ce) + createSolutionModifier();
126 | }
127 |
128 | /**
129 | * Converts an OWL class expression into a SPARQL query with
130 | * rootVariable
as projection variable.
131 | *
132 | * @param ce the OWL class expression to convert
133 | * @param rootVariable the name of the projection variable in the SPARQL
134 | * query
135 | * @return the SPARQL query
136 | */
137 | public Query asQuery(OWLClassExpression ce, String rootVariable){
138 | return asQuery(rootVariable, ce, Collections.rootVariable
as projection variable. It's possible to
144 | * return it as COUNT query if wanted.
145 | *
146 | * @param ce the OWL class expression to convert
147 | * @param rootVariable the name of the projection variable in the SPARQL
148 | * query
149 | * @param countQuery whether to return a SELECT (COUNT(?var) as ?cnt) query
150 | * @return the SPARQL query
151 | */
152 | public Query asQuery(String rootVariable, OWLClassExpression ce, boolean countQuery){
153 | String queryString = convert(ce, rootVariable, countQuery);
154 |
155 | return QueryFactory.create(queryString, Syntax.syntaxARQ);
156 | }
157 |
158 | /**
159 | * Converts an OWL class expression into a SPARQL query with
160 | * rootVariable
as projection variable. It's possible to
161 | * declare a set of OWL entities which will be replaced by variables
162 | * in the query, that are then additionally used as projection variables
163 | * and grouping variables.
164 | *
165 | * @param ce the OWL class expression to convert
166 | * @param rootVariable the name of the projection variable in the SPARQL
167 | * query
168 | * @param variableEntities a set of entities that are replaced by variables
169 | * @return the SPARQL query
170 | */
171 | public Query asQuery(String rootVariable, OWLClassExpression ce, Set extends OWLEntity> variableEntities){
172 | return asQuery(rootVariable, ce, variableEntities, false);
173 | }
174 |
175 | /**
176 | * Converts an OWL class expression into a SPARQL query with
177 | * rootVariable
as projection variable. It's possible to
178 | * declare a set of OWL entities which will be replaced by variables
179 | * in the query, that are then additionally used as projection variables
180 | * and grouping variables. Moreover, it's possible to
181 | * return a COUNT query if wanted.
182 | *
183 | * @param ce the OWL class expression to convert
184 | * @param rootVariable the name of the projection variable in the SPARQL
185 | * query
186 | * @param variableEntities a set of entities that are replaced by variables
187 | * @param countQuery whether to return a SELECT (COUNT(?var) as ?cnt) query
188 | * @return the SPARQL query
189 | */
190 | public Query asQuery(String rootVariable, OWLClassExpression ce, Set extends OWLEntity> variableEntities, boolean countQuery){
191 | this.variableEntities = variableEntities;
192 |
193 | String queryString = "SELECT DISTINCT ";
194 |
195 | String triplePattern = asGroupGraphPattern(ce, rootVariable, true);
196 |
197 | if(variableEntities.isEmpty()){
198 | queryString += rootVariable + " WHERE {";
199 | } else {
200 | for (OWLEntity owlEntity : variableEntities) {
201 | String var = mapping.get(owlEntity);
202 | queryString += var + " ";
203 | }
204 | if(countQuery){
205 | queryString += "(COUNT(DISTINCT " + rootVariable + ") AS ?cnt)";
206 | } else {
207 | queryString += rootVariable;
208 | }
209 | queryString += " WHERE {";
210 | }
211 |
212 | queryString += triplePattern;
213 | queryString += "}";
214 |
215 | if (countQuery && !variableEntities.isEmpty()) {
216 | queryString += "GROUP BY ";
217 | for (OWLEntity owlEntity : variableEntities) {
218 | String var = mapping.get(owlEntity);
219 | queryString += var;
220 | }
221 | queryString += " ORDER BY DESC(?cnt)";
222 | }
223 | queryString += appendix;
224 | logger.debug("Query: {}", queryString);
225 | return QueryFactory.create(queryString, Syntax.syntaxSPARQL_11);
226 | }
227 |
228 | /**
229 | * Converts an OWL class expression into a GroupGraphPattern, which can be described
230 | * as the outer-most graph pattern in a query, sometimes also called the query pattern.
231 | * @param ce the OWL class expression
232 | * @param rootVariable the name of the projection variable
233 | * @return a SPARQL graph pattern
234 | */
235 | public String asGroupGraphPattern(OWLClassExpression ce, String rootVariable){
236 | return asGroupGraphPattern(ce, rootVariable, false);
237 | }
238 |
239 | /**
240 | * Converts an OWL class expression into a GroupGraphPattern, which can be described
241 | * as the outer-most graph pattern in a query, sometimes also called the query pattern.
242 | * @param ce the OWL class expression
243 | * @param rootVariable the name of the projection variable
244 | * @param needOuterTriplePattern whether
245 | * @return a SPARQL graph pattern
246 | */
247 | public String asGroupGraphPattern(OWLClassExpression ce, String rootVariable, boolean needOuterTriplePattern){
248 | this.needOuterTriplePattern = needOuterTriplePattern;
249 | reset();
250 | variables.push(rootVariable);
251 |
252 | // minimize the class expression
253 | this.expr = minimizer.minimizeClone(ce);
254 | if(!expr.equals(ce)) {
255 | logger.info("CE rewritten to " + expr);
256 | }
257 |
258 | if(expr.equals(df.getOWLThing())) {
259 | logger.warn("Expression is logically equivalent to owl:Thing, thus, the SPARQL query returns all triples.");
260 | }
261 |
262 | // convert
263 | expr.accept(this);
264 |
265 | return sparql;
266 | }
267 |
268 | /**
269 | * Converts an OWL data range into a GroupGraphPattern.
270 | * @param dr the OWL data range
271 | * @param rootVariable the name of the projection variable
272 | * @return a SPARQL graph pattern
273 | */
274 | public String asGroupGraphPattern(OWLDataRange dr, String rootVariable)
275 | {
276 | reset();
277 | variables.push(rootVariable);
278 |
279 | // convert
280 | dr.accept(this);
281 |
282 | return sparql;
283 | }
284 |
285 | /**
286 | * Whether to return SPARQL queries with DISTINCT keyword.
287 | * @param useDistinct true
if use DISTINCT, otherwise false
288 | */
289 | public void setUseDistinct(boolean useDistinct) {
290 | this.useDistinct = useDistinct;
291 | }
292 |
293 | /**
294 | * Since SPARQL 1.1 there is a mechanism called property
295 | * paths (see W3C rec.),
296 | * which allows to add some kind of light-weight inferencing to a SPARQL query.
297 | *
298 | * Currently, we do the following if enabled
299 | *
300 | * owl:allValuesFrom
into SPARQL.
323 | *
324 | * @param allQuantorTranslation the allQuantorTranslation to set
325 | */
326 | public void setAllQuantorTranslation(AllQuantorTranslation allQuantorTranslation) {
327 | this.allQuantorTranslation = allQuantorTranslation;
328 | }
329 |
330 | /**
331 | * How to express owl:Thing
in SPARQL.
332 | * @param owlThingRendering the owlThingRendering to set
333 | */
334 | public void setOwlThingRendering(OWLThingRendering owlThingRendering) {
335 | this.owlThingRendering = owlThingRendering;
336 | }
337 |
338 | public VariablesMapping getVariablesMapping() {
339 | return mapping;
340 | }
341 |
342 | private String createSelectClause(boolean countQuery) {
343 | return "SELECT " + (countQuery ? "(COUNT(" : "") + (useDistinct ? " DISTINCT " : "") + variables.firstElement() + (countQuery ? " AS " + countVar + ")" : "");
344 | }
345 |
346 | private String createWhereClause(OWLClassExpression ce){
347 | return " WHERE " + createGroupGraphPattern(ce);
348 | }
349 |
350 | private String createGroupGraphPattern(OWLClassExpression ce) {
351 | ce.accept(this);
352 | return "{" + sparql + "}";
353 | }
354 |
355 | // private OWLClassExpression rewrite(OWLClassExpression ce) {
356 | //
357 | // }
358 |
359 | private String createSolutionModifier() {
360 | return appendix;
361 | }
362 |
363 | private void reset(){
364 | variables.clear();
365 | properties.clear();
366 | sparql = "";
367 | appendix = "";
368 | intersection = new HashMap<>();
369 | mapping.reset();
370 | }
371 |
372 | private int modalDepth(){
373 | return variables.size();
374 | }
375 |
376 | /**
377 | * Checks whether the intersection contains at least one operand that
378 | * is not a negation.
379 | * @param intersection the intersection
380 | * @return whether the intersection contains at least one operand that
381 | * is not a negation.
382 | */
383 | private boolean containsNonNegationOperand(OWLObjectIntersectionOf intersection){
384 | for (OWLClassExpression op : intersection.getOperands()) {
385 | if(op.getClassExpressionType() != ClassExpressionType.OBJECT_COMPLEMENT_OF){
386 | return true;
387 | }
388 | }
389 | return false;
390 | }
391 |
392 | private boolean inIntersection(){
393 | return intersection.containsKey(modalDepth()) ? intersection.get(modalDepth()) : false;
394 | }
395 |
396 | private void enterIntersection(){
397 | naryExpressions.push(1);
398 | intersection.put(modalDepth(), true);
399 | }
400 |
401 | private void leaveIntersection(){
402 | naryExpressions.pop();
403 | intersection.remove(modalDepth());
404 | }
405 |
406 | private String asTriplePattern(String subject, String predicate, String object){
407 | return String.format(TRIPLE_PATTERN, subject, predicate, object);
408 | }
409 |
410 | private String asTriplePattern(String subject, OWLEntity predicate, OWLEntity object){
411 | return asTriplePattern(subject, render(predicate), render(object));
412 | }
413 |
414 | private String asTriplePattern(String subject, OWLEntity predicate, String object){
415 | return asTriplePattern(subject, render(predicate), object);
416 | }
417 |
418 | private String asTriplePattern(String subject, OWLEntity predicate, OWLLiteral object){
419 | return asTriplePattern(subject, render(predicate), render(object));
420 | }
421 |
422 | private String genericTriplePattern(){
423 | // BasicPattern bgp = new BasicPattern();
424 | // bgp.add(Triple.create(NodeFactory.createVariable("s"), NodeFactory.createVariable("s"), NodeFactory.createVariable("s")));
425 | // System.out.println(FormatterElement.asString(new ElementTriplesBlock(bgp)));
426 | return variables.peek() + " ?p ?o .";
427 | }
428 |
429 | private String typeTriplePattern(String var, String type){
430 | return var + (useReasoning ? " owl:allValuesFrom
in SPARQL.
24 | *
25 | * @author Lorenz Buehmann
26 | *
27 | */
28 | public enum AllQuantorTranslation {
29 | /**
30 | * Use double negation, e.g.
31 | * 33 | * FILTER NOT EXISTS { 34 | * ?s :p ?o . 35 | * FILTER NOT EXISTS { ?o a :Class } 36 | * } 37 | *38 | * And addition, this mode tries to cover the completed semantics of \forall by also addressing the case in which 39 | * there is no :p successor at all. This leads to the graph pattern 40 | *
41 | * { 42 | * ?s ?p ?o . 43 | * FILTER NOT EXISTS { 44 | * ?s :p ?o1 . 45 | * } UNION { 46 | * ?s :p ?o . 47 | * FILTER NOT EXISTS { 48 | * ?s :p ?o . 49 | * FILTER NOT EXISTS { ?o a :Class } 50 | * } 51 | * } 52 | *53 | *
60 | * FILTER NOT EXISTS { 61 | * ?s :p ?o . 62 | * FILTER NOT EXISTS { ?o a :Class } 63 | * } 64 | *65 | *
72 | * ?s ?p ?o . 73 | * {SELECT (COUNT(*) AS ?cnt1) WHERE { ?s :p ?o } } 74 | * {SELECT (COUNT(*) AS ?cnt1) WHERE { ?s :p ?o . ?o a :Class } } 75 | * FILTER (?cnt1 = ?cnt2) 76 | *77 | *
FILTER(?x = 1)
.
36 | */
37 | VALUE_EQUALTIY,
38 | /**
39 | * Term equality uses the SAMETERM function, e.g.
40 | * FILTER(SAMETERM(?x, 1))
.
41 | *
42 | * Term equality only returns true if the RDF terms are identical. So if
43 | * the RDF term in the database was encoded as “001”^^xsd:integer
44 | * term equality would give false whereas value equality would return true
45 | * because the value of the terms is equivalent.
46 | */
47 | TERM_EQUALITY
48 | }
--------------------------------------------------------------------------------
/src/main/java/org/aksw/owl2sparql/style/NominalTranslation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * #%L
3 | * owl2sparql-core
4 | * %%
5 | * Copyright (C) 2015 - 2016 AKSW
6 | * %%
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | * #L%
19 | */
20 | package org.aksw.owl2sparql.style;
21 |
22 | /**
23 | * @author Lorenz Buehmann
24 | */
25 | public enum NominalTranslation {
26 |
27 | FILTER_IN,
28 | VALUES
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/org/aksw/owl2sparql/style/OWLThingRendering.java:
--------------------------------------------------------------------------------
1 | /*
2 | * #%L
3 | * owl2sparql-core
4 | * %%
5 | * Copyright (C) 2015 AKSW
6 | * %%
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | * #L%
19 | */
20 | package org.aksw.owl2sparql.style;
21 |
22 | /**
23 | * The way how owl:Thing
in OWL class expressions is mapped to
24 | * SPARQL.
25 | *
?s a owl:Thing .
35 | */
36 | EXPLICIT,
37 | /**
38 | * Use a generic triple pattern ?s ?p ?o .
39 | */
40 | GENERIC_TRIPLE_PATTERN
41 | }
--------------------------------------------------------------------------------
/src/main/java/org/aksw/owl2sparql/util/OWLClassExpressionMinimizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * #%L
3 | * owl2sparql-core
4 | * %%
5 | * Copyright (C) 2015 AKSW
6 | * %%
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | * #L%
19 | */
20 | package org.aksw.owl2sparql.util;
21 |
22 | import java.util.HashSet;
23 | import java.util.List;
24 | import java.util.Set;
25 |
26 | import org.semanticweb.owlapi.model.OWLClass;
27 | import org.semanticweb.owlapi.model.OWLClassExpression;
28 | import org.semanticweb.owlapi.model.OWLClassExpressionVisitorEx;
29 | import org.semanticweb.owlapi.model.OWLDataAllValuesFrom;
30 | import org.semanticweb.owlapi.model.OWLDataExactCardinality;
31 | import org.semanticweb.owlapi.model.OWLDataFactory;
32 | import org.semanticweb.owlapi.model.OWLDataHasValue;
33 | import org.semanticweb.owlapi.model.OWLDataMaxCardinality;
34 | import org.semanticweb.owlapi.model.OWLDataMinCardinality;
35 | import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom;
36 | import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom;
37 | import org.semanticweb.owlapi.model.OWLObjectComplementOf;
38 | import org.semanticweb.owlapi.model.OWLObjectExactCardinality;
39 | import org.semanticweb.owlapi.model.OWLObjectHasSelf;
40 | import org.semanticweb.owlapi.model.OWLObjectHasValue;
41 | import org.semanticweb.owlapi.model.OWLObjectIntersectionOf;
42 | import org.semanticweb.owlapi.model.OWLObjectMaxCardinality;
43 | import org.semanticweb.owlapi.model.OWLObjectMinCardinality;
44 | import org.semanticweb.owlapi.model.OWLObjectOneOf;
45 | import org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom;
46 | import org.semanticweb.owlapi.model.OWLObjectUnionOf;
47 | import org.semanticweb.owlapi.util.OWLObjectDuplicator;
48 |
49 | /**
50 | * @author Lorenz Buehmann
51 | *
52 | */
53 | public class OWLClassExpressionMinimizer implements OWLClassExpressionVisitorEx" + ceString + "", "
" + queryString + ""); 266 | } 267 | com.google.common.io.Files.write(html.build(), new File("examples/owl2sparql-examples.html"), Charsets.UTF_8); 268 | // Files.write(Paths.get("/tmp/owl2sparql.html"), Arrays.asList(html.build().split("\n")), Charset.forName("UTF-8")); 269 | } 270 | } 271 | -------------------------------------------------------------------------------- /src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # suppress inspection "UnusedProperty" for whole file 2 | # All loggers will default to the INFO level unless specified in a specific logger 3 | # For more information, see the Log4J API manual at: http://bit.ly/KmvtWL . 4 | log4j.rootLogger=INFO, stdout 5 | 6 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 7 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 8 | log4j.appender.stdout.layout.ConversionPattern= %-4r [%t] %-5p %c %x - %m%n 9 | 10 | # basic log level 11 | log4j.logger.org.aksw.owl2sparql=DEBUG 12 | 13 | # hide OWL API warning "entityExpansionLimit not supported by parser" 14 | log4j.logger.org.semanticweb.owlapi.util.SAXParsers=ERROR 15 | # hide OWL API warning "dumping remaining triples" 16 | log4j.logger.org.semanticweb.owlapi.rdf.rdfxml.parser.OWLRDFConsumer=ERROR 17 | 18 | 19 | 20 | --------------------------------------------------------------------------------