Hi guys,

I have a problem with specific case of sparql delete statements. I have the 
feeling I am doing something wrong.

My case is having a tree like graph structure starting with a certain subject 
and having multiple levels. The triples for different levels could be in 
different named graphs. I want to create a query that deletes the whole my 
tree. A simplified case contains only two levels.

First level in graph1

INSERT DATA {
    GRAPH <http://graph1> {
        <http://s1> <http://p1> <http:/s2>
    }
};

Second level in graph2

INSERT DATA {
    GRAPH <http:graph2> {
        <http://s2> <http://p2> "literal1" .
        <http://s2> <http://p3> <http://url1> .
    }
};

I would like to delete the triples from the second graph and any graph actually 
as I don't know the name of the second graph. In my real application the second 
graph will contain many other triples but I want to delete only the triples 
from the second level of my tree.
I use this delete statement:
DELETE {
    GRAPH ?g {
        <http://s1> ?p1 ?o1.
        ?o1 ?p2 ?o2.
    }
} WHERE {
    GRAPH ?g {
        <http://s1> ?p1 ?o1.
        ?o1 ?p2 ?o2.
    }
};

Unfortunately this would not work. It behaves as if deletions are not seeing 
triples across different graphs.

If I put all the triples in the same graph the above delete query will work. I 
am enclosing a junit test case that demonstrates my issue. Can anybody give a 
hand please? Any explanations of why this could behave like that or workarounds 
are very welcome.

Many thanks,
Luchesar

********************************************************************************
   
DISCLAIMER: This e-mail is confidential and should not be used by anyone who is
not the original intended recipient. If you have received this e-mail in error
please inform the sender and delete it from your mailbox or any other storage
mechanism. Neither Macmillan Publishers Limited nor any of its agents accept
liability for any statements made which are clearly the sender's own and not
expressly made on behalf of Macmillan Publishers Limited or one of its agents.
Please note that neither Macmillan Publishers Limited nor any of its agents
accept any responsibility for viruses that may be contained in this e-mail or
its attachments and it is your responsibility to scan the e-mail and 
attachments (if any). No contracts may be concluded on behalf of Macmillan 
Publishers Limited or its agents by means of e-mail communication. Macmillan 
Publishers Limited Registered in England and Wales with registered number 
785998 
Registered Office Brunel Road, Houndmills, Basingstoke RG21 6XS   
********************************************************************************

Reply via email to