SPARUL
{{Multiple issues|
{{Notability|date=April 2024}}
{{More citations needed|date=April 2024}}
}}
SPARUL, or SPARQL/Update, was a declarative data manipulation language that extended the SPARQL 1.0 query language standard. SPARUL provided the ability to insert, delete and update RDF data held within a triple store or quad store. SPARUL was originally written by Hewlett-Packard and has been used as the foundation for the current W3C recommendation entitled SPARQL 1.1 Update.{{Cite web|title=SPARQL 1.1 Update|url=https://www.w3.org/TR/sparql11-update/Overview.html|access-date=2021-01-07|website=www.w3.org}} With the publication of SPARQL 1.1, SPARUL is superseded and should only be consulted as a source of inspiration for possible future refinements of SPARQL, but not for real-world applications.
Examples
Adding some triples to a graph. The snippet describes two RDF triples to be inserted into the default graph of the RDF store.
PREFIX dc:
INSERT DATA
{
dc:creator "A.N.Other" .
}
This SPARQL/Update request contains a triple to be deleted and a triple to be added (used here to correct a book title). The requested change happens in the named graph identified by the URI
PREFIX dc:
DELETE DATA FROM
{
INSERT DATA INTO
{
The example below has a request to delete all records of old books (with date before year 2000)
PREFIX dc:
PREFIX xsd:
DELETE
{ ?book ?p ?v }
WHERE
{ ?book dc:date ?date .
FILTER ( ?date < "2000-01-01T00:00:00"^^xsd:dateTime )
?book ?p ?v
}
This snippet copies records from one named graph to another named graph based on a pattern.
PREFIX dc:
PREFIX xsd:
INSERT INTO
{ ?book ?p ?v }
WHERE
{ GRAPH
{ ?book dc:date ?date .
FILTER ( ?date < "2000-01-01T00:00:00"^^xsd:dateTime )
?book ?p ?v
} }
An example to move records from one named graph to another named graph based on a pattern.
PREFIX dc:
PREFIX xsd:
INSERT INTO
{ ?book ?p ?v }
WHERE
{ GRAPH
{ ?book dc:date ?date .
FILTER ( ?date < "2000-01-01T00:00:00"^^xsd:dateTime )
?book ?p ?v
}
}
DELETE FROM
{ ?book ?p ?v }
WHERE
{ GRAPH
{ ?book dc:date ?date .
FILTER ( ?date < "2000-01-01T00:00:00"^^xsd:dateTime )
?book ?p ?v
}
}
SPARQL/Update implementations
- AllegroGraph
- ARQ
- D2R Server[http://d2rq.org/ D2R Server]
- Jena
- OntoBroker
- Ontotext OWLIM
- Oracle DB Enterprise Ed.
- Parliament[http://parliament.semwebcentral.org/ Parliament]
- Redland / Redstore
- StrixDB supports SPARQL/Update 1.0.
- OpenLink Virtuoso Universal Server
Clients supporting SPARUL
References
External links
- [http://www.w3.org/Submission/SPARQL-Update/ SPARQL/Update] W3C Member Submission
- [http://www.w3.org/TR/sparql11-update/ SPARQL 1.1 Update] Proposed Recommendation from W3C SPARQL Working Group
- [http://esw.w3.org/topic/EditingData EditingData wiki page] - summary (maintained by Tim Berners-Lee) of ways to edit linked data