Re: SPARQL Update feature

Hi,

On 6 Jul 2010, at 22:20, Andy Seaborne wrote:

> It occurred to me we are missing a feature in SPARQL Update (language) - the ability to clear the graph store. That is, drop all the named graphs and empty the default graph.

Indeed, that makes sense, esp. when working with RDF store in dev / debug phase.

> 
> While , in some stores, the similar effect can be achieved with
> 
> DELETE WHERE { GRAPH ?g { ?s ?p ?o } }
> CLEAR GRAPH DEFAULT
> 
> because they drop empty graphs, it's not possible in general to drop all the named graphs.
> 
> Therefore either something to drop all named graphs, or something to reset the graph store is needed.
> 
> # Drop all named graphs.
> DROP GRAPH ALL
> 
> DROP GRAPH ALL does not work very well if it's CLEAR GRAPH DEFAULT
> (actually, I thought the syntax was going to be CLEAR DEFAULT, not CLEAR GRAPH DEFAULT)

What do you mean by does not work well ?

> 
> # Clear the graph store.
> RESET ALL
> CLEAR ALL # but the named graphs aren't cleared, they are dropped
> DROP ALL # but the default graph isn't dropped
> ...

Since CLEAR does not necessary entail that the graph is removed (stores keeping empty graphs), I'd prefer to use DROP ALL.
However, since the default graph is never removed, that's also ambiguous as you said.
I guess it could be solved by indicating that a store MUST always have a default graph, and that if this graph is dropped, the system MUST restore it.

Hence, DROP ALL will DROP all graphs, and the system MUST re-create the default one (as an empty graph).

That would lead to 

DROP [ SILENT ] GRAPH <uri>

=>

DROP [ SILENT ] (GRAPH ( <uri> | DEFAULT) | ALL)

(and DROP GRAPH DEFAULT == CLEAR GRAPH DEFAULT with the previous auto. default-graph creation feature)

Makes sense ?

Alex.


> 
> 	Andy
> 
> 
> 

--
Dr. Alexandre Passant
Digital Enterprise Research Institute
National University of Ireland, Galway
:me owl:sameAs <http://apassant.net/alex> .

Received on Tuesday, 6 July 2010 20:39:55 UTC