INSERT and INSERT DATA

The INSERT function inserts the specified graph or triple patterns into the database. The INSERT DATA function inserts specific triples into the database. INSERT DATA statements cannot include variables.

INSERT Syntax

Use the following syntax to insert data using graph and triple patterns.

INSERT { graph_and_triple_patterns }
WHERE { graph_and_triple_patterns }

INSERT DATA Syntax

Use the following syntax to insert specific triples with the INSERT DATA function.

INSERT DATA { [ GRAPH <graph> { ] triples }

The optional GRAPH statement specifies the graph to insert the triples in. The triples that you list must include URIs, literal, values, or blank nodes. You cannot specify triple patterns with variables. For example, the query below uses INSERT DATA to add a new user to the sample Tickit data set:

INSERT DATA { GRAPH <tickit> {
  <person0> <firstname> "Jay" .
  <person0> <lastname> "Stevens" .
  <person0> <state> "CA" .
 }
}