<docbook><section><title>VOSSQL2RDF</title><para> </para>
<title>Mapping SQL Data to Linked Data Views</title>Mapping SQL Data to Linked Data Views
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Introduction</bridgehead>
 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&#39;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 &quot;Subject&quot; or &quot;Object&quot; position of a SPARQL graph pattern, <emphasis>en route</emphasis> to building a set of SQL compiler rules and optimizations for translating SPARQL queries into SQL on the fly.<para>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 <ulink url="VirtRdb2RDFViewsGeneration">Automated Generation of Linked Data Views</ulink> is more than sufficient.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Generating Linked Data Views from SQL data</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Automated Generation of Linked Data Views over Relational Data Sources</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtRdb2RDFViewsGeneration">Automated Generation of Linked Data Views</ulink></listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3"> Manual Mapping Process</bridgehead>
<para>The basic steps are as follows:</para>
<orderedlist spacing="compact"><listitem>Identify the tables, views, and procedure views to be mapped.
</listitem>
<listitem>Decide if you are performing a 1:1 mapping or a more customized mapping to a specific RDF Schema or Ontology.
</listitem>
<listitem>Declare Virtuoso-URI-Generator functions for each Class in the target RDF Schema or Ontology.
</listitem>
<listitem>Use the Virtuoso-URI-Generator functions in SPARQL graph patterns within the ALTER QUAD STORAGE part of a SPASQL-based mapping statement.
</listitem>
<listitem>Check to ensure the cartridges VAD package is installed using the  System Admin -&gt; Packages tab of the Virtuoso Conductor, and if not select the install button to the right of the package to install for use.
</listitem>
<listitem>Use Virtuoso&#39;s built-in URL-Rewrite Rules APIs (or Conductor UI) to publish the Linked Data URIs which result from the mapping above.</listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h4"> Manual Mapping Example</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem>View <ulink url="VOSSQL2RDFMappingExample">an example of mapping</ulink> the phpBB3 SQL schema to the classes defined by the SIOC and FOAF ontologies.</listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h4"> More Examples, Linking Remote Tables into Virtuoso (Commercial Edition only)</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem>View <ulink url="VirtLinkRemoteTables">how to perform linking</ulink> across several supported targets, including Oracle, SQL Server, DB2, Sybase, Informix, Ingres, MySQL, PostgreSQL, and other ODBC and JDBC data sources.</listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3"> Sample Mapping Scripts for Various Purposes</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> Enterprise Data Access &amp; Integration</bridgehead>
 <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtRDFViewTutorialNorthwind">RDF-based Linked Data View atop Virtuoso using Tutorial Northwind SQL Schema</ulink> / <ulink url="VirtRDFViewTutorialNorthwindDemo">Live Demo</ulink> </listitem>
<listitem><ulink url="VirtRDFViewNorthwind">RDF-based Linked Data View atop Microsoft SQL Server using the Northwind Demo Database</ulink> / <ulink url="VirtRDFViewNorthwindDemo">Live Demo</ulink> </listitem>
<listitem><ulink url="VirtRDFViewsOracleHrDb">RDF-based Linked Data View atop Oracle using the demonstration &#39;Human Resources&#39; database</ulink> / <ulink url="VirtRDFViewsOracleHrDbDemo">Live Demo</ulink> </listitem>
<listitem><ulink url="VirtRDFViewsDB2SampleDb">RDF-based Linked Data View atop DB2 using the demonstration &#39;Sample&#39; database</ulink> / <ulink url="VirtRDFViewsDB2SampleDbDemo">Live Demo</ulink> </listitem>
<listitem><ulink url="VirtRDFViewsInformixStoresDemo">RDF-based Linked Data View atop Informix using the demonstration &#39;Stores&#39; database</ulink> / <ulink url="VirtRDFViewsInformixStoresDemoLinks">Live Demo</ulink> </listitem>
<listitem><ulink url="VirtRDFViewsIngresTutDb">RDF-based Linked Data View atop Ingres using the demonstration &#39;Tutorial&#39; database</ulink> / <ulink url="VirtRDFViewsIngresTutDbDemo">Live Demo</ulink> </listitem>
<listitem><ulink url="VirtRDFViewsSybasePubs2Db">RDF-based Linked Data View atop Sybase using the demonstration &#39;pubs2&#39; database</ulink> / <ulink url="VirtRDFViewsSybasePubs2DbDemo">Live Demo</ulink> </listitem>
<listitem><ulink url="VirtRDFViewsProgressSQ89ISports">RDF-based Linked Data View atop Progress (SQL-89) using the demonstration &#39;iSports&#39; database</ulink> / <ulink url="VirtRDFViewsProgressSQ89ISportsDemo">Live Demo</ulink> </listitem>
<listitem><ulink url="VirtRDFViewsProgressSQ92ISports">RDF-based Linked Data View atop Progress (SQL-92) using the demonstration &#39;iSports&#39; database</ulink> / <ulink url="VirtRDFViewsProgressSQ92ISportsDemo">Live Demo</ulink></listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h4"> Linked Data Views of ODS Application Data</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VOSODSViews">RDF-based Linked Data Views atop Enterprise Collaboration (ODS) SQL Schema</ulink> / <ulink url="VOSODSViewsDemo">Live Demo</ulink> </listitem>
<listitem><ulink url="VOSeCRMViews">RDF-based Linked Data Views atop Socially enhanced CRM (ODS-eCRM) SQL Schema</ulink> / <ulink url="VOSeCRMViewsDemo">Live Demo</ulink></listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h4"> Business Intelligence</bridgehead>
 <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtRDFViewTPCH">RDF-based Linked Data Views atop TPCH Benchmark SQL Schema</ulink> / <ulink url="VirtRDFViewTPCHDemo">Live Demo</ulink> </listitem>
<listitem><ulink url="VirtRDFViewTPCD">RDF-based Linked Data Views atop TPCD Benchmark SQL Schema</ulink> / <ulink url="VirtRDFViewTPCDDemo">Live Demo</ulink> </listitem>
<listitem><ulink url="VirtRDFViewsThalia">RDF-based Linked Data Views atop Thalia Benchmark SQL Schema</ulink> / <ulink url="VirtRDFViewsThaliaDemo">Live Demo</ulink> </listitem>
<listitem><ulink url="VirtRDFViewMusicbrainz">RDF-based Linked Data Views atop MusicBrainz SQL Schema</ulink></listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h4"> Semi-Structured Content Examples</bridgehead>
 <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtRDFViewDocs">Virtuoso Product Documentation (DocBook) to RDF</ulink> / <ulink url="VirtRDFViewDocsDemo">Live Demo</ulink> </listitem>
<listitem><ulink url="VirtRDFViewTutorial">Virtuoso Online Tutorials to RDF</ulink> / <ulink url="VirtRDFViewTutorialDemo">Live Demo</ulink></listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h4"> Web 2.0 Platforms</bridgehead>
 <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtRDFViewPHPBB3">RDF-based Linked Data Views atop phpBB3 SQL Schema</ulink> / <ulink url="VirtRDFViewPHPBB3Demo">Live Demo</ulink> </listitem>
<listitem><ulink url="VirtRDFViewWordpress">RDF-based Linked Data Views atop WordPress SQL Schema</ulink> / <ulink url="VirtRDFViewWordpressDemo">Live Demo</ulink> </listitem>
<listitem><ulink url="VirtRDFViewMediaWiki">RDF-based Linked Data Views atop MediaWiki SQL Schema</ulink> / <ulink url="VirtRDFViewMediaWikiDemo">Live Demo</ulink> </listitem>
<listitem><ulink url="VirtRDFViewDrupal">RDF-based Linked Data Views atop Drupal SQL Schema</ulink> / <ulink url="VirtRDFViewDrupalDemo">Live Demo</ulink> </listitem>
<listitem><ulink url="VirtRDFViewBugzilla">RDF-based Linked Data Views atop Bugzilla SQL Schema</ulink></listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> How Do I ...?</bridgehead>
 <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="NorthWindREF">...Use SPARQL to query RDF Linked Data View of Virtuoso&#39;s SQL based Demo Database (Northwind Schema)</ulink> </listitem>
<listitem><ulink url="SIOCRefTutorial">...Use SPARQL to query RDF Linked Data View of Virtuoso Online Tutorials SQL Schema</ulink> </listitem>
<listitem><ulink url="SIOCRefDocs">...Use SPARQL to query RDF Linked Data View of Virtuoso online Documentation SQL Schema</ulink> </listitem>
<listitem><ulink url="WordPressSIOCRef">...Use SPARQL to query RDF Linked Data View of WordPress SQL Schema</ulink> </listitem>
<listitem><ulink url="MediaWikiSIOCRef">...Use SPARQL to query RDF Linked Data View of MediaWiki SQL Schema</ulink> </listitem>
<listitem><ulink url="PHPBB3SIOCRef">...Use SPARQL to query RDF Linked Data View of phpBB SQL Schema</ulink> </listitem>
<listitem><ulink url="ECRMRef">...Use SPARQL to query RDF Linked Data View of Socially enhanced CRM (ODS eCRM SQL Schema)</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/dataspace/dav/wiki/ODS/VOSODSSparqlSamples">...Use SPARQL to query RDF Linked Data Views of Enterprise Collaboration (ODS SQL Schema)</ulink></listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Technical White Papers &amp; Advanced Tutorials</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VOSSQLRDF">Declarative Meta Schema Language for SQL Schema to RDF Ontology Mapping - White Paper</ulink> </listitem>
<listitem><ulink url="http://virtuoso.openlinksw.com/Whitepapers/html/rdf_views/virtuoso_rdf_views_example.html">Declarative Meta Schema Language for SQL Schema to RDF Ontology Mapping - Tutorial</ulink></listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Screencast Demos</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://www.youtube.com/watch?v=bj7AbJ0ZYCk&amp;feature=channel">Virtuoso Linked Data Views over RDBMS Data Sources - Part 1</ulink> </listitem>
<listitem><ulink url="http://www.youtube.com/watch?v=yXNlcISS0aY&amp;feature=channel">Virtuoso Linked Data Views over RDBMS Data Sources - Part 2</ulink></listitem>
</itemizedlist></section></docbook>