From de2d6fa64af49156db6328db775aa33c876e2348 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Thu, 29 Sep 2016 18:28:36 +0200 Subject: [PATCH] [TASK] Use FILTER NOT EXISTS instead of OPTIONAL juggling. --- src/main/java/lu/jpt/csparqltest/Main.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/lu/jpt/csparqltest/Main.java b/src/main/java/lu/jpt/csparqltest/Main.java index 06a1794..d48d8a3 100644 --- a/src/main/java/lu/jpt/csparqltest/Main.java +++ b/src/main/java/lu/jpt/csparqltest/Main.java @@ -148,14 +148,11 @@ public class Main { + " BIND(f:timestamp(?a,rdf:type,) AS ?tsa) " + " BIND(f:timestamp(?c,rdf:type,) AS ?tsc) " + " FILTER(?tsa < ?tsc) " - + " OPTIONAL {" + + " FILTER NOT EXISTS { " + " ?b a . " + " BIND(f:timestamp(?b,rdf:type,) 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) " + "}"; }