Commit d79f8295 authored by Petter Goksøyr Åsen's avatar Petter Goksøyr Åsen
Browse files

services: rewrite delete incoming relations once again

in virtuoso !isIRI != isBlank :/
parent 34c27457
......@@ -831,13 +831,11 @@ public final class SPARQLQueryBuilder {
}
public String deleteIncomingRelations(XURI xuri) {
// query 1) direct relations to node xuri:
// query 2) blank node relating to node xuri
// Using !isIRI instead of IsBLank because virtuoso executes in much faster
// (a node in subject position not IRI, can only be blank node)
// query 1) blank node relating to node xuri
// query 2) remaining direct relations to node xuri (as subject to work for example)
String queryString = format(""
+ "WITH <%2$s> DELETE { ?bn ?p ?o . ?r ?rp ?bn } WHERE { ?bn ?any <%1$s> ; ?p ?o . ?r ?rp ?bn . FILTER(isBlank(?bn)) };"
+ "WITH <%2$s> DELETE { ?s ?p <%1$s> } WHERE { ?s ?p <%1$s> };\n"
+ "WITH <%2$s> DELETE { ?bn ?p ?o . ?r ?rp ?bn } WHERE { ?bn ?any <%1$s> ; ?p ?o . ?r ?rp ?bn . FILTER(!isIRI(?bn)) };"
+ "\n", xuri.getUri(), DEFAULT_GRAPH);
return queryString;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment