SPARQL Examples – Insert
Posted on Aug 31, 2017 (last modified May 7, 2021)
Insert some statements
PREFIX <http://bedrock/>
INSERT DATA {
:fred :hasSpouse :wilma .
:fred :hasChild :pebbles .
:wilma :hasChild :pebbles .
:pebbles :hasSpouse :bamm-bamm ;
:hasChild :roxy, :chip.
}
Insert data into a named graph
INSERT DATA
{
GRAPH <http://example.org/myGraph>
{
<http://example.org/subject> <http://example.org/predicate> <http://example.org/object>
}
}
Inserts into a specific Graph. You can insert as many Triples as you want within a single command (only one is used in the example for brevity)