Hi Arthur, Thanks for your response.
If I am reading the specs correctly then it should be possible to do away with the WITH clause by passing the graph name to the endpoint in a query parameter as described here: http://www.w3.org/TR/sparql11-protocol/#update-dataset As you can see I have tried to this in the second query in the POST request: POST /catalogue/update?using-graph-uri=http%3A%2F%2Fnationalarchives.gov.uk <http://2fnationalarchives.gov.uk/>%2Fdri%2Fcatalogue HTTP/1.1 Cheers Rob On Wed, Jul 30, 2014 at 1:40 PM, Arthur Vaïsse-Lesteven < [email protected]> wrote: > Hi Rob, > If I correctly understand your problem, you tried to replace the SPARQl > update [1] by the SPARQL update [2]. > > The second update do not target a graph, so the 2 updates aren't > equivalent. > > > This example comes from the spec : > > >WITH <g1> DELETE { a b c } INSERT { x y z } WHERE { ... } > >is considered equivalent to: > >DELETE { GRAPH <g1> { a b c } } INSERT { GRAPH <g1> { x y z } } USING > <g1> WHERE { ... } > > > I suppose that a correct update in your case is : > > DELETE > { > GRAPH<http://nationalarchives.gov.uk/dri/catalogue> > { > <http://nationalarchives.gov.uk/dri/catalogue/record-list/abc> > dri:recordListMember ?item . > } > } > WHERE > { > ?item dcterms:identifier "123"^^xsd:string . > } > > Hope it helps. > Arthur. > > > [1] > PREFIX dcterms: <http://purl.org/dc/terms/> > PREFIX dri: <http://nationalarchives.gov.uk/terms/dri#> > PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> > > WITH <http://nationalarchives.gov.uk/dri/catalogue> > DELETE{ > <http://nationalarchives.gov.uk/dri/catalogue/record-list/abc> > dri:recordListMember ?item . > } > WHERE{ > ?item dcterms:identifier "123"^^xsd:string . > } > > > [2] > PREFIX dcterms: <http://purl.org/dc/terms/> > PREFIX dri: <http://nationalarchives.gov.uk/terms/dri#> > PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> > DELETE { > <http://nationalarchives.gov.uk/dri/catalogue/record-list/abc> > dri:recordListMember ?item . > } > WHERE { > ?item dcterms:identifier "123"^^xsd:string . > } > > > ________________________________ > De : Rob Walpole <[email protected]> > À : [email protected] > Envoyé le : Mercredi 30 juillet 2014 14h18 > Objet : SPARQL protocol and using-graph-uri parameter > > > Hi, > > We are running TDB-backed Fuseki started with an assembler file with > tdb:unionDefaultGraph set to true. There are two named graphs in our > dataset. If I want to delete an item from one of the graphs I can do so > using the WITH clause as in the following example... > > PREFIX dcterms: <http://purl.org/dc/terms/> > PREFIX dri: <http://nationalarchives.gov.uk/terms/dri#> > PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> > > WITH <http://nationalarchives.gov.uk/dri/catalogue> > DELETE > { > <http://nationalarchives.gov.uk/dri/catalogue/record-list/abc> > dri:recordListMember ?item . > } > WHERE > { > ?item dcterms:identifier "123"^^xsd:string . > } > > However I am sending my updates over HTTP using the SPAQRL Protocol and so > I would prefer not to use the WITH clause but instead to use the > using-graph-uri parameter in my HTTP POST request. My understanding from > the specs is that the following HTTP request should be equivalent but it > doesn't seem to be. Can anyone confirm if this should work? Although it > executes successfully (response 204) - the data is not deleted... > > POST /catalogue/update?using-graph-uri=http%3A%2F% > 2Fnationalarchives.gov.uk%2Fdri%2Fcatalogue > HTTP/1.1 > Host: localhost:3030 > User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20120606 > Firefox/10.0.5 > Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 > Accept-Language: en-us,en;q=0.5 > Accept-Encoding: gzip, deflate > Connection: keep-alive > Content-Type: application/sparql-update; charset=UTF-8 > Content-Length: 557 > Pragma: no-cache > Cache-Control: no-cache > PREFIX dcterms: <http://purl.org/dc/terms/> > PREFIX dri: <http://nationalarchives.gov.uk/terms/dri#> > PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> > DELETE { <http://nationalarchives.gov.uk/dri/catalogue/record-list/abc> > dri:recordListMember ?item . } > WHERE { ?item dcterms:identifier "123"^^xsd:string . } > HTTP/1.1 204 No Content > Fuseki-Request-ID: 40 > Access-Control-Allow-Origin: * > Server: Fuseki (1.0.2) > ---------------------------------------------------------- > > Thanks > Rob > > -- > > Rob Walpole > Email [email protected] > Tel. +44 (0)7969 869881 > Skype: RobertWalpolehttp://www.linkedin.com/in/robwalpole > -- Rob Walpole Email [email protected] Tel. +44 (0)7969 869881 Skype: RobertWalpolehttp://www.linkedin.com/in/robwalpole
