Virtuoso Conductor R2RML Import Wizard

The Virtuoso Conductor can be used for importing existing R2RML scripts into Virtuoso and generate the necessary RDF Linked Data Views for Virtuoso hosting and deployment.

Usage Example

Prerequisites

Ensure the following VAD packages are installed:

Steps

  1. Create a test table with sample data:

    SQL> CREATE TABLE "R2RML"."TEST"."PRODUCT" ( "id" INTEGER, "name" VARCHAR(100), PRIMARY KEY ("id") ); Done. -- 16 msec. SQL> INSERT SOFT "R2RML"."TEST"."PRODUCT" VALUES(1, 'Virtuoso'); Done. -- 0 msec. SQL> INSERT SOFT "R2RML"."TEST"."PRODUCT" VALUES(2, 'UDA'); Done. -- 0 msec. SQL>

  2. Grant select privileges on the "R2RML"."TEST"."PRODUCT" table to the SPARQL user to enable execution via SPARQL endpoint:

    SQL> GRANT SELECT ON R2RML.TEST.PRODUCT TO "SPARQL",?"SPARQL_UPDATE" Done. -- 1 msec. SQL>

  3. Create the following R2RML mapping script for the "R2RML"."TEST"."PRODUCT" table:

    $ cat demo.n3 @prefix rr: <http://www.w3.org/ns/r2rml#> . @prefix exa: <http://example.com/ns#> . @prefix product: <http://example.com/product#> . <http://example.com/ns#TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableSchema "R2RML"; rr:tableOwner "TEST"; rr:tableName "PRODUCT" ]; rr:subjectMap [ rr:template "http://example.com/product/{id}"; rr:class exa:product; ]; rr:predicateObjectMap [ rr:predicate product:id; rr:objectMap [ rr:column "id" ]; ]; rr:predicateObjectMap [ rr:predicate product:name; rr:objectMap [ rr:column "name" ]; ]; . $

  4. Go to the Linked Data -> R2RML of the Virtuoso Conductor:



  5. Select the Choose File button and select the R2RML file to load:



  6. Select the Validate button to verify the R2RML mapping script:



  7. Select the Generate button to generate the RDF Linked Data Views mappings for the R2RML mapping script:



  8. Select the Execute button to create the RDF Linked Data Views mapping the the Quad Store:



  9. The RDF Linked Data View creation is complete and status is displayed:



  10. The Default Graph Name (transient) specified http://demo.openlinksw.com/r2rml# can now be used to run a SPARQL query against the created Linked Data View. If the Generate RDB2RDF triggers and Enable Data Syncs with Physical Quad Store check boxes are selected the Physical Graph Name (persistent) specified urn:demo.openlinksw.com/r2rml# can be used to run a SPARQL query against the materialized triples in the Quad Store.



  11. The results set for the Linked Data View graph are displayed:



Related