On 08/10/15 02:33, Zen 98052 wrote:
If I pass this query:


DELETE
{
   ?contactInfo abc:hasEmail ?email .
   ?email ?emailPredicate ?emailObject .
}
WHERE
{
   ?person abc:name "foobar" .
   ?person abc:hasContactInfo ?contactInfo .
}


to this example code below, the it doesn't do anything.

?email and ?emailObject are not bound so
"?contactInfo abc:hasEmail ?email . isn't a triple to delete.

WHERE {
  ?person abc:name "foobar" .
  ?person abc:hasContactInfo ?contactInfo .
  ?contactInfo abc:hasEmail ?email .
  ?email ?emailPredicate ?emailObject .
}

        Andy



    UpdateRequest updateRequest = UpdateFactory.create(sparqlUpdateQuery);
    for (Update update : updateRequest.getOperations()) {
     UpdateAction.parseExecute(update.toString(), graphDataset);
    }



The graphDataset above is subclass of Jena's DatasetGraphBase class, where I 
override the find, add, delete, deleteAny, and some other methods.

I guess I have to query first using the triples in WHERE clause, and then 
populate the query results into bindings, and pass the bindings to 
UpdateAction.parseExecute method?

I looked at Jena's code, and still have no idea where to add that code. Perhaps 
I was wrong, so any hint, or better if there is already existing sample code 
for the case I am looking for?



Thanks,

Z


Reply via email to