# DELETE INSERT

Copyright © 2010 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark, and document use rules apply.

## Abstract

Tests for SPARQL UPDATE

This page describes W3C SPARQL Working Group's SPARQL 1.1 test suite.

### Contributing Tests

The test manifests and entries are built automatically from manifest.ttl using a Rake task. Tests may be contributed via pull request to https://github.com/w3c/rdf-tests with suitable changes to the manifest.ttl and referenced files.

### Distribution

Distributed under both the W3C Test Suite License and the W3C 3-clause BSD License. To contribute to a W3C Test Suite, see the policies and contribution forms.

### Disclaimer

UNDER BOTH MUTUALLY EXCLUSIVE LICENSES, THIS DOCUMENT AND ALL DOCUMENTS, TESTS AND SOFTWARE THAT LINK THIS STATEMENT ARE PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.

## Test Descriptions

dawg-delete-insert-01: DELETE INSERT 1

  This update request reverts all foaf:knows relations

  type
    mf:UpdateEvaluationTest
  approval
  action
  result
dawg-delete-insert-01b: DELETE INSERT 1b

  This test case, as a variant of dawg-delete-insert-01, shoes that DELETE followed by INSERT is different from DELETE INSERT in a single operation

  type
    mf:UpdateEvaluationTest
  approval
  action
  result
dawg-delete-insert-01c: DELETE INSERT 1c

  This test case, as a variant of dawg-delete-insert-01, shoes that INSERT followed by DELETE is different from DELETE INSERT in a single operation.

  type
    mf:UpdateEvaluationTest
  approval
  action
  result
dawg-delete-insert-02: DELETE INSERT 2

  This deletes all foaf:knows relations from anyone named 'Alan'.

  type
    mf:UpdateEvaluationTest
  approval
  action
  result
dawg-delete-insert-03: DELETE INSERT 3

  This deletes all foaf:knows relations from anyone named 'Alan' using an unnamed bnode as wildcard

  type
    mf:NegativeSyntaxTest11
  approval
  action
    delete-insert-03.ru
dawg-delete-insert-03b: DELETE INSERT 3b

  This deletes all foaf:knows relations from anyone named 'Alan' using a named bnode as wildcard

  type
    mf:NegativeSyntaxTest11
  approval
  action
    delete-insert-03b.ru
dawg-delete-insert-04: DELETE INSERT 4

  This deletes all foaf:knows relations from anyone named 'Alan' using a naive rewriting, as suggested in http://lists.w3.org/Archives/Public/public-rdf-dawg/2011JanMar/0305.html

  type
    mf:UpdateEvaluationTest
  approval
  action
  result
dawg-delete-insert-04b: DELETE INSERT 4b

  This deletes all foaf:knows relations from anyone named 'Alan' using a simpler rewriting than dawg-delete-insert-04

  type
    mf:UpdateEvaluationTest
  approval
  action
  result
dawg-delete-insert-05: DELETE INSERT 5

  This deletes all foaf:knows relations from anyone named 'Alan' and inserts that all 'Alans' know themselves only.

  type
    mf:NegativeSyntaxTest11
  approval
  action
    delete-insert-05.ru
dawg-delete-insert-05b: DELETE INSERT 5b

  This deletes all foaf:knows relations from anyone named 'Alan' and inserts that all 'Alans' know themselves only, using a rewriting analogous to :dawg-delete-insert-04b

  type
    mf:UpdateEvaluationTest
  approval
  action
  result
dawg-delete-insert-06: DELETE INSERT 6

  dawg-delete-insert-06 and dawg-delete-insert-06b show that the rewriting in dawg-delete-insert-05b.ru isn't equivalent to dawg-delete-insert-05.ru in case Alan doesn't know anybody.

  type
    mf:NegativeSyntaxTest11
  approval
  action
    delete-insert-05.ru
dawg-delete-insert-06b: DELETE INSERT 6b

  dawg-delete-insert-06 and dawg-delete-insert-06b show that the rewriting in dawg-delete-insert-05b.ru isn't equivalent to dawg-delete-insert-05.ru in case Alan doesn't know anybody.

  type
    mf:UpdateEvaluationTest
  approval
  action
  result
dawg-delete-insert-07: DELETE INSERT 7

  This deletes all foaf:knows relations from anyone named 'Alan' and inserts a single foaf:knows triple with a blank node as object for 'Alan'. This shows the different behavior of bnodes in INSERT (similar to CONSTRUCT) and DELETE (bnodes act as wildcards) templates.

  type
    mf:NegativeSyntaxTest11
  approval
  action
    delete-insert-07.ru
dawg-delete-insert-07b: DELETE INSERT 7b

  This deletes all foaf:knows relations from anyone named 'Alan' and replaces them by bnodes. This shows the different behavior of bnodes in INSERT (similar to CONSTRUCT) and DELETE (bnodes act as wildcards) templates. As opposed to test case dawg-delete-insert-7, note that the result graph in this example is non-lean.

  type
    mf:NegativeSyntaxTest11
  approval
  action
    delete-insert-07b.ru
dawg-delete-insert-08: DELETE INSERT 8

  This DELETE test was first brought up in http://lists.w3.org/Archives/Public/public-rdf-dawg/2011JanMar/0290.html. It demonstrates how unbound variables (from an OPTIONAL) are handled in DELETE templates

  type
    mf:NegativeSyntaxTest11
  approval
  action
    delete-insert-08.ru
dawg-delete-insert-09: DELETE INSERT 9

  This DELETE test was first brought up in http://lists.w3.org/Archives/Public/public-rdf-dawg/2011JanMar/0317.html. It demonstrates the behavior of shared bnodes in a DELETE template.

  type
    mf:NegativeSyntaxTest11
  approval
  action
    delete-insert-09.ru
delete-insert-halloween-problem: Halloween Problem: A delete/insert operation should not be able to read its own writes
  type
    mf:UpdateEvaluationTest
  approval
  action
  result