DELETE WHERE {
   GRAPH <http://test> {
       ?x <http://a/property>  "a first value" , "a second value" .
       ?x ?p ?v .
} }

        Andy

On 12/07/11 08:50, Camel Christophe wrote:
Mmm, well, in fact it works well but not as I would like. I think the delete 
request is still not well expressed.

Look. If I insert two resources, with the same shared properties, like this :

INSERT DATA INTO<http://test>  {
   <http://a/resourceA/>  <http://a/property>  "a first value" .
   <http://a/resourceA/>  <http://a/property>  "a second value" .
}


INSERT DATA INTO<http://test>  {
   <http://a/resourceB/>  <http://a/property>  "a first value" .
   <http://a/resourceB/>  <http://a/property>  "a second value" .
}

Then the following delete sparql request :

WITH<http://test>
DELETE
{
   ?s ?p ?v
}
WHERE
{
   ?s ?p ?v .
   <http://a/resourceA/>  ?p ?v .
}

deletes these two resources. On reflection, it seems normal.

So what is the easiest way to express the deletion of a resource in sparql?

For now, I delete the triples explicitly after having obtained through a 
'DESCRIBE' query.

-----Message d'origine-----
De : Camel Christophe [mailto:[email protected]]
Envoyé : lundi 11 juillet 2011 17:21
À : [email protected]
Objet : RE: How delete works on Fuseki

Great !!!
The "WITH" request works very well !

Thanks very much.

-----Message d'origine-----
De : Rob Vesse [mailto:[email protected]]
Envoyé : lundi 11 juillet 2011 11:35
À : [email protected]
Objet : RE: How delete works on Fuseki

Hi Camel

Yes the DELETE is formulated incorrectly, you have specified things to be 
deleted but not said explicitly where to delete them from.  So though it is 
matching your triples in a specific graph it tries to delete them from the 
default graph which is not where they are located so they aren't actually 
deleted.

Try the following instead:

WITH<http://test>
DELETE
{
   ?s ?p ?v
}
WHERE
{
   ?s ?p ?v .
   <http://a/resource/>  ?p ?v .
}

The WITH should set the graph to be used both for the DELETE and the WHERE 
clause.  If that doesn't work (or you need to match from one graph but delete 
in another) you can state the GRAPH explicitly in both clauses:

DELETE
{
   GRAPH<http://text>  {
     ?s ?p ?v
   }
}
WHERE
{
   GRAPH<http://test>  {
    ?s ?p ?v .
    http://a/resource/>  ?p ?v .
  }
}

Hope that helps,

Rob Vesse



                            Cliquez sur l'url suivante
https://www.mailcontrol.com/sr/I8H+ScyOqqfTndxI!oX7UguoYhQx!y1acMyL2!cHGMYjUwYO36QqOZRq1IpHlMfVMJZsw5Wz4VZeTFI5G433hQ==
                     si ce message est indésirable (pourriel).

Reply via email to