• Topic
  • Discussion
  • VOS.VirtTipsAndTricksSPARQL11Clear(Last) -- DAVWikiAdmin? , 2017-06-13 05:39:31 Edit WebDAV System Administrator 2017-06-13 01:39:31

    Virtuoso SPARQL 1.1. CLEAR Usage Example

    What?

    This guide contains Virtuoso SPARQL 1.1. CLEAR Usage Example 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?

    Simple way of clear graph data.

    How?

    Here is example showcasing Virtuoso's support for this functionality:

    1. Assume the following Raw Data Representation in Turtle:

      <#alice> <#name> "Alice", "Alice Foo", "A. Foo" . <#alice> <#knows> <#bob>, <#carol> . <#bob> <#name> "Bob", "Bob Bar", "B. Bar" . <#carol> <#name> "Carol", "Carol Baz", "C. Baz" .

    2. Beautified Raw Data Representation in Turtle (from above) using Namespace Prefix:

      <#alice> <#name> "Alice" . <#alice> <#name> "Alice Foo" . <#alice> <#name> "A. Foo" . <#alice> <http://xmlns.com/foaf/0.1/knows> <#bob>, <#carol> . <#bob> <#name> "Bob" . <#bob> <#name> "Bob Bar" . <#bob> <#name> "B. Bar" . <#carol> <#name> "Carol" . <#carol> <#name> "Carol Baz" . <#carol> <#name> "C. Baz" .

    3. Load the sample data:

      INSERT { GRAPH <urn:sparql:tests:clear> { <#alice> <#name> "Alice" . <#alice> <#name> "Alice Foo" . <#alice> <#name> "A. Foo" . <#alice> <http://xmlns.com/foaf/0.1/knows> <#bob>, <#carol> . <#bob> <#name> "Bob" . <#bob> <#name> "Bob Bar" . <#bob> <#name> "B. Bar" . <#carol> <#name> "Carol" . <#carol> <#name> "Carol Baz" . <#carol> <#name> "C. Baz" . } }

    4. Clear the inserted data:

      SPARQL CLEAR GRAPH <urn:sparql:tests:clear>; Query result: callret-0 ANY Clear graph <urn:sparql:tests:clear> -- done No. of rows in result: 1

    Related