SPARQL DELETE in 4store

548 views Asked by At

I'm trying to delete a few triples from my triple store but, unfortunately, I can't even get this simple query to work:

WITH <GRAPH> DELETE {
  ?s ?p ?o .
} WHERE {
  <URI> <PREDICATE> ?s .
  ?s ?p ?o .
}

I just want to delete all triples that belong to a subject which is itself connected to the URI I have (with the predicate I have). The WHERE statement in a SELECT query gives me all the solutions that I want to be deleted.

EDIT

Ok, so I kept playing around with it, and for some reason, this works:

WITH <GRAPH> DELETE {
  ?s ?p ?o .
} WHERE {
  <URI> <PREDICATE> ?s .
  {?s ?p ?o .} UNION {?x ?y ?z}
}

Is this really supposed to work like that or is my triple store faulty? (I'm using 4store.)

0

There are 0 answers