%META:TOPICPARENT{name="VirtTipsAndTricksGuide"}%
---+ How can I Delete Triple Patterns that are Not Scoped to a Named Graph?
Presuming this triple exists in one or more graphs in the store:
{
}
The SQL query below will delete that triple from all graphs in the store:
DELETE
FROM DB.DBA.RDF_QUAD
WHERE p = iri_to_id
('http://xmlns.com/foaf/0.1/knows')
AND s = iri_to_id
('http://kingsley.idehen.net/dataspace/person/kidehen#this')
AND o = iri_to_id
('http://id.myopenlink.net/dataspace/person/KingsleyUyiIdehen#this')
;
According to [[http://www.w3.org/TR/2010/WD-sparql11-update-20100126/#t414][SPARQL 1.1 Update]],
the FROM
clause which scopes the query to a single graph is optional. Thus, the SQL query
above can be rewritten to the SPARQL query below, again deleting the matching triple from all
graphs in the store:
DELETE
{
GRAPH ?g
{
}
}
WHERE
{
GRAPH ?g
{
}
}
---++ Related
* [[VirtTipsAndTricksGuide][Virtuoso Tips and Tricks Collection]]
* [[http://docs.openlinksw.com/virtuoso/sparqlextensions.html#rdfsparulexamples14][How can I delete triples from a graph?]]
* [[VirtTipsAndTricksGuideDeleteLargeGraphs][How can I delete triples from a "Large" graph?]]
* [[http://docs.openlinksw.com/virtuoso/sparqlextensions.html#rdfsparulexamples15][How can I copy triples from one graph to another?]]
* [[http://docs.openlinksw.com/virtuoso/sparqlextensions.html#rdfsparulexamples16][How can I move triples from one graph to another?]]
* [[http://docs.openlinksw.com/virtuoso/sparqlextensions.html#rdfsparulexamples10][How can I drop a graph?]]
* [[VirtTipsAndTricksDeleteGraphProc][How can I delete graphs using stored procedure?]]