- From: Luke Wilson-Mawer <luke.wilson-mawer@garlik.com>
- Date: Tue, 28 Jul 2009 10:46:51 +0100
- To: SPARQL Working Group <public-rdf-dawg@w3.org>
Seaborne, Andy wrote: > >> -----Original Message----- >> From: public-rdf-dawg-request@w3.org [mailto:public-rdf-dawg-request@w3.org] >> On Behalf Of Luke Wilson-Mawer >> Sent: 20 July 2009 15:46 >> To: SPARQL Working Group >> Subject: Review of SPARQL Update submisson (ACTION-53) >> >> Hi, >> >> Here are my comments on the UPDATE submission, they aren't independent >> since Steve's name is on the submission for Garlik, but hopefully >> they're useful nonetheless >> >> http://www.w3.org/Submission/2008/SUBM-SPARQL-Update-20080715/ >> >> 1) INSERT DATA/UPDATE DATA. >> Streaming of large chunks of data seems like something the protocol >> ought to do - it seems to me more natural to squirt a whole file over >> the wire than to turn the data into a query. The LOAD <remoteURI> >> feature would also seem like a natural way to do this, possibly extended >> to load local files, although I'm not sure about the security consequnces. >> >> > > In SPARQL/Update a request can be several operations so having the data inline > > Having INSERT DATA makes it possible to a collect several operations together into one request (and one file, not necessarily vital but useful). > > We could call the operation "PUT" to be similar to the protocol. > > LOAD <remoteURI> assumes you have somewhere to pull it from. > > OK, it seems INSERT DATA/DELETE DATA is necessary, especially as it seems it isn't too onerous to implement. I think PUT is a good idea, although we lose the symmetry between INSERT DATA & DELETE DATA. >> 2) It doesn't seem clear whether a WHERE clause and FILTERS can be used >> with these verbs: >> CREATE >> DROP >> CLEAR >> LOAD >> > > [11] 'LOAD' IRIref+ ( 'INTO' IRIref )? > etc > > No WhereClause (which is the pattern) > > The grammar was written to maximise reuse from the SPARQL grammar > > (FYI: Currently, I use a single grammar for query and update with two entry points. This keeps the patterns parts, which is the majority of the rules, in step. But other parser tools may have problems with this). > > I think there could be some quite compelling use cases for adding WhereClause? to some of these commands, particularly to DROP and CLEAR, although I'm not sure whether they would warrant the extra effort to standardise and for implementors. Here are a few thoughts: Removing graphs that are more than a month old (we could use CLEAR here instead of DROP if we just wanted to empty the graphs): DROP ?oldGraph WHERE { ?oldGraph dc:date ?ageOfGraph . FILTER(?ageOfGraph < "2009-06-27"^^xsd:date) . } In a big index of FOAF files, I might want to delete all of a person's FOAF files in one go: DROP ?myFoafFile WHERE { ?myFoafFile foaf:primaryTopic ?myUri . ?myUri foaf:mbox luke.wilson-mawer@garlik.com . } Downloading seeAlsos: LOAD ?seeAlsoGraph WHERE { <http://example.org/people/lukewm#me> rdfs:seeAlso ?seeAlsoGraph . } Although LOAD could get quite crazy if we ask the endpoint to load in millions of graphs - I'm not sure how an endpoint would protect against this. >> 3) Do we really need the MODIFY verb? It seems to be syntactic sugar, >> as we can always use either DELETE FROM <uri> or INSERT INTO <uri> to >> specify a graph. It isn't used in any of the examples but it's >> mentioned elsewhere. The only thing it seems to do is stop the user >> having to type a graph name more than once if multiple operations are >> done on the same graph in the same query. >> > > Just to note that in MODIFY, the DELETE and the INSERT are driven by the same WHERE clause, and this is executed before either DELETE or INSERT change the target. > > Andy > > >> 4) I agree with Alex Passant that Example 2e would be simplified by >> introducing a MOVE verb. Still, this example requires the full syntax: >> >> The bookStore2 graph is created and only a year's worth of books are kept : >> >> PREFIX dc: <http://purl.org/dc/elements/1.1/> >> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> >> >> INSERT INTO <http://example/bookStore2> >> { ?book ?p ?v } >> WHERE >> { GRAPH <http://example/bookStore> >> { ?book dc:date ?date . >> FILTER ( ?date < "2000-01-01T00:00:00"^^xsd:dateTime && ?date >> > "1999-01-01T00:00:00"^^xsd:dateTime) >> ?book ?p ?v >> } >> } >> >> DELETE FROM <http://example/bookStore> >> { ?book ?p ?v } >> WHERE >> { GRAPH <http://example/bookStore> >> { ?book dc:date ?date . >> FILTER ( ?date < "2000-01-01T00:00:00"^^xsd:dateTime ) >> ?book ?p ?v >> } >> } >> >> >> Thanks, >> >> Luke >> >> >> >> >> >> >> >> > >
Received on Tuesday, 28 July 2009 09:47:27 UTC