Delete¶
Deletes statements from a graph. Specify the statements either explicitly or by using a select] command The corresponding command for inserting statements is [wikiInsert insert.
To remove a single statement, specify its subject, predicate and object after the delete command. For example:
delete <ns:subject> <ns:predicate> 'object' from <rmi://mysite.com/server1#graph1>;
To remove a group of statements, include a select command after the
delete
command. The query must select exactly three columns, corresponding to the subject, predicate and object (in that order) of the statements to be removed.
The following example selects all the statements in #graph1
and uses the result within a delete
command to remove all the statements found in #graph1
from another graph, #graph2
.
delete select $s $p $o from <rmi://mysite.com/server1#graph1> where $s $p $o from <rmi://mysite.com/server1#graph2>;
The following example selects all the statements in #graph1
that have object 'object' and uses the result within a delete
command to remove all the statements found in #graph1
from another graph, #graph2
.
delete select $s $p $o from <rmi://mysite.com/server1#graph1> where ($s $p $o and $s $p 'object') from <rmi://mysite.com/server1#graph2>;
Note - The select query must return valid RDF statements. That is, the subject and predicate must be URI or blank node resources, not literals.
Updated by RainerWasserfuhr - about 13 years ago ยท 6 revisions