Status: Team confidential – under team review
W3C is pleased to receive the SPARQL Update: A language for updating RDF graphs (SPARUL) Member Submission from Hewlett-Packard Company, et al.
During development of SPARQL Query Language for RDF, the RDF Data Access Working Group postponed work on an update facility. The W3C has been asked many times about adding this feature to SPARQL. This document, especially with support from the submitters, addresses this need in a style that is compatible with the existing SPARQL query language.
An approach to a SPARQL update language has been explored on SparqlUpdateLanguage wiki
page. This Submission addresses some of the expressed limitations on that
approach, specifically, SPARUL's DELETE {…} WHERE {…}
syntax
provides the ability to remove triples containing blank nodes from a graph.
SPARUL's INSERT {…} WHERE {…}
, DELETE {…} WHERE
{…}
correlate to the N3 functions diff:insertion
,
diff:deletion
proposed in Delta: an ontology for the
distribution of differences between RDF graphs. SPARUL's MODIFY
DELETE {…} INSERT {…} WHERE {…}
appears to meet the use cases for
N3's diff:replacement
, albeit shifting the difference calculation
from the processor to the composer of the query.
SPARUL's CREATE
and DROP
directives, and possibly
the INSERT
and DELETE
constraints that the graph URI
"must be a valid named graph in the Graph Store", extend SPARQL's data model to
include a detectable difference between an empty graph and a graph that does
not exist. It is not clear what use cases motivate this extension.
The LOAD <remoteURI> [ INTO <uri> ] syntax has parallels with SPARQL's FROM and FROM NAMED dataset directives, especially for SPARQL query processors that keep persistent any data loaded in a dataset directive. If, as expected, SPARUL becomes the input for further standardization, this fact should be carefully considered.
SPARUL updates consist of a series of data modification clauses (e.g.
INSERT
, INSERT
, etc), each acting upon a set of named
graphs, e.g.
INSERT INTO <x> { ?s <p1> <o1> } WHERE { ?s <p0> <o0> } INSERT INTO <y> { ?s <p2> <o2> } WHERE { ?s <p0> <o0> }
A syntax allowing GRAPH constraints in the template would allow the
manipulations of <x>
and <y>
to depend on
the same result set:
INSERT { GRAPH <x> { ?s <p1> <o1> } GRAPH <y> { ?s <p2> <o2> } } WHERE { ?s <p0> <o0> }
This alternative
syntax might be more beneficial for users who are already used to the
syntax based on GRAPH
. It may also be simpler for implementers who
may reuse existing mechanisms to implement the INSERT
functionality.
As an extension to SPARQL, and in view of the central role SPARQL plays in applications based on Semantic Web technologies, SPARUL is clearly of a great interest for the Semantic Web activity as a whole. There is also some relationship to the XQuery Working Group's work on XQuery Update Facility 1.0 in that both work with the update of data in a web architecture.
The W3C, in response to community enthusiasm, will explore resuming the Data Access Working Group, with a specific charter to specify an update language for SPARQL.