[TASK] Use FILTER NOT EXISTS instead of OPTIONAL juggling.

This commit is contained in:
Jan Philipp Timme 2016-09-29 18:28:36 +02:00
parent 1394221d03
commit de2d6fa64a
1 changed files with 2 additions and 5 deletions

View File

@ -148,14 +148,11 @@ public class Main {
+ " BIND(f:timestamp(?a,rdf:type,<http://example.org/type/A>) AS ?tsa) "
+ " BIND(f:timestamp(?c,rdf:type,<http://example.org/type/C>) AS ?tsc) "
+ " FILTER(?tsa < ?tsc) "
+ " OPTIONAL {"
+ " FILTER NOT EXISTS { "
+ " ?b a <http://example.org/type/B> . "
+ " BIND(f:timestamp(?b,rdf:type,<http://example.org/type/B>) AS ?tsb) "
+ " FILTER(?tsb < ?tsa || ?tsc < ?tsb)"
+ " FILTER(?tsa < ?tsb && ?tsb < ?tsc)"
+ " } "
//+ " BIND(BOUND(?b) AS ?bbound) "
//+ " BIND(?tsa < ?tsb AS ?abeforeb) "
//+ " BIND(?tsb < ?tsc AS ?bbeforec) "
+ "}";
}