Hi,

looks to me as 'expected behavior' - it is the OPTIONAL statement that cause it - since it is not mandatory to produce a solution from the main block of the query, you'll end up with no bindings for ?b ?p2 and ?o2 in the projection so, then the DELETE part of the query will threat the missing bindings as wildcards to issue individual 'remove' operations for each such solution ...

HTH,
Damyan

On 9/18/2012 11:37 AM, Jeni Tennison wrote:
Hi,

I'm hoping someone here can help me with the following behaviour in OWLIM that 
seems odd. I can't work out whether it's a bug in the query or in OWLIM.

First, set up a couple of triples:

BASE <http://example.org/>
INSERT DATA {
   GRAPH <graph> {
     <a> <p> <b> .
     <c> <p> <d> .
   }
}

Then try to delete everything about <a> and everything about things related to it through 
<p> (ie about <b>, though note there are no triples about <b>):

BASE <http://example.org/>
DELETE {
   <a> ?p1 ?o1 .
   ?b ?p2 ?o2 .
} WHERE {
   <a> ?p1 ?o1 .
   OPTIONAL {
     <a> <p> ?b .
     ?b ?p2 ?o2 .
   }
}

When I run this update against this data, everything in the triplestore gets 
deleted. Is this expected behaviour?

Thanks,

Jeni

_______________________________________________
Owlim-discussion mailing list
Owlim-discussion@ontotext.com
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion

Reply via email to