<docbook><section><title>VirtBulkRDFLoaderExampleDbpedia</title><para> </para>
<title> Virtuoso Bulk Load Example: DBpedia data sets</title> Virtuoso Bulk Load Example: DBpedia data sets
<para>The following example demonstrates how to upload the DBpedia data sets into Virtuoso using the Bulk Loading Sequence.</para>
<orderedlist spacing="compact"><listitem>Assuming there is a folder named &quot;tmp&quot; in your filesystem, and it is within a directory specified in the <emphasis><ulink url="http://docs.openlinksw.com/virtuoso/databaseadmsrv.html#fp_acliniallowed">DirsAllowed</ulink></emphasis> param defined in your virtuoso.ini file.
</listitem>
<listitem>Load the required DBpedia data sets into the &quot;tmp&quot; folder <itemizedlist mark="bullet" spacing="compact"><listitem>The latest data sets can be downloaded from the <ulink url="http://wiki.dbpedia.org/Downloads">DBpedia Download</ulink> page.
 Note the compressed bzip&#39;ed &quot;.bz2&quot; data set files need to be uncompressed first as the bulk loader scripts only supports the auto extraction of gzip&#39;ed &quot;.gz&quot; files.
</listitem>
</itemizedlist></listitem>
<listitem>If it hasn&#39;t already been, execute the <ulink url="VirtBulkRDFLoaderScript">Bulk Loading script</ulink>.
</listitem>
<listitem>Register the graph IRI under which the triples are to be loaded, e.g., &quot;http://dbpedia.org&quot;: <programlisting>SQL&gt; ld_dir (&#39;tmp&#39;, &#39;*.*&#39;, &#39;http://dbpedia.org&#39;);
Done. -- 90 msec.
</programlisting><itemizedlist mark="bullet" spacing="compact"><listitem>Note that while this procedure will also work with gzip&#39;ed files, it is important to keep the pattern: &lt;name&gt;.&lt;ext&gt;.gz, e.g., &#39;ontology.owl.gz&#39;  or ontology.nt.gz </listitem>
<listitem>Note that if there are other data files in your folder (tmp), then their content will also be loaded into the specified graph.
 </listitem>
</itemizedlist></listitem>
<listitem>Create a file named <emphasis>global.graph</emphasis> in the &quot;tmp&quot; folder, with its entire content being the URI of the desired target graph, e.g., <programlisting>http://dbpedia.org
</programlisting></listitem>
<listitem>Finally, execute the rdf_loader_run procedure.
 This may take some time, depending on the size of the data sets.
<programlisting>SQL&gt; rdf_loader_run ();
Done. -- 100 msec.
</programlisting></listitem>
<listitem>As a result, the Virtuoso log should contain notification that the loading has completed: <programlisting>10:21:50 PL LOG: Loader started
10:21:50 PL LOG: No more files to load. Loader has finished
</programlisting></listitem>
<listitem>Run a checkpoint to commit all transactions to the database.
<programlisting>SQL&gt; checkpoint;
Done. -- 53 msec.
</programlisting></listitem>
<listitem>To check the inserted triples for the given graph, execute a query similar to -- <programlisting>SQL&gt; SPARQL
SELECT COUNT(*) 
  FROM &lt;http://dbpedia.org&gt;
  WHERE 
    {
      ?s ?p ?o
    } ;
</programlisting></listitem>
<listitem>Install the <ulink url="https://virtuoso.openlinksw.com/download/">DBpedia</ulink> and <ulink url="https://virtuoso.openlinksw.com/download/">RDF Mappers</ulink> VAD packages, using either the Virtuoso Conductor or the following manual commands: <programlisting>SQL&gt; vad_install (&#39;dbpedia_dav.vad&#39;, 0);
SQL&gt; vad_install (&#39;rdf_mappers_dav.vad&#39;, 0);
</programlisting></listitem>
<listitem>The Virtuoso-hosted data set can now be explored using a HTML browser, or queried from the SPARQL or Faceted Browser web service endpoints.
 For example, with the DBpedia 3.5.1 data sets, a description of the resource Bob Marley can be viewed as: http://&lt;your-cname&gt;:&lt;your-port&gt;/resource/Bob_Marley   <figure><graphic fileref="VirtBulkRDFLoaderExampleDbpedia/VirtAWSPublicDataSets07.png" /></figure> </listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2">Related</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtBulkRDFLoader">Virtuoso Bulk data set loader</ulink></listitem>
</itemizedlist></section></docbook>