Hi all,

Not sure if this is the correct/best list but I'm trying to understand the 
graph handling of SPARQL Update. 

Consider this statement evaluated under ARQ 2.9

PREFIX : <http://ex#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

insert data { graph <http://graph1> { <http://ex#a> <http://ex#name> "Meaghan" 
. }} ;

insert data { graph <http://graph2> { <http://ex#b> <http://ex#name> "Gary" . 
}} ;

DELETE { ?x :name ?y }
INSERT {?x rdfs:label ?y }
USING <http://graph1>
USING <http://graph2>
WHERE { ?x :name ?y }

from this command line

bin/update --verbose --update=query.rq --dump

 gets this output

<http://ex#b> <http://www.w3.org/2001/RDFSchema#label> "Gary" .
<http://ex#a> <http://www.w3.org/2001/RDFSchema#label> "Meaghan" .
<http://ex#a> <http://ex#name> "Meaghan" <http://graph1> .
<http://ex#b> <http://ex#name> "Gary" <http://graph2> .

I.e., we found the triples in the WHERE part but they "lost" their graphs and 
so the DELETE didn't delete them and the insert put them in the default graph. 
This makes sense to me and is what I would expect.

but consider this similar query which removes the USING clauses:

PREFIX : <http://ex#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

insert data { graph <http://graph1> { <http://ex#a> <http://ex#name> "Meaghan" 
. }} ;

insert data { graph <http://graph2> { <http://ex#b> <http://ex#name> "Gary" . 
}} ;

DELETE { ?x :name ?y }
INSERT {?x rdfs:label ?y }
WHERE { ?x :name ?y }

Now we get

<http://ex#a> <http://ex#name> "Meaghan" <http://graph1> .
<http://ex#b> <http://ex#name> "Gary" <http://graph2> .

So the WHERE clause found the triples, they retained their individual graphs 
and so the DELETE and INSERT found them as well. What is the rational for that?

thanks,
--
Gary Warren King, metabang.com 
Cell: (413) 559 8738
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM * gwking on twitter

Reply via email to