<docbook><section><title>VirtRdb2RDFViewsGeneration</title><title> Automated Generation of Linked Data Views over Relational Data Sources with Virtuoso</title> Automated Generation of Linked Data Views over Relational Data Sources with Virtuoso
<para>The proliferation of relational databases across enterprises and behind Web sites makes them a vital data source for the burgeoning Linked Data Web.
 The process of publishing Linked Data from these sources needs to be as unobtrusive as possible, and must preserve and enhance the traditional virtues of relational database management systems (RDBMS) such as:</para>
<itemizedlist mark="bullet" spacing="compact"><listitem>Scalability </listitem>
<listitem>Security </listitem>
<listitem>Analytical Expressiveness of SQL </listitem>
<listitem>Separation of Data <emphasis>Storage</emphasis> from Data <emphasis>Access</emphasis> via ODBC, JDBC, ADO.NET, and other call level interfaces (CLIs)</listitem>
</itemizedlist><para>To this end, Virtuoso includes an HTML-based Wizard interface for dynamically generating &amp; publishing RDF-based Linked Data -- essentially RDF-based VIEWs -- from relational data sources.</para>
<emphasis><emphasis>Note:</emphasis> In the Open Source Edition, this can only be used over locally-stored, Virtuoso-based SQL data.
 With the Commercial Edition, local or remote ODBC- or JDBC-accessible data sources can also be exposed as RDF-based Linked Data.</emphasis><bridgehead class="http://www.w3.org/1999/xhtml:h2"> How to Publish RDF-based Linked Data VIEWs of Relational Data</bridgehead>
<orderedlist spacing="compact"><listitem>Check to ensure the <ulink url="https://virtuoso.openlinksw.com/download/">cartridges_dav.vad</ulink> and <ulink url="https://virtuoso.openlinksw.com/download/">fct_dav.vad</ulink> VAD packages are installed using the  <emphasis>System Admin -&gt; Packages</emphasis> tab of the Virtuoso Conductor.
<itemizedlist mark="bullet" spacing="compact"><listitem>If not yet present, use the <emphasis>Install</emphasis> button to the right of the package to install now.
</listitem>
</itemizedlist></listitem>
<listitem>If the data is hosted in the same Virtuoso instance, skip to the next step.
<orderedlist spacing="compact"><listitem>Identify the ODBC or JDBC data sources that host the data you seek to publish.
</listitem>
<listitem>Attach/Link TABLEs and/or VIEWs from the external data sources into Virtuoso via their Data Source Names (DSNs).
</listitem>
</orderedlist></listitem>
<listitem>In the Virtuoso schema, locate the local and/or linked TABLEs and/or VIEWs that hold the data you wish to publish.
</listitem>
<listitem>Use the Linked Data publishing Wizard to produce a Data Source Ontology and associated Instance Data.
</listitem>
<listitem>Configure Endpoints and Re-write Rules to disambiguate data object (resource) identity and description through HTTP-based content negotiation.
</listitem>
<listitem>Expose the Data Source Ontology and associated Instance Data in Linked Data form through those Endpoints and Re-write Rules.</listitem>
</orderedlist><para>These steps may be largely automated (the <emphasis><ulink url="#OneClickLinkedDataGenerationAndDeployment">One-Click Deployment</ulink></emphasis> below), or performed manually (<emphasis><ulink url="#ManualLinkedDataGenerationAndDeployment">Using the Conductor&#39;s HTML-based Wizard</ulink></emphasis> further down).</para>
<ulink url="">
<para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> One-Click Linked Data Generation &amp; Deployment</bridgehead>
<orderedlist spacing="compact"><listitem>Go to http://&lt;cname&gt;:port/conductor.
 Note, the appropriate cname (hostname) and port number for dereferencing URIs must be set for the <ulink url="http://docs.openlinksw.com/virtuoso/databaseadmsrv.html#ini_URIQA">URIQA DefaultHost</ulink> Virtuoso configuration parameter before creating the Linked Data RDF views.
</listitem>
<listitem>Log in as user <emphasis>dba</emphasis> (or another user with DBA privileges) </listitem>
<listitem>Follow menu path <emphasis>RDF</emphasis> -&gt; <emphasis>Linked Data Views</emphasis> <figure><graphic fileref="VirtRdb2RDFViewsGeneration/rd1.png" /></figure> </listitem>
<listitem>In the form presented, perform the following steps: <figure><graphic fileref="VirtRdb2RDFViewsGeneration/rd2.png" /></figure> <orderedlist spacing="compact"><listitem>Select the <emphasis>Database Name Qualifier</emphasis> (e.g., &quot;Demo&quot;)  that exposes the Tables / Views for this exercise </listitem>
<listitem>Enter the <emphasis>Base URL</emphasis> to which your URL rewrite rules will be bound (e.g., http://&lt;cname&gt;:8890/Demo) </listitem>
<listitem>Select the specific Tables containing the data to be published (e.g., <emphasis>Demo.demo.Shippers</emphasis> and <emphasis>Demo.demo.Suppliers</emphasis>) </listitem>
<listitem>Click the <emphasis>Generate &amp; Publish</emphasis> button </listitem>
</orderedlist></listitem>
<listitem>Virtuoso will perform the entire process of ontology generation, instance data generation, and linked data deployment (re-write rules generation and application).
</listitem>
<listitem>Error messages will be presented if the Wizard encounters problems.
 If there are no error messages, your RDF view declarations and Linked Data publishing activities will have completed successfully.
<figure><graphic fileref="VirtRdb2RDFViewsGeneration/rd13.png" /></figure> </listitem>
<listitem>Optionally, you can also perform one of the following tasks: <itemizedlist mark="bullet" spacing="compact"><listitem><emphasis>Save Data Mappings</emphasis> when clicked, offers to save the generated Definitions to local file system </listitem>
<listitem><emphasis>Save Ontology Mappings</emphasis> when clicked, offers to save the generated Ontology to local file system </listitem>
<listitem><emphasis>Click on the &quot;Cancel&quot; button</emphasis> to return to the initial Linked Data View Generation form.</listitem>
</itemizedlist></listitem>
</orderedlist><ulink url="">
<para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Manual Linked Data Generation &amp; Deployment using the Conductor&#39;s HTML-based wizard</bridgehead>
<orderedlist spacing="compact"><listitem>Go to http://&lt;cname&gt;:port/conductor </listitem>
<listitem>Log in as user <emphasis>dba</emphasis> (or another user with DBA privileges) </listitem>
<listitem>Follow menu path <emphasis>Linked Data</emphasis> -&gt; <emphasis>Views</emphasis> (in previous versions, this path was <emphasis>Database</emphasis> -&gt; <emphasis>Linked Data Views</emphasis>) <figure><graphic fileref="VirtRdb2RDFViewsGeneration/rd1.png" /></figure> </listitem>
<listitem>In the form presented, perform the following steps: <figure><graphic fileref="VirtRdb2RDFViewsGeneration/rd2.png" /></figure> <orderedlist spacing="compact"><listitem>Select the <emphasis>Database Name Qualifier</emphasis> (e.g., &quot;Demo&quot;)  that exposes the Tables / Views for this exercise </listitem>
<listitem>Enter the <emphasis>Base URL</emphasis> to which your URL rewrite rules will be bound (e.g., http://&lt;cname&gt;:8890/Demo) </listitem>
<listitem>Select the specific Tables containing the data to be published (e.g., <emphasis>Demo.demo.Shippers</emphasis> and <emphasis>Demo.demo.Suppliers</emphasis>) </listitem>
<listitem>Click the <emphasis>Generate via Wizard</emphasis> button </listitem>
</orderedlist></listitem>
<listitem>At this point, you are presented with the option to edit your column selection.
 Select the &quot;Edit&quot; link, for example, for table Demo.demo.Shippers.
<figure><graphic fileref="VirtRdb2RDFViewsGeneration/rd3.png" /></figure> </listitem>
<listitem>For images or other binary data in MIME formats to be revealed as anything other than generic &quot;binary objects&quot;, you must map large varbinary types to the appropriate MIME types like image/gif.
 To do so, select the <emphasis>Edit</emphasis> link for <emphasis>Binding/MIME Type</emphasis> of the relevant table columns.
 You can: <itemizedlist mark="bullet" spacing="compact"><listitem>Leave the <emphasis>Binding/MIME Type</emphasis> literal; or </listitem>
<listitem>Set to skip, such that the column will not be used in RDF generation; or </listitem>
<listitem>Select the <emphasis>binary object</emphasis> value in order for the column to be referenced as binary.
<figure><graphic fileref="VirtRdb2RDFViewsGeneration/rd14.png" /></figure> </listitem>
</itemizedlist></listitem>
<listitem>After finishing with your changes click the <emphasis>Save</emphasis> button, or cancel the changes and go back by clicking the <emphasis>Cancel</emphasis> button.
</listitem>
<listitem>Make sure you click the &quot;Next&quot; button.
</listitem>
<listitem>At this point, the <emphasis>Linked Data View Definition</emphasis> form will let you <emphasis>Select Generation Targets</emphasis> options: <figure><graphic fileref="VirtRdb2RDFViewsGeneration/rd15.png" /></figure> <itemizedlist mark="bullet" spacing="compact"><listitem>Data Source Ontology Mappings </listitem>
<listitem>Instance Data View Mappings </listitem>
<listitem><ulink url="http://www.w3.org/TR/void/">VoID</ulink> statistic </listitem>
</itemizedlist></listitem>
<listitem>Make sure you click the &quot;Next&quot; button.
</listitem>
<listitem>Based on your selections in the prior form, the <emphasis>Linked Data View Definition</emphasis> <emphasis>Deployment Options</emphasis> form will be offered: <itemizedlist mark="bullet" spacing="compact"><listitem>Data Source Ontology Rules </listitem>
<listitem>Instance Data Rules <figure><graphic fileref="VirtRdb2RDFViewsGeneration/rd4.png" /></figure> </listitem>
</itemizedlist></listitem>
<listitem>Select the desired option(s) and click the &quot;Prepare to Execute&quot; button which unveils a generated Instance Data and/or Ontology form.
<figure><graphic fileref="VirtRdb2RDFViewsGeneration/rd5.png" /></figure> </listitem>
<listitem>Click the <emphasis>Execute</emphasis> button and Virtuoso will: <orderedlist spacing="compact"><listitem>Apply the generated declarations (instance data and ontology) to your Virtuoso instance </listitem>
<listitem>Publish / Deploy declarations that expose the Wizard-generated Rewrite Rules and associated endpoints.
<figure><graphic fileref="VirtRdb2RDFViewsGeneration/rd6.png" /></figure> </listitem>
</orderedlist></listitem>
<listitem>Optionally, you can also perform one of the following tasks: <orderedlist spacing="compact"><listitem><emphasis>Save Data Mappings</emphasis>: when clicked, offers to save the generated Definitions to local file system </listitem>
<listitem><emphasis>Save Ontology Mappings</emphasis>: when clicked, offers to save the generated Ontology to local file system </listitem>
<listitem><emphasis>Export as <ulink url="WebDAV">WebDAV</ulink> resource</emphasis>: exports the selected objects/items as a <ulink url="WebDAV">WebDAV</ulink> resource: <orderedlist spacing="compact"><listitem>Click <emphasis>Browse</emphasis> </listitem>
<listitem>Enter a <ulink url="WebDAV">WebDAV</ulink> resource and click the <emphasis>Select</emphasis> button.
<figure><graphic fileref="VirtRdb2RDFViewsGeneration/rd7.png" /></figure> Note, the <ulink url="WebDAV">WebDAV</ulink> resource path value will be shown in the <ulink url="WebDAV">WebDAV</ulink> location field.
</listitem>
<listitem>Then click the &quot;Save Data Mappings&quot; or &quot;Save Ontology Mappings&quot; button, to complete the option task of saving your generated (or edited) view declarations.
<figure><graphic fileref="VirtRdb2RDFViewsGeneration/rd8.png" /></figure> </listitem>
</orderedlist></listitem>
</orderedlist></listitem>
<listitem>Error messages will be presented if the Wizard encounters problems.
 If there are no error messages, your RDF view declarations and Linked Data publishing activities will have completed successfully.
<figure><graphic fileref="VirtRdb2RDFViewsGeneration/rd9.png" /></figure> </listitem>
<listitem>Click on <emphasis>Cancel</emphasis> to return to the initial Linked Data View Generation form.</listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Creating Linked Data Views over Remote Data Sources <emphasis>(Virtuoso Commercial Edition only!)</emphasis></bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtDB2RDFViewUI">Creating Linked Data Views over DB2 Databases</ulink> </listitem>
<listitem><ulink url="VirtInfRDFViewUI">Creating Linked Data Views over Informix Databases</ulink> </listitem>
<listitem><ulink url="VirtIngRDFViewUI">Creating Linked Data Views over Ingres Databases</ulink> </listitem>
<listitem><ulink url="VirtJdbcRDFViewUI">Creating Linked Data Views over JDBC Data Sources</ulink> </listitem>
<listitem><ulink url="VirtMSSQLRDFViewUI">Creating Linked Data Views over Microsoft SQL Server Databases</ulink> </listitem>
<listitem><ulink url="VirtMysRDFViewUI">Creating Linked Data Views over MySQL Databases</ulink> </listitem>
<listitem><ulink url="VirtOdbcRDFViewUI">Creating Linked Data Views over ODBC Data Sources</ulink> </listitem>
<listitem><ulink url="VirtOraRDFViewUI">Creating Linked Data Views over Oracle Databases</ulink> </listitem>
<listitem><ulink url="VirtPgrRDFViewUI">Creating Linked Data Views over PostgreSQL Databases</ulink> </listitem>
<listitem><ulink url="VirtProgressRDFViewUI">Creating Linked Data Views over Progress Databases</ulink> </listitem>
<listitem><ulink url="VirtSybRDFViewUI">Creating Linked Data Views over Sybase Databases</ulink></listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Related</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VOSSQL2RDF">Mapping SQL Data to RDF</ulink> </listitem>
</itemizedlist></ulink></ulink></section></docbook>