%META:TOPICPARENT{name="VirtTipsAndTricksSPARQL11FeaturesExamplesCollection"}%
---+Virtuoso SPARQL 1.1. ADD Usage Examples
%TOC%
---++What?
This guide contains Virtuoso SPARQL 1.1. ADD Usage examples queries which you can run against any SPARQL endpoint that supports SPARQL 1.1 and the ability to allow a verified user perform INSERT operations.
---++Why?
Use as shortcut for inserting all data from an input graph into a destination graph. Note that the original content in the destination graph if any, is kept intact.
---++How?
Here are some examples showcasing Virtuoso's support for this functionality:
---+++ADD Example
This example adds all triples from a named graph identified by the IRI <urn:sparql:tests:add:data> to a named graph identified by the IRI <urn:sparql:tests:add2:data>
1 Assume the following Raw Data Representation in Turtle:
a ;
"William" ;
.
1 Load the sample data into <urn:sparql:tests:add:data>:
INSERT DATA
{
GRAPH
{
a ;
"William" ;
.
}
}
1 Query graph <urn:sparql:tests:add:data> data:
SELECT *
FROM
WHERE
{
?s ?p ?o
}
* [[http://bit.ly/13LBF5y][View the SPARQL Query Definition via SPARQL Protocol URL]];
* [[http://bit.ly/XmhkRB][View the SPARQL Query Results via SPARQL Protocol URL]]
1 Assume the following Raw Data Representation in Turtle:
a .
1 Load the sample data into <urn:sparql:tests:add2:data>:
INSERT DATA
{
GRAPH
{
a .
}
}
1 Query graph <urn:sparql:tests:add2:data> data:
SELECT *
FROM
WHERE
{
?s ?p ?o
}
* [[http://bit.ly/14IFvfr][View the SPARQL Query Definition via SPARQL Protocol URL]];
* [[http://bit.ly/14AahH9][View the SPARQL Query Results via SPARQL Protocol URL]]
1 Add all triples from <urn:sparql:tests:add:data> to <urn:sparql:tests:add2:data>
ADD GRAPH TO ;
1 Equivalent variant is:
INSERT
{
GRAPH { ?s ?p ?o }
}
WHERE
{
GRAPH { ?s ?p ?o }
}
1 Query graph <urn:sparql:tests:add2:data> data: Note that the original content in <urn:sparql:tests:add2:data> is kept intact by the ADD
operation:
SELECT *
FROM
WHERE
{
?s ?p ?o
}
* [[http://bit.ly/14IFvfr][View the SPARQL Query Definition via SPARQL Protocol URL]];
* [[http://bit.ly/14AahH9][View the SPARQL Query Results via SPARQL Protocol URL]]
---++Related
* [[http://www.w3.org/TR/2012/PR-sparql11-update-20121108/#add][SPARQL 1.1 ADD]]
* [[VirtTipsAndTricksGuideRenameGraph][Rename RDF Graph Example]]
* [[http://www.w3.org/TR/rdf-sparql-protocol/][SPARQL Protocol (HTTP based Query Service)]]
* [[VirtTipsAndTricksGuide][Virtuoso Tips and Tricks Collection]]
* [[VirtTipsAndTricksSPARQL11FeaturesExamplesCollection][Virtuoso SPARQL 1.1 Usage Examples Collection]]
* [[http://virtuoso.openlinksw.com/tutorials/sparql/SPARQL_Tutorials_Part_9/SPARQL_Tutorials_Part_9.html][Virtuoso SPARQL 1.1 Syntax Tutorial]]
* [[http://docs.openlinksw.com/virtuoso/rdfsparql.html][Virtuoso Documentation]]