W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > August 2012

Re: Ambiguity about whether graphs are created or deleted

From: Paul Gearon <gearon@ieee.org>
Date: Tue, 7 Aug 2012 10:26:46 -0400
Message-ID: <CAGZNPFneV=pekvrjfzSZXQVHmthTtHpGn5sywbW8RbK4THBnqA@mail.gmail.com>
To: David Booth <david@dbooth.org>
Cc: public-rdf-dawg-comments <public-rdf-dawg-comments@w3.org>

Thank you for your comment. We have addressed your concern below.

David Booth wrote:
 > Please add this to the wish list for the next version of SPARQL Update.
 > I do not expect it to be addressed in the 1.1 version.
 > At present the spec allows SPARQL servers to automatically delete empty
 > graphs.  It also provides a CREATE operation for explicitly creating
 > graphs, though it does not require that the CREATE operation be used,
 > because graphs are created implicitly anyway.  Since I want my SPARQL
 > code to work properly on any SPARQL 1.1 compliant server, as a user this
 > ambiguity leads to a dilemma.  Consider the following sequence:
 >   CREATE GRAPH <one> ;
 >   CREATE GRAPH <two> ;
 >   ADD GRAPH <one> TO GRAPH <two>  ;
 > The naive interpretation is that the above ADD operation should always
 > succeed, since graph <one> was just created.  In implementations that
 > keep empty graphs, the ADD operation will succeed.  But if the
 > implementation automatically deletes empty graphs, then the CREATE
 > operations will have no effect, and the ADD operation will fail, even
 > though the graph *had* been "created", but merely happened to be empty.
 > So even though an empty graph is a perfectly normal thing to have
 > sometimes -- for example, the graph may be recording the sales of ice
 > cream cones on a day when none were sold -- the ADD operation causes a
 > failure.
 > A workaround is to add the SILENT keyword to the ADD operation:
 >   ADD SILENT GRAPH <one> TO GRAPH <two>  ;
 > But this is not so great to do, because this will mask actual
 > programming errors like this misspelling of "one":
 >   ADD SILENT GRAPH <onnne> TO GRAPH <two>  ;
 > Another workaround is to not use CREATE.  But if it isn't needed or
 > helpful to some implementations, then why is it in the language?
 > In short, the ambiguity that was allowed is harmful to users.  Please
 > pick one style or the other and stick with it: either keeping empty
 > graphs and requiring explicit CREATEs and DELETEs, or eliminating CREATE
 > and DELETE from the language.
 > Thanks!

The existing ambiguity has been a compromise to support as many
existing systems as possible. Some systems allowed explicit creation
of empty graphs, whilst others implied the existence of a graph by the
presence of triples in that graph, and could not support the concept
of an empty graph. While not perfect, the Working Group felt that
current approach would work with the majority of data stores.

The expectations of users and implementors may change as stores
implement the implicit graph creation introduced in SPARQL Update 1.1,
meaning that this compromise position may not be required in future
versions. Consequently, your concern has been added to the Future Work
list at:


We would be grateful if you would acknowledge that your comments have
been answered by sending a reply to this mailing list.

Paul Gearon,
On behalf of the SPARQL WG
Received on Tuesday, 7 August 2012 14:27:17 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:01:30 UTC