Mapping SQL Data to RDF
Introduction
Virtuoso uses a SPARQL-based Meta Schema Language to provide RDBMS-to-RDF mapping functionality (also described as, RDF 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.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 STORAGEpart of a SPASQL-based mapping statement. - Use Virtuoso's built-in URL-Rewrite Rules APIs (or Conductor UI) to publish the Linked Data URIs which result from the mapping above.
Mapping Example
- View an example of mapping the phpBB3 SQL schema to the classes defined by the SIOC and FOAF ontologies.
Linking Remote tables into Virtuoso Examples
- View how to perform linking across all Virtuoso supported mechanisms i.e. for Oracle, SQL Server, DB2, Sybase, Informix, Ingres, MySQL, PostgreSQL, ODBC, and JDBC DSNs.
White Papers & 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
Generation of RDF Views from SQL data
Automated Generation of RDF Views over Relational Data Sources
Sample Mapping Scripts
Web 2.0 Platforms
Semi-Structured Content Examples
Enterprise Data Access & Integration
- Virtuoso's Northwind based Demo Database (Tutorials variant) to RDF
- SQL Server's Northwind Demo Database
- Oracle using the demonstration 'Human Resources' database
- DB2 using the demonstration 'Sample' database
- Informix using demonstration 'Stores' database
- Ingres using demonstration 'Tutorial' database
- Sybase using demonstration 'pubs2' database
- Progress (SQL-89) using demonstration 'iSports' database
- Progress (SQL-92) using demonstration 'iSports' database
- BSBM to RDF
ODS Applications RDF Views
Business Intelligence
How Do I ...?
- ...Use SPARQL to Query Virtuoso's Online Tutorials Data Space
- ...Use SPARQL to Query Virtuoso's Online Documentation Data Space
- ...Use SPARQL to Query the Northwind SQL-RDF Linked Data
- ...Use SPARQL to Query the WordPress SQL-RDF Linked Data
- ...Use SPARQL to Query the MedaWiki SQL-RDF Linked Data
- ...Use SPARQL to Query the PHPBB SQL-RDF Linked Data
Screencast Demos
- Virtuoso RDF Views over RDBMS Data Sources - Part 1
- Virtuoso RDF Views over RDBMS Data Sources - Part 2