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:
- rdb2rdf_dav.vad R2RML package;
- conductor_dav.vad Conductor package.
Steps
- 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>
- 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>
- 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" ]; ]; . $
- Go to the
Linked Data -> R2RMLof the Virtuoso Conductor:
- Select the
Choose Filebutton and select the R2RML file to load:
- Select the
Validatebutton to verify the R2RML mapping script:
- Select the
Generatebutton to generate the RDF Linked Data Views mappings for the R2RML mapping script:
- Select the
Executebutton to create the RDF Linked Data Views mapping the the Quad Store:
- The RDF Linked Data View creation is complete and status is displayed:
- The
Default Graph Name(transient) specifiedhttp://demo.openlinksw.com/r2rml#can now be used to run a SPARQL query against the created Linked Data View. If theGenerate RDB2RDF triggersandEnable Data Syncs with Physical Quad Storecheck boxes are selected thePhysical Graph Name(persistent) specifiedurn:demo.openlinksw.com/r2rml#can be used to run a SPARQL query against the materialized triples in the Quad Store.
- The results set for the Linked Data View graph are displayed:
Related
- Virtuoso R2RML Support
- Generate Linked Data Views via R2RML from iSQL
- Generate Transient and/or Persistent Linked Data Views atop Remote Relational Data Sources
- W3C page for R2RML: RDB to RDF Mapping Language