Mapping SQL Data to Linked Data Views
Introduction
Virtuoso uses a SPARQL-based Meta Schema Language to provide RDBMS-to-RDF mapping functionality (also described as, Linked Data Views of SQL data). The language is an extension of the SPARQL query language, meshed with Virtuoso's SPASQL (SPARQL-inside-SQL) functionality. The language enables you to declaratively map relational database schema tables, columns, rows, and foreign key relationships to Classes, Attributes, Relationships, and Instances (Objects/Entities/Individuals) defined by RDF Schemas or OWL Ontologies. The mapping process uses a special built-in Virtuoso function to generate IRIs / URIs in "Subject" or "Object" position of a SPARQL graph pattern, en route to building a set of SQL compiler rules and optimizations for translating SPARQL queries into SQL on the fly.While the full power of the Meta Schema Language is always available to the advanced user, many users (both beginners and experts) will find that the more recently enabled Automated Generation of Linked Data Views is more than sufficient.
Generating Linked Data Views from SQL data
Automated Generation of Linked Data Views over Relational Data Sources
Manual Mapping Process
The basic steps are as follows:
- Identify the tables, views, and procedure views to be mapped.
- Decide if you are performing a 1:1 mapping or a more customized mapping to a specific RDF Schema or Ontology.
- Declare Virtuoso-URI-Generator functions for each Class in the target RDF Schema or Ontology.
- Use the Virtuoso-URI-Generator functions in SPARQL graph patterns within the
ALTER QUAD STORAGE
part of a SPASQL-based mapping statement. - Check to ensure the
cartridges
VAD package is installed using theSystem Admin -> Packages
tab of the Virtuoso Conductor, and if not select theinstall
button to the right of the package to install for use. - Use Virtuoso's built-in URL-Rewrite Rules APIs (or Conductor UI) to publish the Linked Data URIs which result from the mapping above.
Manual Mapping Example
- View an example of mapping the phpBB3 SQL schema to the classes defined by the SIOC and FOAF ontologies.
More Examples, Linking Remote Tables into Virtuoso (Commercial Edition only)
- View how to perform linking across several supported targets, including Oracle, SQL Server, DB2, Sybase, Informix, Ingres,
MySQL, PostgreSQL, and other ODBC and JDBC data sources.
Sample Mapping Scripts for Various Purposes
Enterprise Data Access & Integration
- RDF-based Linked Data View atop Virtuoso using Tutorial Northwind SQL Schema / Live Demo
- RDF-based Linked Data View atop Microsoft SQL Server using the Northwind Demo Database / Live Demo
- RDF-based Linked Data View atop Oracle using the demonstration 'Human Resources' database / Live Demo
- RDF-based Linked Data View atop DB2 using the demonstration 'Sample' database / Live Demo
- RDF-based Linked Data View atop Informix using the demonstration 'Stores' database / Live Demo
- RDF-based Linked Data View atop Ingres using the demonstration 'Tutorial' database / Live Demo
- RDF-based Linked Data View atop Sybase using the demonstration 'pubs2' database / Live Demo
- RDF-based Linked Data View atop Progress (SQL-89) using the demonstration 'iSports' database / Live Demo
- RDF-based Linked Data View atop Progress (SQL-92) using the demonstration 'iSports' database / Live Demo
Linked Data Views of ODS Application Data
- RDF-based Linked Data Views atop Enterprise Collaboration (ODS) SQL Schema / Live Demo
- RDF-based Linked Data Views atop Socially enhanced CRM (ODS-eCRM) SQL Schema / Live Demo
Business Intelligence
- RDF-based Linked Data Views atop TPCH Benchmark SQL Schema / Live Demo
- RDF-based Linked Data Views atop TPCD Benchmark SQL Schema / Live Demo
- RDF-based Linked Data Views atop Thalia Benchmark SQL Schema / Live Demo
- RDF-based Linked Data Views atop MusicBrainz SQL Schema
Semi-Structured Content Examples
- Virtuoso Product Documentation (DocBook) to RDF / Live Demo
- Virtuoso Online Tutorials to RDF / Live Demo
Web 2.0 Platforms
- RDF-based Linked Data Views atop phpBB3 SQL Schema / Live Demo
- RDF-based Linked Data Views atop WordPress SQL Schema / Live Demo
- RDF-based Linked Data Views atop MediaWiki SQL Schema / Live Demo
- RDF-based Linked Data Views atop Drupal SQL Schema / Live Demo
- RDF-based Linked Data Views atop Bugzilla SQL Schema
How Do I ...?
- ...Use SPARQL to query RDF Linked Data View of Virtuoso's SQL based Demo Database (Northwind Schema)
- ...Use SPARQL to query RDF Linked Data View of Virtuoso Online Tutorials SQL Schema
- ...Use SPARQL to query RDF Linked Data View of Virtuoso online Documentation SQL Schema
- ...Use SPARQL to query RDF Linked Data View of WordPress SQL Schema
- ...Use SPARQL to query RDF Linked Data View of MediaWiki SQL Schema
- ...Use SPARQL to query RDF Linked Data View of phpBB SQL Schema
- ...Use SPARQL to query RDF Linked Data View of Socially enhanced CRM (ODS eCRM SQL Schema)
- ...Use SPARQL to query RDF Linked Data Views of Enterprise Collaboration (ODS SQL Schema)
Technical White Papers & Advanced Tutorials
- Declarative Meta Schema Language for SQL Schema to RDF Ontology Mapping - White Paper
- Declarative Meta Schema Language for SQL Schema to RDF Ontology Mapping - Tutorial
Screencast Demos
- Virtuoso Linked Data Views over RDBMS Data Sources - Part 1
- Virtuoso Linked Data Views over RDBMS Data Sources - Part 2