• Topic
  • Discussion
  • VOS.VirtTipsAndTricksSPARQL11Move(Last) -- DAVWikiAdmin? , 2017-06-13 05:48:07 Edit WebDAV System Administrator 2017-06-13 05:48:07

    Virtuoso SPARQL 1.1. Move Usage Examples

    What?

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

    The MOVE operation is a shortcut for moving all data from an input graph into a destination graph.

    How?

    Here are some examples showcasing Virtuoso's support for this functionality:

    Move DATA Example

    This example request moves all statements from the named graph identified by the IRI <urn:sparql:tests:move:data> into a named graph identified by the IRI <urn:sparql:tests:move2:data>

    1. Assume the following Raw Data Representation in Turtle:

      <#book1> <#price> 41 . <#book2> <#price> 42 . <#book3> <#price> 43 . <#book4> <#price> 44 .

    2. Load the sample data:

      INSERT DATA { GRAPH <urn:sparql:tests:move:data> { <#book1> <#price> 41 . <#book2> <#price> 42 . <#book3> <#price> 43 . <#book4> <#price> 44 . } }

    3. Query graph <urn:sparql:tests:move:data> data:

      SELECT * FROM <urn:sparql:tests:move:data> WHERE { ?s ?p ?o }

    4. Move the data from graph <urn:sparql:tests:move:data> to graph <urn:sparql:tests:move2:data> :

      MOVE GRAPH <urn:sparql:tests:move:data> TO GRAPH <urn:sparql:tests:move2:data>;

    5. Query graph <urn:sparql:tests:move2:data> data:

      SELECT * FROM <urn:sparql:tests:move2:data> WHERE { ?s ?p ?o }

    Related