%META:TOPICPARENT{name="VirtTipsAndTricksSPARQL11FeaturesExamplesCollection"}% ---+Virtuoso SPARQL 1.1. DROP Usage Examples %TOC% ---++What? This guide contains Virtuoso SPARQL 1.1. DROP Usage examples queries which you can run against any SPARQL endpoint that supports SPARQL 1.1 and the ability to allow a verified user perform INSERT operations. ---++Why? Use to remove a named graph from the RDF Quad Store. ---++How? Here are some examples showcasing Virtuoso's support for this functionality: ---+++DROP Example This example drops named graph identified by the IRI <urn:sparql:tests:drop:data> from the RDF Quad Store. 1 Assume the following Raw Data Representation in Turtle: <#book1> <#price> 41 . <#book2> <#price> 42 . <#book3> <#price> 43 . <#book4> <#price> 44 . 1 Create explicitly a named graph with IRI <urn:sparql:tests:drop:data> : CREATE GRAPH ; 1 Load the sample data: INSERT DATA { GRAPH { <#book1> <#price> 41 . <#book2> <#price> 42 . <#book3> <#price> 43 . <#book4> <#price> 44 . } } 1 Query graph <urn:sparql:tests:drop:data> data -- should return 4 triples: SELECT * FROM WHERE { ?s ?p ?o } * [[http://bit.ly/10scyxi][View the SPARQL Query Definition via SPARQL Protocol URL]]; * [[http://bit.ly/X8qXRI][View the SPARQL Query Results via SPARQL Protocol URL]] 1 Drop the named graph identified by the IRI <urn:sparql:tests:drop:data> : DROP GRAPH ; * Note: If the graph is not created explicitly as per above, i.e. the step CREATE GRAPH .. is omitted, in order to drop the graph you need to use SILENT option, which will not signal any errors: DROP SILENT GRAPH ; 1 Query graph <urn:sparql:tests:drop:data> data -- should return no triples: SELECT * FROM WHERE { ?s ?p ?o } * [[http://bit.ly/10scyxi][View the SPARQL Query Definition via SPARQL Protocol URL]]; * [[http://bit.ly/X8qXRI][View the SPARQL Query Results via SPARQL Protocol URL]] ---++Related * [[http://www.w3.org/TR/2012/PR-sparql11-update-20121108/#drop][SPARQL 1.1 DROP]] * [[VirtTipsAndTricksGuideRenameGraph][Rename RDF Graph Example]] * [[http://www.w3.org/TR/rdf-sparql-protocol/][SPARQL Protocol (HTTP based Query Service)]] * [[VirtTipsAndTricksGuide][Virtuoso Tips and Tricks Collection]] * [[VirtTipsAndTricksSPARQL11FeaturesExamplesCollection][Virtuoso SPARQL 1.1 Usage Examples Collection]] * [[http://virtuoso.openlinksw.com/tutorials/sparql/SPARQL_Tutorials_Part_9/SPARQL_Tutorials_Part_9.html][Virtuoso SPARQL 1.1 Syntax Tutorial]] * [[http://docs.openlinksw.com/virtuoso/rdfsparql.html][Virtuoso Documentation]]