<docbook><section><title>VirtSesame2HttpRepository</title><title>Virtuoso RDF4J and Sesame HTTP Repository Configuration and Usage</title>Virtuoso RDF4J and Sesame HTTP Repository Configuration and Usage
<bridgehead class="http://www.w3.org/1999/xhtml:h2">What</bridgehead>
<para>Eclipse RDF4J (<ulink url="http://rdf4j.org/2016/05/18/goodbye-sesame-hello-rdf4j/">formerly known as OpenRDF Sesame</ulink>) is an open source Java framework for storing, querying and reasoning with RDF and RDF Schema.
 It can be used as a database for RDF and RDF Schema, or as a Java library for applications that need to work with RDF internally.
 The RDF4J HTTP  and Console repositories serves as a proxy for a RDF store hosted on a remote RDF4J server, enabling the querying of the RDF store using the RDF4J HTTP protocol.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2">Why</bridgehead>
<para>The RDF4J HTTP repository endpoint provides users with the greater flexibility for manipulating the RDF store via a common interface.
 RDF4J provides you with the necessary tools to parse, interpret, query and store all this information, embedded in your own application if you want, or, if you prefer, in a separate database or even on a remote server.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2">How</bridgehead>
<para>To create a new RDF4J HTTP repository, the Console needs to create such an RDF document and submit it to the SYSTEM repository.
 The Console uses so called repository configuration templates to accomplish this.
 Repository configuration templates are simple Turtle RDF files that describe a repository configuration, where some of the parameters are replaced with variables.
 The Console parses these templates and asks the user to supply values for the variables.
 The variables are then substituted with the specified values, which produces the required configuration data.
 Refer to the <ulink url="http://docs.rdf4j.org/server-workbench-console/">RDF4J Server, Workbench, and Console</ulink> documentation for more details on it usage.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2">Setup and Testing</bridgehead>
<para>This section details the steps required for configuring and testing a Virtuoso RDF4J or Sesame Repository, both using the HTTP  and Console RDF4J or Sesame repositories.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3">Requirements</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://rdf4j.org/download/">RDF4J 2.x SDK</ulink> or <ulink url="http://www.openrdf.org/download.jsp">Sesame 2.3.1</ulink> or higher </listitem>
<listitem><ulink url="https://download3.openlinksw.com/uda/virtuoso/rdfproviders/rdf4j/2/virt_rdf4j.jar">RDF4J 2.x</ulink> (virt_rdf4j.jar), <ulink url="VOSDownload/virt_sesame2.jar">Virtuoso Sesame 2.x </ulink> (virt_sesame2.jar) or  <ulink url="http://download3.openlinksw.com/uda/virtuoso/rdfproviders/sesame/40/virt_sesame4.jar">Virtuoso Sesame 4.x</ulink> (virt_sesame4.jar) Provider </listitem>
<listitem><ulink url="https://download3.openlinksw.com/uda/virtuoso/jdbc/virtjdbc4_2.jar">Virtuoso JDBC Driver for Java 8</ulink> (virtjdbc4_2.jar) or <ulink url="VOSDownload/virtjdbc4.jar">Virtuoso JDBC Driver for earlier Java versions</ulink> (virtjdbc4.jar) </listitem>
<listitem>Virtuoso System Repository config file for <ulink url="https://download3.openlinksw.com/uda/virtuoso/rdfproviders/rdf4j/2/create.xsl">RDF4J 2.x</ulink> or <ulink url="VirtSesame2HttpRepository/create.xsl">Sesame 2.x</ulink> or <ulink url="http://download3.openlinksw.com/uda/virtuoso/rdfproviders/sesame/40/create.xsl">Sesame 4.x</ulink> (create.xsl) </listitem>
<listitem>Virtuoso Repository config file for <ulink url="https://download3.openlinksw.com/uda/virtuoso/rdfproviders/rdf4j/2/create-virtuoso.xsl">RDF4J 2.x</ulink> or <ulink url="VirtSesame2HttpRepository/create-virtuoso.xsl">Sesame 2.x </ulink> or <ulink url="http://download3.openlinksw.com/uda/virtuoso/rdfproviders/sesame/40/create-virtuoso.xsl">Sesame 4.x</ulink> (create-virtuoso.xsl) </listitem>
<listitem>Configuration Template file for a Virtuoso Repository for <ulink url="https://download3.openlinksw.com/uda/virtuoso/rdfproviders/rdf4j/2/virtuoso.ttl">RDF4J 2.x</ulink> or <ulink url="VirtSesame2HttpRepository/virtuoso.ttl">Sesame 2.x </ulink> or <ulink url="http://download3.openlinksw.com/uda/virtuoso/rdfproviders/sesame/40/virtuoso.ttl">Sesame 4.x</ulink>  (virtuoso.ttl) </listitem>
<listitem><ulink url="http://tomcat.apache.org/download-60.cgi">Apache Tomcat</ulink> version 5 or higher</listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3">Setup RDF4J or Sesame HTTP Repository</bridgehead>
<para>This section details the steps required for configuring and testing a Virtuoso HTTP RDF4J or  Sesame Repository.</para>
<orderedlist spacing="compact"><listitem>Install <ulink url="http://tomcat.apache.org/tomcat-6.0-doc/index.html">Apache Tomcat</ulink> web server </listitem>
<listitem>If using RDF4J: <itemizedlist mark="bullet" spacing="compact"><listitem>From the RDF4J 2.x SDK  &quot;lib&quot; directory copy the &quot;rdf4j-server.war&quot; and &quot;rdf4j-workbench.war&quot; files to the tomcat &quot;webapps&quot; directory where they will automatically be deployed creating two new sub directories &quot;rdf4j-server&quot; and &quot;rdf4j-workbench&quot;.
</listitem>
<listitem>Place the corresponding Virtuoso RDF4J 2.x Provider &quot;virt_rdf4j.jar&quot; and JDBC Driver &quot;virtjdbc4_2.jar&quot; into the Tomcat ~/webapps/rdf4j-server/WEB-INF/lib/ and  ~/webapps/rdf4j-workbench/WEB-INF/lib/ directories for use by the RDF4J HTTP Repository for accessing the Virtuoso RDF repository.
</listitem>
<listitem>Place the &quot;create.xsl&quot; and &quot;create-virtuoso.xsl&quot; files in the Tomcat ~/webapps/rdf4j-workbench/transformations/ directory.
 Note &quot;create.xsl&quot; replaces the default provided with RDF4J and contains the necessary entries required to reference the new &quot;create-virtuoso.xsl&quot; template file for Virtuoso repository configuration.
</listitem>
<listitem>The RDF4J HTTP Repository will now be accessible on the URLs <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://localhost:8080/rdf4j-server">http://localhost:8080/rdf4j-server</ulink>           <figure><graphic fileref="VirtSesame2HttpRepository/VirtRDF4JHttpRepository01.png" /></figure>  </listitem>
<listitem><ulink url="http://localhost:8080/rdf4j-workbench">http://localhost:8080/rdf4j-workbench</ulink>           <figure><graphic fileref="VirtSesame2HttpRepository/VirtRDF4JHttpRepository02.png" /></figure>  </listitem>
</itemizedlist></listitem>
</itemizedlist></listitem>
<listitem>If using Sesame: <itemizedlist mark="bullet" spacing="compact"><listitem>From Sesame 2.3.1 or higher  &quot;lib&quot; directory copy the &quot;openrdf-sesame.war&quot; and &quot;openrdf-workbench.war&quot; files to the tomcat &quot;webapps&quot; directory where they will automatically be deployed creating two new sub directories &quot;openrdf-sesame&quot; and &quot;openrdf-workbench&quot;.
</listitem>
<listitem>Place the corresponding Virtuoso Sesame Provider &quot;virt_sesame2.jar&quot; or &quot;virt_sesame4.jar&quot; and JDBC Driver &quot;virtjdbc4.jar&quot; into the Tomcat ~/webapps/openrdf-sesame/WEB-INF/lib/ and  ~/webapps/openrdf-workbench/WEB-INF/lib/ directories for use by the Sesame HTTP Repository for accessing the Virtuoso RDF repository.
</listitem>
<listitem>Place the &quot;create.xsl&quot; and &quot;create-virtuoso.xsl&quot; files in the Tomcat ~/webapps/openrdf-workbench/transformations/ directory.
 Note &quot;create.xsl&quot; replaces the default provided with Sesame and contains the necessary entries required to reference the new &quot;create-virtuoso.xsl&quot; template file for Virtuoso repository configuration.
</listitem>
<listitem>The Sesame HTTP Repository will now be accessible on the URLs <programlisting>http://localhost:8080/openrdf-sesame
http://localhost:8080/openrdf-workbench
</programlisting></listitem>
</itemizedlist></listitem>
<listitem>The Eclipse RDF4J or Sesame OpenRDF Workbench is used for accessing the RDF4J or Sesame HTTP Repositories, loading &quot;<ulink url="http://localhost:8080/openrdf-workbench">http://localhost:8080/openrdf-workbench</ulink>&quot; will enable the default &quot;SYSTEM&quot; repository to be accessed.
<itemizedlist mark="bullet" spacing="compact"><listitem>RDF4J  <figure><graphic fileref="VirtSesame2HttpRepository/VirtRDF4JHttpRepository02.png" /></figure>  </listitem>
<listitem>Sesame  <figure><graphic fileref="VirtSesame2HttpRepository/VirtSesame2HttpRepository02.png" /></figure>  </listitem>
</itemizedlist></listitem>
<listitem>Click on the &quot;New Repository&quot; link in the left frame to create a new RDF4J or Sesame Repository.
<itemizedlist mark="bullet" spacing="compact"><listitem>RDF4J  <figure><graphic fileref="VirtSesame2HttpRepository/VirtRDF4JHttpRepository03.png" /></figure>  </listitem>
<listitem>Sesame  <figure><graphic fileref="VirtSesame2HttpRepository/VirtSesame2HttpRepository03.png" /></figure>  </listitem>
</itemizedlist></listitem>
<listitem>Select the &quot;Virtuoso RDF Store&quot; from the &quot;Type&quot; drop down list box presented.
<itemizedlist mark="bullet" spacing="compact"><listitem>RDF4J  <figure><graphic fileref="VirtSesame2HttpRepository/VirtRDF4JHttpRepository04.png" /></figure>  </listitem>
<listitem>Sesame  <figure><graphic fileref="VirtSesame2HttpRepository/VirtSesame2HttpRepository04.png" /></figure>  </listitem>
</itemizedlist></listitem>
<listitem>Choose suitable repository &quot;ID&quot; and &quot;Title&quot; for the Virtuoso repository to be created and click &quot;Next&quot;.
<itemizedlist mark="bullet" spacing="compact"><listitem>RDF4J  <figure><graphic fileref="VirtSesame2HttpRepository/VirtRDF4JHttpRepository05.png" /></figure>  </listitem>
<listitem>Sesame  <figure><graphic fileref="VirtSesame2HttpRepository/VirtSesame2HttpRepository05.png" /></figure>  </listitem>
</itemizedlist></listitem>
<listitem>Fill in the connection parameters for the target Virtuoso sever the repository is to be created for and click the &quot;create&quot; button.
 The minimum required are the hostname, port number, username and password of the Virtuoso Server.
<itemizedlist mark="bullet" spacing="compact"><listitem>RDF4J  <figure><graphic fileref="VirtSesame2HttpRepository/VirtRDF4JHttpRepository06.png" /></figure>  </listitem>
<listitem>Sesame  <figure><graphic fileref="VirtSesame2HttpRepository/VirtSesame2HttpRepository06.png" /></figure>  </listitem>
</itemizedlist></listitem>
<listitem>The new Virtuoso respository will be created and its summary page displayed.
<itemizedlist mark="bullet" spacing="compact"><listitem>RDF4J  <figure><graphic fileref="VirtSesame2HttpRepository/VirtRDF4JHttpRepository07.png" /></figure>  </listitem>
<listitem>Sesame  <figure><graphic fileref="VirtSesame2HttpRepository/VirtSesame2HttpRepository07.png" /></figure>  </listitem>
</itemizedlist></listitem>
<listitem>Click on the &quot;Namespaces&quot; link in the left frame to obtain a list of the available namespaces in the Virtuoso repository.
<itemizedlist mark="bullet" spacing="compact"><listitem>RDF4J  <figure><graphic fileref="VirtSesame2HttpRepository/VirtRDF4JHttpRepository08.png" /></figure>  </listitem>
<listitem>Sesame  <figure><graphic fileref="VirtSesame2HttpRepository/VirtSesame2HttpRepository08.png" /></figure>  </listitem>
</itemizedlist></listitem>
<listitem>Click on the &quot;Context&quot; link in the left frame to obtain a list of the available contexts in the Virtuoso repository.
<itemizedlist mark="bullet" spacing="compact"><listitem>RDF4J  <figure><graphic fileref="VirtSesame2HttpRepository/VirtRDF4JHttpRepository09.png" /></figure>  </listitem>
<listitem>Sesame  <figure><graphic fileref="VirtSesame2HttpRepository/VirtSesame2HttpRepository09.png" /></figure>  </listitem>
</itemizedlist></listitem>
<listitem>Click on the &quot;Types&quot; link in the left frame to obtain a list of the available types in the Virtuoso repository.
<itemizedlist mark="bullet" spacing="compact"><listitem>RDF4J  <figure><graphic fileref="VirtSesame2HttpRepository/VirtRDF4JHttpRepository10.png" /></figure>  </listitem>
<listitem>Sesame  <figure><graphic fileref="VirtSesame2HttpRepository/VirtSesame2HttpRepository10.png" /></figure>  </listitem>
</itemizedlist></listitem>
<listitem>Click on the &quot;Query&quot; link in the left frame, enter a suitable SPARQL query to execute against the Virtuoso repository and click the &quot;execute&quot; button.
<itemizedlist mark="bullet" spacing="compact"><listitem>RDF4J  <figure><graphic fileref="VirtSesame2HttpRepository/VirtRDF4JHttpRepository11.png" /></figure>  </listitem>
<listitem>Sesame   <figure><graphic fileref="VirtSesame2HttpRepository/VirtSesame2HttpRepository11.png" /></figure>  </listitem>
</itemizedlist></listitem>
<listitem>The results of the SPARQL query are returned.
<itemizedlist mark="bullet" spacing="compact"><listitem>RDF4J  <figure><graphic fileref="VirtSesame2HttpRepository/VirtRDF4JHttpRepository12.png" /></figure>  </listitem>
<listitem>Sesame  <figure><graphic fileref="VirtSesame2HttpRepository/VirtSesame2HttpRepository12.png" /></figure>  </listitem>
</itemizedlist></listitem>
<listitem>Click on the &quot;SPARQL Update&quot; link in the left where SPARQL update queries can be executed against the Virtuoso repository and click the &quot;execute&quot; button.
<itemizedlist mark="bullet" spacing="compact"><listitem>RDF4J  <figure><graphic fileref="VirtSesame2HttpRepository/VirtRDF4JHttpRepository13.png" /></figure>  </listitem>
</itemizedlist></listitem>
<listitem>Click on the &quot;Repositories&quot; link in the left frame and the newly created Virtuoso repository entry is displayed along side the default SYSTEM repository.
<itemizedlist mark="bullet" spacing="compact"><listitem>RDF4J  <figure><graphic fileref="VirtSesame2HttpRepository/VirtRDF4JHttpRepository14.png" /></figure>  </listitem>
<listitem>Sesame  <figure><graphic fileref="VirtSesame2HttpRepository/VirtSesame2HttpRepository13.png" /></figure> </listitem>
</itemizedlist></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3">Setup RDF4J or Sesame Console Repository</bridgehead>
<para>This section details the steps required for configuring and testing a Virtuoso RDF4J Console Repository</para>
<orderedlist spacing="compact"><listitem>Extract RDF4J  2.x SDK or Sesame 2.3.1 or higher archive to a location of choice and place the virt_rdf4j.jar, virt_sesame2.jar or virt_sesame4.jar and virtjdbc4.jar files to the sesame &quot;lib&quot; directory </listitem>
<listitem>Start the <ulink url="http://docs.rdf4j.org/server-workbench-console/#_rdf4j_console">RDF4J</ulink> or  <ulink url="http://www.openrdf.org/doc/sesame2/users/ch07.html#section-console-repository-creation">Sesame</ulink> console application by running the &quot;console.bat&quot; script in the sesame &quot;bin&quot; directory and then &quot;exit.&quot; the program <programlisting>$ sh console.sh 
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/myuser/openrdf-sesame-2.3.1/lib/logback-classic-0.9.18.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/myuser/openrdf-sesame-2.3.1/lib/slf4j-jdk14-1.5.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
10:32:38.317 [main] DEBUG info.aduna.platform.PlatformFactory - os.name &lt;http://os.name&gt; &lt;http://os.name&gt; = mac os x
10:32:38.351 [main] DEBUG info.aduna.platform.PlatformFactory - Detected Mac OS X platform
Connected to default data directory
Commands end with &#39;.&#39; at the end of a line
Type &#39;help.&#39; for help
exit.
</programlisting></listitem>
<listitem>This will create the necessary sesame application data directories as detailed in the <ulink url="http://docs.rdf4j.org/server-workbench-console/">RDF4J</ulink> or Sesame <ulink url="http://www.openrdf.org/doc/sesame2/2.3.1/users/userguide.html#chapter-datadir-config">data directory configuration</ulink> documentation.
<programlisting>Windows - C:\Documents and Settings\LocalService\Application Data\Aduna\
Mac OS X - /Users/myuser/Library/Application Support/Aduna/
Linux - $HOME/.aduna/
</programlisting></listitem>
<listitem>If you do not want to use the default sesame data directory location the RDF4J or Sesame console application can be started by specifying a custom data directory location with the &quot;-d&quot; option.
 Note in this case the directory &quot;OpenRDF Sesame console&quot; always has to be manually appended to the directory as RDF4J/Sesame assumes the data file will reside in a sub directory of this name.
<programlisting>$ sh console.sh -d /Users/myuser/OpenRDF Sesame console
</programlisting></listitem>
<listitem>Add the virtuoso.ttl file to the ~/OpenRDF Sesame console/templates folder, to enable the Virtuoso repository default configuration parameters to be located.
</listitem>
<listitem>Start the sesame console application with the required data directory location and create a Virtuoso repository as detailed in the steps below, the key parameters to be specified being the target Virtuoso server hostname, port number, username, password and a unique &quot;Repository ID&quot;.
<programlisting>$ sh console.sh 
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/myuser/openrdf-sesame-2.3.1/lib/logback-classic-0.9.18.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/myuser/openrdf-sesame-2.3.1/lib/slf4j-jdk14-1.5.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
10:32:38.317 [main] DEBUG info.aduna.platform.PlatformFactory - os.name &lt;http://os.name&gt; &lt;http://os.name&gt; = mac os x
10:32:38.351 [main] DEBUG info.aduna.platform.PlatformFactory - Detected Mac OS X platform
Connected to default data directory
Commands end with &#39;.&#39; at the end of a line
Type &#39;help.&#39; for help
create virtuoso .
Please specify values for the following variables:
Host list [localhost:1111]: 
Username [dba]: 
Password [dba]: 
Default graph name [sesame:nil]: 
Enable using batch optimization (false|true) [false]: 
Use RoundRobin for connection (false|true) [false]: 
Buffer fetch size [200]: 
Inference RuleSet name [null]: 
Repository ID [virtuoso]: myvirt
Repository title [Virtuoso repository]: 
Repository created
show r .
+----------
|SYSTEM
|myvirt (&quot;Virtuoso repository&quot;)
+----------
open myvirt .
Opened repository &#39;myvirt&#39;
myvirt&gt; show n .
+----------
|bif  bif:
|dawgt  http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#
|dbpedia  http://dbpedia.org/resource/
|dbpprop  http://dbpedia.org/property/
|dc  http://purl.org/dc/elements/1.1/
|foaf  http://xmlns.com/foaf/0.1/
|geo  http://www.w3.org/2003/01/geo/wgs84_pos#
|go  http://purl.org/obo/owl/GO#
|math  http://www.w3.org/2000/10/swap/math#
|mesh  http://purl.org/commons/record/mesh/
|mf  http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#
|nci  http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#
|obo  http://www.geneontology.org/formats/oboInOwl#
|owl  http://www.w3.org/2002/07/owl#
|protseq  http://purl.org/science/protein/bysequence/
|rdf  http://www.w3.org/1999/02/22-rdf-syntax-ns#
|rdfdf  http://www.openlinksw.com/virtrdf-data-formats#
|rdfs  http://www.w3.org/2000/01/rdf-schema#
|sc  http://purl.org/science/owl/sciencecommons/
|scovo  http://purl.org/NET/scovo#
|skos  http://www.w3.org/2004/02/skos/core#
|sql  sql:
|vcard  http://www.w3.org/2001/vcard-rdf/3.0#
|virtrdf  http://www.openlinksw.com/schemas/virtrdf#
|void  http://rdfs.org/ns/void#
|xf  http://www.w3.org/2004/07/xpath-functions
|xml  http://www.w3.org/XML/1998/namespace
|xsd  http://www.w3.org/2001/XMLSchema#
|xsl10  http://www.w3.org/XSL/Transform/1.0
|xsl1999  http://www.w3.org/1999/XSL/Transform
|xslwd  http://www.w3.org/TR/WD-xsl
|yago  http://dbpedia.org/class/yago/
+----------
exit.
</programlisting> </listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3">Connection to RDF4J or Sesame HTTP repository from Console repository</bridgehead>
<para>The RDF4J or Sesame Console repository can connect to a RDF4J or Sesame HTTP repository and vice-versa, enabling access to remote RDF4J or Sesame HTTP repositories from a local server.</para>
<orderedlist spacing="compact"><listitem>The RDF4J or Sesame Console repository can connect to a RDF4J or Sesame HTTP repository and query it as if local using the &quot;connect&quot; command.
<programlisting>$ sh console.sh
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/myuser/openrdf-sesame-2.3.1/lib/logback-classic-0.9.18.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/myuser/openrdf-sesame-2.3.1/lib/slf4j-jdk14-1.5.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
10:32:38.317 [main] DEBUG info.aduna.platform.PlatformFactory - os.name &lt;http://os.name&gt; &lt;http://os.name&gt; = mac os x
10:32:38.351 [main] DEBUG info.aduna.platform.PlatformFactory - Detected Mac OS X platform
Connected to default data directory
Commands end with &#39;.&#39; at the end of a line
Type &#39;help.&#39; for help
&gt; connect http://localhost:8080/openrdf-sesame.
Connected to http://localhost:8080/openrdf-sesame
&gt; show r.
+----------
|SYSTEM (&quot;System configuration repository&quot;)
|VirtSesRep (&quot;Virtuoso Sesame HTTP Repository&quot;)
+----------
&gt; open VirtSesRep.
Opened repository &#39;VirtSesRep&#39;
VirtSesRep&gt; sparql select * from &lt;http://localhost:8890/Northwind&gt; where {?s ?p ?o} Limit 10.
Evaluating query...
+------------------------+------------------------+------------------------+
| s                      | p                      | o                      |
+------------------------+------------------------+------------------------+
| &lt;http://localhost:8890/Northwind/CustomerContact/ALFKI#this&gt;| rdf:type  | foaf:Person            |
| &lt;http://localhost:8890/Northwind/CustomerContact/ALFKI#this&gt;| rdf:type  | northwind:CustomerContact|
| &lt;http://localhost:8890/Northwind/CustomerContact/ALFKI#this&gt;| opl:isDescribedUsing   | northwind:             |
| &lt;http://localhost:8890/Northwind/CustomerContact/ANATR#this&gt;| rdf:type | foaf:Person            |
| &lt;http://localhost:8890/Northwind/CustomerContact/ANATR#this&gt;| rdf:type | northwind:CustomerContact|
| &lt;http://localhost:8890/Northwind/CustomerContact/ANATR#this&gt;| opl:isDescribedUsing   | northwind:             |
| &lt;http://localhost:8890/Northwind/CustomerContact/ANTON#this&gt;| rdf:type  | foaf:Person            |
| &lt;http://localhost:8890/Northwind/CustomerContact/ANTON#this&gt;| rdf:type  | northwind:CustomerContact|
| &lt;http://localhost:8890/Northwind/CustomerContact/ANTON#this&gt;| opl:isDescribedUsing   | northwind:             |
| &lt;http://localhost:8890/Northwind/CustomerContact/AROUT#this&gt;| rdf:type  | foaf:Person            |
+------------------------+------------------------+------------------------+
10 result(s) (530 ms)
VirtSesRep&gt; show n.
+----------
|SearchResults  http://www.zillow.com/static/xsd/SearchResults.xsd
|UpdatedPropertyDetails  http://www.zillow.com/static/xsd/UpdatedPropertyDetails.xsd
|a  http://www.w3.org/2005/Atom
|aapi  http://rdf.alchemyapi.com/rdf/v1/s/aapi-schema#
|address  http://schemas.talis.com/2005/address/schema#
|admin  http://webns.net/mvcb/
|amz  http://webservices.amazon.com/AWSECommerceService/2005-10-05
|atom  http://atomowl.org/ontologies/atomrdf#
|audio  http://purl.org/media/audio#
|awol  http://bblfish.net/work/atom-owl/2006-06-06/#
|aws  http://soap.amazon.com/
|b3s  http://b3s.openlinksw.com/
</programlisting></listitem>
<listitem>Conversely the RDF4J or Sesame HTTP repository can be configured to access the repository created by the RDF4J or Sesame console.
 To do this the location of the data directory for both needs to be reconfigured using the Java system property info.aduna.platform.appdata.basedir  (does not include RDF4J or Sesame console directory) to point to the same location.
 When you are using Tomcat as the servlet container then you can set this property using the JAVA_OPTS parameter.
 Note, if you are using Apache Tomcat as a Windows Service you should use the Windows Services configuration tool to set this property.
 Other users can either edit the Tomcat startup script or set the property some other way.
<programlisting>    * set JAVA_OPTS=-Dinfo.aduna.platform.appdata.basedir=\path\to\other\dir\ (on Windows)
    * export JAVA_OPTS=&#39;-Dinfo.aduna.platform.appdata.basedir=/path/to/other/dir/&#39; (on Linux/UNIX/Mac OS X) 
</programlisting><figure><graphic fileref="VirtSesame2HttpRepository/VirtSesame2HttpRepository01.png" /></figure> </listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3"> Remote RDF4J or Sesame HTTP Repository Connections</bridgehead>
<para>There are two methods of making a remote RDF4J or Sesame HTTP connection to a Virtuoso repository:</para>
<itemizedlist mark="bullet" spacing="compact"><listitem><emphasis>RDF4J or Sesame Remote Repository Manager</emphasis> class - A manager for Repositories that reside on a remote server, allowing one to access repositories over HTTP similar to how local repositories are accessed using the <ulink url="LocalRepositoryManager">LocalRepositoryManager</ulink>.
 A connection via this method is made via the Virtuoso RDF4J or Sesame provider which will be faster and provide better support for transactions, than making a direct connection to the SPARQL endpoint using the HTTP Repository class.
 This is analogous to the ODBC Driver Manager in the ODBC realm for generic access to a data store via a suitable ODBC Driver.</listitem>
</itemizedlist><itemizedlist mark="bullet" spacing="compact"><listitem><emphasis>RDF4J or Sesame HTTP Repository</emphasis> class - A repository that serves as a proxy for a remote repository on a RDF4J or Sesame server or directly to a SPARQL endpoint.
 This method does not make use of the Virtuoso RDF4J or Sesame Provider, using instead the HTTP protocol to make requests directly RDF4J or Sesame server or  other SPARQL endpoint.</listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h4"> Using the RDF4J or Sesame Remote Repository Manager class</bridgehead>
<para>If a RDF4J or Sesame HTTP Repository endpoint, as detailed above already exists, the <ulink url="http://docs.rdf4j.org/server-workbench-console/#_http_repository_configuration">Remote Repository Manager class</ulink> can be used to make a remote connection as follows by specify the URL to the remote RDF4J or Sesame HTTP Server and the RepositoryID for the repository the connection is to be made to:</para>
<programlisting>
//Initialize Remote Repository Manager 
RepositoryManager repositoryManager = new RemoteRepositoryManager( &quot;http://hostname:portno/openrdf-sesame&quot; );
repositoryManager.initialize();

//Set Virtuoso (or any other) repositoryID on http://hostname:portno/openrdf-sesame
Repository repository = repositoryManager.getRepository(&quot;RepositoryID&quot;); 

// Open a connection to this repository
con = repository.getConnection();

// ... do something 
</programlisting><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> Using the RDF4J or Sesame HTTP Repository class</bridgehead>
<para>A direct connection to the default built-in Virtuoso SPARQL Endpoint can be made using the <ulink url="http://docs.rdf4j.org/server-workbench-console/#_rdf4j_console">RDF4J or Sesame HTTP Repository class</ulink> by simply specifying the URL to the Virtuoso SPARQL Endpoint i.e.
 http://{host}:{port}/sparql as follows:</para>
<programlisting>// Initialize Direct SPARQL Endpoint HTTP Repository connection
String endpointURL = &quot;http://hostname:portno/sparql&quot;;
HTTPRepository sparqlEndpoint = new HTTPRepository(endpointURL, &quot;&quot;);
sparqlEndpoint.initialize();

// Open a connection to this repository
con = sparqlEndpoint.getConnection(); 

// ... do something 
</programlisting><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2">Related</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtSesame2Provider">Virtuoso RDF4J and Sesame Provider</ulink> </listitem>
</itemizedlist></section></docbook>