<https://kgdev.net/specifications/sparql11-update/updateLanguage/graphUpdate/deleteInsert/>
        a       <https://www.w3.org/ns/ldt/document-hierarchy#Item> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1>
                <https://kgdev.net/specifications/sparql11-update/updateLanguage/graphUpdate/deleteInsert/#this> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2>
                <https://kgdev.net/specifications/sparql11-update/updateLanguage/graphUpdate/deleteInsert/#delete> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3>
                <https://kgdev.net/specifications/sparql11-update/updateLanguage/graphUpdate/deleteInsert/#insert> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4>
                <https://kgdev.net/specifications/sparql11-update/updateLanguage/graphUpdate/deleteInsert/#deleteWhere> ;
        <http://purl.org/dc/terms/modified>
                "2023-07-10T16:15:52.102Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
        <http://purl.org/dc/terms/title>
                "DELETE/INSERT" ;
        <http://rdfs.org/sioc/ns#has_container>
                <https://kgdev.net/specifications/sparql11-update/updateLanguage/graphUpdate/> ;
        <http://www.w3.org/ns/prov#wasDerivedFrom>
                <https://www.w3.org/TR/sparql11-update/#deleteInsert> ;
        <http://xmlns.com/foaf/0.1/primaryTopic>
                <https://kgdev.net/specifications/sparql11-update/updateLanguage/graphUpdate/deleteInsert/#this> .

<https://kgdev.net/specifications/sparql11-update/updateLanguage/graphUpdate/deleteInsert/#deleteWhere>
        a       <https://w3id.org/atomgraph/linkeddatahub#Content> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#value>
                "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h5 id=\"deleteWhere\">DELETE WHERE</h5>\n\n<pre xml:space=\"preserve\"><code>**DELETE WHERE ** QuadPattern \n</code></pre>\n<p>The <code>DELETE WHERE</code> operation is a shortcut form for the <a href=\"#this\" shape=\"rect\"><code>DELETE/INSERT</code></a> operation where bindings matched by the <code>WHERE</code> clause are used to define the triples in a graph that will be deleted. Analogous to <code>DELETE/INSERT</code>, deleting triples that are not present, or from a graph that is not present will have no effect and will result in success.</p>\n<p>The QuadPattern is used both as a pattern for matching against triples and graphs, and as the template for deletion. If any TripleTemplates within the QuadPattern appear in the scope of a <code>GRAPH</code> clause then this will determine the graph that that template is matched on, and also the graph from which any matching triples will be removed. Any TripleTemplates not in the scope of a <code>GRAPH</code> clause will be matched against/removed from the default graph.</p>\n<p><strong>Example 11:</strong></p>\n<p>This example request removes all statements about anything with a given name of \"Fred\" from the default graph:</p>\n<pre xml:space=\"preserve\"><code class=\"language-sparql\">PREFIX foaf:  &lt;http://xmlns.com/foaf/0.1/&gt;\n\nDELETE WHERE { ?person foaf:givenName 'Fred';\n                       ?property      ?value }\n</code></pre>\n<p>Data before:</p>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Default graph**\n@prefix foaf:  &lt;http://xmlns.com/foaf/0.1/&gt; .\n\n&lt;http://example/william&gt; a foaf:Person .\n&lt;http://example/william&gt; foaf:givenName \"William\" .\n&lt;http://example/william&gt; foaf:mbox  &lt;mailto:bill@example&gt; .\n\n&lt;http://example/fred&gt; a foaf:Person .\n&lt;http://example/fred&gt; foaf:givenName \"Fred\" .\n&lt;http://example/fred&gt; foaf:mbox  &lt;mailto:fred@example&gt; .\n</code></pre>\n<p>Data after:</p>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Default graph**\n@prefix foaf:  &lt;http://xmlns.com/foaf/0.1/&gt; .\n\n&lt;http://example/william&gt; a foaf:Person .\n&lt;http://example/william&gt; foaf:givenName \"William\" .\n&lt;http://example/william&gt; foaf:mbox  &lt;mailto:bill@example&gt; .\n</code></pre>\n<p><strong>Example 12:</strong></p>\n<p>This example request removes both statements naming some resource \"Fred\" in the graph <code>http://example.com/names</code>, and also statements about that resource from the graph <code>http://example/addresses</code> (assuming that some of the resources in the graph <code>http://example.com/names</code> have corresponding triples in the graph <code>http://example/addresses</code>).</p>\n<pre xml:space=\"preserve\"><code class=\"language-sparql\">PREFIX foaf:  &lt;http://xmlns.com/foaf/0.1/&gt;\n\nDELETE WHERE {\n  GRAPH &lt;http://example.com/names&gt; {\n    ?person foaf:givenName 'Fred' ;\n            ?property1 ?value1\n  }\n  GRAPH &lt;http://example.com/addresses&gt; {\n    ?person ?property2 ?value2\n  }\n}\n</code></pre>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example.com/names**\n@prefix foaf:  &lt;http://xmlns.com/foaf/0.1/&gt; .\n\n&lt;http://example/william&gt; a foaf:Person .\n&lt;http://example/william&gt; foaf:givenName \"William\" .\n\n&lt;http://example/fred&gt; a foaf:Person .\n&lt;http://example/fred&gt; foaf:givenName \"Fred\" .\n</code></pre>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example.com/addresses**\n@prefix foaf:  &lt;http://xmlns.com/foaf/0.1/&gt; .\n\n&lt;http://example/william&gt; foaf:mbox  &lt;mailto:bill@example&gt; .\n\n&lt;http://example/fred&gt; foaf:mbox  &lt;mailto:fred@example&gt; .\n</code></pre>\n<p>Data after:</p>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example.com/names**\n@prefix foaf:  &lt;http://xmlns.com/foaf/0.1/&gt; .\n\n&lt;http://example/william&gt; a foaf:Person .\n&lt;http://example/william&gt; foaf:givenName \"William\" .\n</code></pre>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example.com/addresses**\n@prefix foaf:  &lt;http://xmlns.com/foaf/0.1/&gt; .\n\n&lt;http://example/william&gt; foaf:mbox  &lt;mailto:bill@example&gt; .\n</code></pre></div>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> ;
        <http://www.w3.org/2000/01/rdf-schema#seeAlso>
                <https://kgdev.net/specifications/sparql11-update/updateLanguage/graphUpdate/deleteInsert/#this> ;
        <http://www.w3.org/ns/prov#wasDerivedFrom>
                <https://www.w3.org/TR/sparql11-update/#deleteWhere> .

<https://kgdev.net/specifications/sparql11-update/updateLanguage/graphUpdate/deleteInsert/#this>
        a                          <https://kgdev.net/ns#Definition> , <https://w3id.org/atomgraph/linkeddatahub#Content> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#value>
                "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h4 id=\"this\">DELETE/INSERT</h4>\n\n<p>The DELETE/INSERT operation can be used to remove or add triples from/to the Graph Store based on bindings for a query pattern specified in a <code>WHERE</code> clause:</p>\n<pre xml:space=\"preserve\"><code>( **WITH** *[IRIref](../../../../sparql11-query/grammar/#rIRIREF)* )?\n( ( *[DeleteClause](../../../../sparql11-query/grammar/#rDeleteData) [InsertClause](../../../../sparql11-query/grammar/#rInsertData)*? ) | *[InsertClause](../../../../sparql11-query/grammar/#rInsertData)* )\n( **USING ( NAMED )?** *[IRIref](../../../../sparql11-query/grammar/#rIRIREF)* )*\n**WHERE** *[GroupGraphPattern](../../../../sparql11-query/grammar/#rGroupGraphPattern)*\n</code></pre>\n<p>The <em>DeleteClause</em> and <em>InsertClause</em> forms can be broken down as follows:</p>\n<pre xml:space=\"preserve\"><code>*DeleteClause* ::= **DELETE ** QuadPattern \n*InsertClause* ::= **INSERT ** QuadPattern \n</code></pre>\n<p>This operation identifies data with the <code>WHERE</code> clause, which will be used to compute solution sequences of bindings for a set of variables. The bindings for each solution are then substituted into the <code>DELETE</code> template to remove triples, and then in the <code>INSERT</code> template to create new triples. If any solution produces a triple containing an unbound variable or an illegal RDF construct, such as a literal in a subject or predicate position, then that triple is not included when processing the operation: <code>INSERT</code> will not instantiate new data in the output graph, and <code>DELETE</code> will not remove anything. The graphs used for computing a solution sequence may be different to the graphs modified with the <code>DELETE</code> and <code>INSERT</code> templates.</p>\n<p>The <code>WITH</code> clause defines the graph that will be modified or matched against for any of the subsequent elements (in <code>DELETE</code>, <code>INSERT</code>, or <code>WHERE</code> clauses) if they do not specify a graph explicitly. If not provided, then the default graph of the Graph Store (or an explicitly declared dataset in the <code>WHERE</code> clause) will be assumed. That is, a <code>WITH</code> clause may be viewed as syntactic sugar for wrapping both the QuadPatterns in subsequent <code>DELETE</code> and <code>INSERT</code> clauses, and likewise the GroupGraphPattern in the subsequent <code>WHERE</code> clause into <code>GRAPH</code> patterns. This can be used to avoid refering to the same graph multiple times in a single operation.</p>\n<p>Following the optional <code>WITH</code> clause are the <code>INSERT</code> and/or <code>DELETE</code> clauses. The deletion of the triples happens before the insertion. The pattern in the <code>WHERE</code> clause is evaluated only once, before the delete part of the operation is performed. The overall processing model is that the pattern is executed, the results used to instantiate the <code>DELETE</code> template, the deletes performed, the results used again to instantiate the <code>INSERT</code> template, and the inserts performed.</p>\n<p>If the <code>DELETE</code> clause is omitted, then the operation only inserts data (see INSERT). If the <code>INSERT</code> clause is omitted, then the operation only removes data (see DELETE). The grammar does not permit both <code>DELETE</code> and <code>INSERT</code> to be omitted in the same operation.</p>\n<p>The USING and <code>USING NAMED</code> clauses affect the <a href=\"../../../../sparql11-query/rdfDataset/#this\" shape=\"rect\">RDF Dataset</a> used while evaluating the <code>WHERE</code> clause. This describes a dataset in the same way as <code>FROM</code> and <code>FROM NAMED</code> clauses describe <a href=\"../../../../sparql11-query/rdfDataset/specifyingDataset/#this\" shape=\"rect\">RDF Datasets in the SPARQL 1.1 Query Language</a>. The keyword <code>USING</code> instead of <code>FROM</code> in update requests is to avoid possible ambiguities which could arise from writing \"<code>DELETE FROM</code>\". That is, the <a href=\"../../../../sparql11-query/grammar/#rGroupGraphPattern\" shape=\"rect\">\nGroupGraphPattern</a> in the <code>WHERE</code> clause will be matched against the dataset described by explicit <code>USING</code> or <code>USING NAMED</code> clauses, if specified, and against the Graph Store otherwise.</p>\n<p>The <code>WITH</code> clause provides a convenience for when an operation primarily refers to a single graph. If a graph name is specified in a <code>WITH</code> clause, then - for the purposes of evaluating the <code>WHERE</code> clause - this will define an RDF Dataset containing a default graph with the specified name, but only in the absence of <code>USING</code> or <code>USING NAMED</code> clauses. In the presence of one or more graphs referred to in <code>USING</code> clauses and/or <code>USING NAMED</code> clauses, the <code>WITH</code> clause will be ignored while evaluating the <code>WHERE</code> clause.</p>\n<p>The <a href=\"../../../../sparql11-query/grammar/#rGroupGraphPattern\" shape=\"rect\">\nGroupGraphPattern</a> in the <code>WHERE</code> clause is evaluated as in a SPARQL query \"SELECT * WHERE\nGroupGraphPattern\" and all the solution bindings are applied to the preceding <code>DELETE</code> and <code>INSERT</code> templates for defining the triples to be deleted from or inserted into the Graph Store.</p>\n<p>Again, QuadPatterns are formed by TriplesTemplates, i.e., sets of triple patterns, optionally wrapped into a <code>GRAPH</code> block, where the <code>GRAPH</code> clause indicates the named graph in the Graph Store to be updated; on any TripleTemplates without a <code>GRAPH</code> clause, the <code>INSERT</code> or <code>DELETE</code> clauses applies to the graph specified by the <code>WITH</code> clause, or the default graph of the Graph Store if no <code>WITH</code> clause is present.</p>\n<p>To illustrate the use of the <code>WITH</code> clause, an operation of the general form:</p>\n<pre xml:space=\"preserve\"><code class=\"language-sparql\">WITH &lt;g1&gt; DELETE { a b c } INSERT { x y z } WHERE { ... }\n</code></pre>\n<p>is considered equivalent to:</p>\n<pre xml:space=\"preserve\"><code class=\"language-sparql\">DELETE { GRAPH &lt;g1&gt; { a b c } } INSERT { GRAPH &lt;g1&gt; { x y z } } USING &lt;g1&gt; WHERE { ... }\n</code></pre>\n<p>Note that explicit <code>GRAPH</code> clauses override a <code>WITH</code> clause. <code>WITH</code> provides a fallback to specify a graph (different from the default graph) to use when one is not explicitly stipulated via <code>GRAPH</code>.</p>\n<p>Deleting triples that are not present, or from a graph that is not present will have no effect and will result in <em>success</em>. Blank nodes are prohibited in a <code>DELETE</code> template, since using a new blank node in a <code>DELETE</code> template would lead to nothing being deleted, as a new blank node cannot match anything in the Graph Store. It should be noted that this restriction is not in the EBNF for the <a href=\"../../../../sparql11-query/grammar/#rDeleteClause\" shape=\"rect\">DeleteClause</a> itself, but made explicit in Note 9 to the <a href=\"../../../../sparql11-query/grammar/#sparqlGrammar\" shape=\"rect\">grammar</a>.</p>\n<p>If an operation tries to insert into a graph that does not exist, then that graph <em>SHOULD</em> be created; again, there may be implementations providing an update service over a fixed set of graphs which in such case <em>MUST</em> return with failure for update requests that would create an unallowed graph. If no data is to be inserted, then no graph will be created. Particularly, note that</p>\n<pre xml:space=\"preserve\"><code class=\"language-sparql\">INSERT ... { GRAPH &lt;g&gt; {} } ...\n</code></pre>\n<p>does not create &lt;g&gt;. If a user intends to create a graph regardless of the data to be inserted, then the graph management operations (CREATE/LOAD) may be used prior to any insertion operations.</p>\n<p>Blank nodes that appear in an <code>INSERT</code> clause operate similarly to blank nodes in the template of a <code>CONSTRUCT</code> query, i.e., they are re-instantiated for any solution of the <code>WHERE</code> clause; refer to <a href=\"../../../../sparql11-query/QueryForms/construct/#templatesWithBNodes\" shape=\"rect\">Templates with Blank Nodes</a> in SPARQL Query 1.1 and to the <a href=\"../../../formalModel/formalModelGraphUpdate/#def_deleteinsertoperation\" shape=\"rect\">formal semantics of DELETE/INSERT</a> below for details. Blank nodes in the <code>WHERE</code> clause match data in the same way as for any SPARQL Query.</p>\n<p><strong>Example 5:</strong></p>\n<p>An example to update the graph <code>http://example/addresses</code> to rename all people with the given name \"Bill\" to \"William\".</p>\n<pre xml:space=\"preserve\"><code class=\"language-sparql\">PREFIX foaf:  &lt;http://xmlns.com/foaf/0.1/&gt;\n\nWITH &lt;http://example/addresses&gt;\nDELETE { ?person foaf:givenName 'Bill' }\nINSERT { ?person foaf:givenName 'William' }\nWHERE\n  { ?person foaf:givenName 'Bill'\n  } \n</code></pre>\n<p>Data before:</p>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example/addresses**\n@prefix foaf:  &lt;http://xmlns.com/foaf/0.1/&gt; .\n\n&lt;http://example/president25&gt; foaf:givenName \"Bill\" .\n&lt;http://example/president25&gt; foaf:familyName \"McKinley\" .\n&lt;http://example/president27&gt; foaf:givenName \"Bill\" .\n&lt;http://example/president27&gt; foaf:familyName \"Taft\" .\n&lt;http://example/president42&gt; foaf:givenName \"Bill\" .\n&lt;http://example/president42&gt; foaf:familyName \"Clinton\" .\n</code></pre>\n<p>Data after:</p>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example/addresses**\n@prefix foaf:  &lt;http://xmlns.com/foaf/0.1/&gt; .\n\n&lt;http://example/president25&gt; foaf:givenName \"William\" .\n&lt;http://example/president25&gt; foaf:familyName \"McKinley\" .\n&lt;http://example/president27&gt; foaf:givenName \"William\" .\n&lt;http://example/president27&gt; foaf:familyName \"Taft\" .\n&lt;http://example/president42&gt; foaf:givenName \"William\" .\n&lt;http://example/president42&gt; foaf:familyName \"Clinton\" .\n</code></pre></div>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> ;
        <http://www.w3.org/ns/prov#wasDerivedFrom>
                <https://www.w3.org/TR/sparql11-update/#deleteInsert> ;
        <https://schema.org/name>  "DELETE/INSERT" .

<https://kgdev.net/specifications/sparql11-update/updateLanguage/graphUpdate/deleteInsert/#delete>
        a       <https://w3id.org/atomgraph/linkeddatahub#Content> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#value>
                "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h5 id=\"delete\">DELETE (Informative)</h5>\n\n<pre xml:space=\"preserve\"><code>( **WITH**  *[IRIref](../../../../sparql11-query/grammar/#rIRIREF)* )?\n**DELETE ** QuadPattern \n( **USING ( NAMED )?** *[IRIref](../../../../sparql11-query/grammar/#rIRIREF)* )*\n**WHERE** *[GroupGraphPattern](../../../../sparql11-query/grammar/#rGroupGraphPattern)*\n</code></pre>\n<p>The <code>DELETE</code> operation is a form of the <a href=\"#this\" shape=\"rect\"><code>DELETE/INSERT</code></a> operation having no <code>INSERT</code> section. A compliant implementation of <code>DELETE/INSERT</code> will already implement this operation correctly. The <code>DELETE</code> operation is described here separately for clarity. Analogous to <a href=\"#this\" shape=\"rect\"><code>DELETE/INSERT</code></a>, deleting triples that are not present, or from a graph that is not present will have no effect and will result in success.</p>\n<p>If any <code>DELETE</code> template specifies a <code>GRAPH</code> then this will be the graph affected. Otherwise, the operation will be applied to the graph specified in the <code>WITH</code> clause, if one was specified, or the default graph otherwise.</p>\n<p>The <code>WHERE</code> clause identifies data in existing graphs, and creates bindings to be used by the template. The graphs to apply the <em>GroupGraphPattern</em> follow the same rules as for <code>DELETE/INSERT</code>.</p>\n<p><strong>Example 6:</strong></p>\n<p>This example request deletes all records of old books (with date before year 1970) from the store's default graph:</p>\n<pre xml:space=\"preserve\"><code class=\"language-sparql\">PREFIX dc:  &lt;http://purl.org/dc/elements/1.1/&gt;\nPREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;\n\nDELETE\n { ?book ?p ?v }\nWHERE\n { ?book dc:date ?date .\n   FILTER ( ?date &gt; \"1970-01-01T00:00:00-02:00\"^^xsd:dateTime )\n   ?book ?p ?v\n }\n</code></pre>\n<p>The pattern in <code>WHERE</code> is matched against the Graph Store. The resulting sequence of solutions to the WHERE clause is used to instantiate the triple patterns in the <code>DELETE</code> template similar to CONSTRUCT in SPARQL 1.1 Query. The resulting triples are then removed from the Graph Store.</p>\n<p>Data before:</p>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Default graph**\n@prefix dc: &lt;http://purl.org/dc/elements/1.1/&gt; .\n\n&lt;http://example/book1&gt; dc:title \"Principles of Compiler Design\" .\n&lt;http://example/book1&gt; dc:date \"1977-01-01T00:00:00-02:00\"^^xsd:dateTime .\n\n&lt;http://example/book2&gt; ns:price 42 .\n&lt;http://example/book2&gt; dc:title \"David Copperfield\" .\n&lt;http://example/book2&gt; dc:creator \"Edmund Wells\" .\n&lt;http://example/book2&gt; dc:date \"1948-01-01T00:00:00-02:00\"^^xsd:dateTime .\n\n&lt;http://example/book3&gt; dc:title \"SPARQL 1.1 Tutorial\" .\n</code></pre>\n<p>Data after:</p>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Default graph**\n@prefix dc: &lt;http://purl.org/dc/elements/1.1/&gt; .\n\n&lt;http://example/book2&gt; ns:price 42 .\n&lt;http://example/book2&gt; dc:title \"David Copperfield\" .\n&lt;http://example/book2&gt; dc:creator \"Edmund Wells\" .\n&lt;http://example/book2&gt; dc:date \"1948-01-01T00:00:00-02:00\"^^xsd:dateTime .\n\n&lt;http://example/book3&gt; dc:title \"SPARQL 1.1 Tutorial\" .\n</code></pre>\n<p><strong>Example 7:</strong></p>\n<p>This example request removes all statements about anything with a given name of \"Fred\" from the graph <code>http://example/addresses</code>. A <code>WITH</code> clause is present, meaning that graph <code>http://example/addresses</code> is both the one from which triples are being removed and the one which the <code>WHERE</code> clause is matched against.</p>\n<pre xml:space=\"preserve\"><code class=\"language-sparql\">PREFIX foaf:  &lt;http://xmlns.com/foaf/0.1/&gt;\n\nWITH &lt;http://example/addresses&gt;\nDELETE { ?person ?property ?value } \nWHERE { ?person ?property ?value ; foaf:givenName 'Fred' } \n\n</code></pre>\n<p>Data before:</p>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example/addresses**\n@prefix foaf:  &lt;http://xmlns.com/foaf/0.1/&gt; .\n\n&lt;http://example/william&gt; a foaf:Person .\n&lt;http://example/william&gt; foaf:givenName \"William\" .\n&lt;http://example/william&gt; foaf:mbox &lt;mailto:bill@example&gt; .\n\n&lt;http://example/fred&gt; a foaf:Person .\n&lt;http://example/fred&gt; foaf:givenName \"Fred\" .\n&lt;http://example/fred&gt; foaf:mbox  &lt;mailto:fred@example&gt; .\n</code></pre>\n<p>Data after:</p>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example/addresses**\n@prefix foaf:  &lt;http://xmlns.com/foaf/0.1/&gt; .\n\n&lt;http://example/william&gt; a foaf:Person .\n&lt;http://example/william&gt; foaf:givenName \"William\" .\n&lt;http://example/william&gt; foaf:mbox  &lt;mailto:bill@example&gt; .\n</code></pre>\n<p>Another example of <code>DELETE</code> is provided in the <a href=\"#example_9\" shape=\"rect\">final example</a> in the following section which demonstrates multiple operations combining an <code>INSERT</code> with a <code>DELETE</code>.</p></div>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> ;
        <http://www.w3.org/2000/01/rdf-schema#seeAlso>
                <https://kgdev.net/specifications/sparql11-update/updateLanguage/graphUpdate/deleteInsert/#example_9> , <https://kgdev.net/specifications/sparql11-update/updateLanguage/graphUpdate/deleteInsert/#this> ;
        <http://www.w3.org/ns/prov#wasDerivedFrom>
                <https://www.w3.org/TR/sparql11-update/#delete> .

<https://kgdev.net/specifications/sparql11-update/updateLanguage/graphUpdate/deleteInsert/#insert>
        a       <https://w3id.org/atomgraph/linkeddatahub#Content> ;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#value>
                "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h5 id=\"insert\">INSERT (Informative)</h5>\n\n<pre xml:space=\"preserve\"><code>( **WITH**  *[IRIref](../../../../sparql11-query/grammar/#rIRIREF)* )?\n**INSERT ** QuadPattern \n( **USING ( NAMED )?**  *[IRIref](../../../../sparql11-query/grammar/#rIRIREF)* )*\n**WHERE** *[GroupGraphPattern](../../../../sparql11-query/grammar/#rGroupGraphPattern)*\n</code></pre>\n<p>The <code>INSERT</code> operation is a form of the <a href=\"#this\" shape=\"rect\"><code>DELETE/INSERT</code></a> operation having no <code>DELETE</code> section. A compliant implementation of <code>DELETE/INSERT</code> will already implement this operation correctly. The <code>INSERT</code> operation is described here separately for clarity.</p>\n<p>If the <code>INSERT</code> template specifies <code>GRAPH</code> blocks then these will be the graphs affected. Otherwise, the operation will be applied to the default graph, or, respectively, to the graph specified in the <code>WITH</code> clause, if one was specified. If no <code>USING (NAMED)</code> clause is present, then the pattern in the <code>WHERE</code> clause will be matched against the Graph Store, otherwise against the dataset specified by the <code>USING (NAMED)</code> clauses. The matches against the <code>WHERE</code> clause create bindings to be applied to the template for determining triples to be inserted (following the same rules as for <a href=\"#this\" shape=\"rect\"><code>DELETE/INSERT</code></a>).</p>\n<p>If any instantiation arising from the solution sequence produces a triple containing an unbound variable or an illegal RDF construct, such as a literal in subject or predicate position, then that triple is not inserted. The template can contain triples with no variables (known as ground or explicit triples), and these will also be inserted, provided that the solution sequence is not empty.</p>\n<p><strong>Example 8:</strong></p>\n<p>This example copies triples from one named graph to another named graph based on a pattern:</p>\n<pre xml:space=\"preserve\"><code class=\"language-sparql\">PREFIX dc:  &lt;http://purl.org/dc/elements/1.1/&gt;\nPREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;\n\nINSERT \n  { GRAPH &lt;http://example/bookStore2&gt; { ?book ?p ?v } }\nWHERE\n  { GRAPH  &lt;http://example/bookStore&gt;\n       { ?book dc:date ?date .\n         FILTER ( ?date &gt; \"1970-01-01T00:00:00-02:00\"^^xsd:dateTime )\n         ?book ?p ?v\n  } }   \n</code></pre>\n<p>Data before:</p>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example/bookStore**\n@prefix dc: &lt;http://purl.org/dc/elements/1.1/&gt; .\n@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .\n\n&lt;http://example/book1&gt; dc:title \"Fundamentals of Compiler Design\" .\n&lt;http://example/book1&gt; dc:date \"1977-01-01T00:00:00-02:00\"^^xsd:dateTime .\n\n&lt;http://example/book2&gt; ns:price 42 .\n&lt;http://example/book2&gt; dc:title \"David Copperfield\" .\n&lt;http://example/book2&gt; dc:creator \"Edmund Wells\" .\n&lt;http://example/book2&gt; dc:date \"1948-01-01T00:00:00-02:00\"^^xsd:dateTime .\n\n&lt;http://example/book3&gt; dc:title \"SPARQL 1.1 Tutorial\" .\n</code></pre>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example/bookStore2**\n@prefix dc: &lt;http://purl.org/dc/elements/1.1/&gt; .\n\n&lt;http://example/book4&gt; dc:title \"SPARQL 1.0 Tutorial\" .\n</code></pre>\n<p>Data after:</p>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example/bookStore**\n@prefix dc: &lt;http://purl.org/dc/elements/1.1/&gt; .\n@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .\n\n&lt;http://example/book1&gt; dc:title \"Fundamentals of Compiler Design\" .\n&lt;http://example/book1&gt; dc:date \"1977-01-01T00:00:00-02:00\"^^xsd:dateTime .\n\n&lt;http://example/book2&gt; ns:price 42 .\n&lt;http://example/book2&gt; dc:title \"David Copperfield\" .\n&lt;http://example/book2&gt; dc:creator \"Edmund Wells\" .\n&lt;http://example/book2&gt; dc:date \"1948-01-01T00:00:00-02:00\"^^xsd:dateTime .\n\n&lt;http://example/book3&gt; dc:title \"SPARQL 1.1 Tutorial\" .\n</code></pre>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example/bookStore2**\n@prefix dc: &lt;http://purl.org/dc/elements/1.1/&gt; .\n@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .\n\n&lt;http://example/book1&gt; dc:title \"Fundamentals of Compiler Design\" .\n&lt;http://example/book1&gt; dc:date \"1977-01-01T00:00:00-02:00\"^^xsd:dateTime .\n\n&lt;http://example/book4&gt; dc:title \"SPARQL 1.0 Tutorial\" .\n</code></pre>\n<p><strong>Example 9:</strong></p>\n<p>This example copies triples of name and email from one named graph to another. Some individuals may not have an address, but the name is copied regardless:</p>\n<pre xml:space=\"preserve\"><code class=\"language-sparql\">PREFIX foaf:  &lt;http://xmlns.com/foaf/0.1/&gt;\nPREFIX rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;\n\nINSERT \n  { GRAPH &lt;http://example/addresses&gt;\n    {\n      ?person  foaf:name  ?name .\n      ?person  foaf:mbox  ?email\n    } }\nWHERE\n  { GRAPH  &lt;http://example/people&gt;\n    {\n      ?person  foaf:name  ?name .\n      OPTIONAL { ?person  foaf:mbox  ?email }\n    } }\n</code></pre>\n<p>Data before:</p>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example/people**\n@prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt; .\n@prefix rdf:  &gt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .\n\n_:a  rdf:type        foaf:Person .\n_:a  foaf:name       \"Alice\" .\n_:a  foaf:mbox       &lt;mailto:alice@example.com&gt; .\n\n_:b  rdf:type        foaf:Person .\n_:b  foaf:name       \"Bob\" .\n</code></pre>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example/addresses**\n@prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt; .\n</code></pre>\n<p>Data after:</p>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example/people**\n@prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt; .\n@prefix rdf:  &gt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .\n\n_:a  rdf:type        foaf:Person .\n_:a  foaf:name       \"Alice\" .\n_:a  foaf:mbox       &lt;mailto:alice@example.com&gt; .\n\n_:b  rdf:type        foaf:Person .\n_:b  foaf:name       \"Bob\" .\n</code></pre>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example/addresses**\n@prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt; .\n\n_:a  foaf:name       \"Alice\" .\n_:a  foaf:mbox       &lt;mailto:alice@example.com&gt; .\n\n_:b  foaf:name       \"Bob\" .\n</code></pre>\n<p><strong>Example 10:</strong></p>\n<p>This example request first copies triples from one named graph to another named graph based on a pattern; triples about all the copied objects that are classified as Physical Objects are then deleted. This demonstrates two operations in a single request, both of which share common <code>PREFIX</code> definitions.</p>\n<pre xml:space=\"preserve\"><code class=\"language-sparql\">PREFIX dc:  &lt;http://purl.org/dc/elements/1.1/&gt;\nPREFIX dcmitype: &lt;http://purl.org/dc/dcmitype/&gt;\nPREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;\n\nINSERT\n  { GRAPH &lt;http://example/bookStore2&gt; { ?book ?p ?v } }\nWHERE\n  { GRAPH  &lt;http://example/bookStore&gt;\n     { ?book dc:date ?date . \n       FILTER ( ?date &lt; \"2000-01-01T00:00:00-02:00\"^^xsd:dateTime )\n       ?book ?p ?v\n     }\n  } ;\n\nWITH &lt;http://example/bookStore&gt;\nDELETE\n { ?book ?p ?v }\nWHERE\n { ?book dc:date ?date ;\n         dc:type dcmitype:PhysicalObject .\n   FILTER ( ?date &lt; \"2000-01-01T00:00:00-02:00\"^^xsd:dateTime ) \n   ?book ?p ?v\n } \n</code></pre>\n<p>Data before:</p>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example/bookStore**\n@prefix dc: &lt;http://purl.org/dc/elements/1.1/&gt; .\n@prefix dcmitype: &lt;http://purl.org/dc/dcmitype/&gt; .\n\n&lt;http://example/book1&gt; dc:title \"Fundamentals of Compiler Design\" .\n&lt;http://example/book1&gt; dc:date \"1996-01-01T00:00:00-02:00\"^^xsd:dateTime .\n&lt;http://example/book1&gt; a dcmitype:PhysicalObject .\n\n&lt;http://example/book3&gt; dc:title \"SPARQL 1.1 Tutorial\" .\n</code></pre>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example/bookStore2**\n@prefix dc: &lt;http://purl.org/dc/elements/1.1/&gt; .\n\n&lt;http://example/book4&gt; dc:title \"SPARQL 1.0 Tutorial\" .\n</code></pre>\n<p>Data after:</p>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example/bookStore**\n@prefix dc: &lt;http://purl.org/dc/elements/1.1/&gt; .\n@prefix dcmitype: &lt;http://purl.org/dc/dcmitype/&gt; .\n\n&lt;http://example/book3&gt; dc:title \"SPARQL 1.1 Tutorial\" .\n</code></pre>\n<pre xml:space=\"preserve\"><code class=\"language-turtle\">**# Graph: http://example/bookStore2**\n@prefix dc: &lt;http://purl.org/dc/elements/1.1/&gt; .\n@prefix dcmitype: &lt;http://purl.org/dc/dcmitype/&gt; .\n\n&lt;http://example/book1&gt; dc:title \"Fundamentals of Compiler Design\" .\n&lt;http://example/book1&gt; dc:date \"1996-01-01T00:00:00-02:00\"^^xsd:dateTime .\n&lt;http://example/book1&gt; a dcmitype:PhysicalObject .\n\n&lt;http://example/book4&gt; dc:title \"SPARQL 1.0 Tutorial\" .\n</code></pre></div>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> ;
        <http://www.w3.org/2000/01/rdf-schema#seeAlso>
                <https://kgdev.net/specifications/sparql11-update/updateLanguage/graphUpdate/deleteInsert/#this> ;
        <http://www.w3.org/ns/prov#wasDerivedFrom>
                <https://www.w3.org/TR/sparql11-update/#insert> .
