Graph Update Operations
Insert Data Operation
Definition: Insert Data Operation
A Insert Data Operation is an Update Operation in which new triples, given as a (ground) QuadPattern, are added in the Graph Store GS, in the default slot or in named slots.
OpInsertData(GS, QuadPattern) = Dataset-UNION(GS, Dataset(QuadPattern,{},GS,GS))
where {} is the empty solution mapping.
Delete Data Operation
Definition: Delete Data Operation
A Delete Data Operation OpDeleteData is an Update Operation in which triples, given as a (ground) QuadPattern, are removed from the Graph Store GS, from the default slot or from named slots.
OpDeleteData(GS, QuadPattern) = Dataset-DIFF(GS, Dataset(QuadPattern,{},GS,GS))
where {} is the empty solution mapping.
Delete Insert Operation
Definition: Delete Insert Operation
A Delete Insert Operation OpDeleteInsert is an Update Operation in which (1) triples are deleted from the Graph Store GS, either from the default slot or from named slot(s), and then (2) new triples are added in the Graph Store GS, either in the default slot or in named slot(s). Triples to be removed (and inserted, respectively) are identified by applying the pattern solutions for a Group Graph Pattern P against DS to the QuadPatternQuadPatternDEL (and QuadPatternINS, respectively).
OpDeleteInsert(GS, DS, QuadPatternDEL, QuadPatternINS, P) = Dataset-UNION(Dataset-DIFF(GS, Dataset(QuadPatternDEL,P,DS,GS)), Dataset(QuadPatternINS, P,DS,GS)
Load Operation
Definition: Load Operation
A Load Operation OpLoad is an Update Operation in which new triples (from a remote graph) are added in the Graph Store, either in the default slot or in a named slot, if specified.
OpLoad(GS, documentIRI) = Dataset-UNION(GS, { graph(documentIRI) } )
OpLoad(GS, documentIRI, iri) = Dataset-UNION(GS, { {}, (iri,graph(documentIRI)) } )
where graph(documentIRI) is a function returning the RDF graph serialized by the RDF document retrieved from IRI documentIRI, where blank nodes present in the retrieved graph are supposed to be "standardized apart"; i.e., blank nodes from a loaded graph need to be disjoint with the blank nodes already present in the Graph Store GS.
Clear Operation
Definition: Clear Operation
A Clear Operation OpClear is an Update Operation in which triples are deleted from the Graph Store, either from a named slot, the default slot, all named slots or all slots. There are different variants of the Clear Operation, OpClear for clearing a named graph, OpCleardef for clearing the default graph, OpClearnamed for clearing all named graphs, and OpClearall for clearing all graphs including the default graph.
Let GS = {DG} union {(irii, Gi) | 1 ≤ i ≤ n} and graphNames(GS) = { irii | 1 ≤ i ≤ n}, then
OpClear(GS, iri) = GS if iri not in graphNames(GS); otherwise, OpClear(GS, irij) = ( GS minus {(irij, Gj)} ) union {(irij,{})}, where (irij, Gj) ∈ GS and iri = irij
OpCleardef(GS) = {{}} union {(irii, Gi) | 1 ≤ i ≤ n}
OpClearnamed(GS) = {DG} union {(irii, {}) | 1 ≤ i ≤ n}
OpClearall(GS) = {{}} union {(irii, {}) | 1 ≤ i ≤ n}
Note:
Since Graph Stores may remove graphs that are left empty, for such Graph Stores any Clear Operation performed on a named graph may be viewed as immediately followed by a
Drop Operation, see below.
Copyright © 2013 W3C® (MIT, ERCIM, Keio, Beihang). This software or document includes material copied from or derived from SPARQL 1.1 Update.