This HTML5 document contains 56 embedded RDF statements represented using HTML+Microdata notation.

The embedded RDF content will be recognized by any processor of HTML5 Microdata.

PrefixNamespace IRI
n22http://ods.openlinksw.com/dataspace/person/dav#
dctermshttp://purl.org/dc/terms/
n9http://ods.openlinksw.com/wiki/main/ODS/VirtJenaProvider/jenajars.
atomhttp://atomowl.org/ontologies/atomrdf#
n4http://ods.openlinksw.com/dataspace/owiki/wiki/
foafhttp://xmlns.com/foaf/0.1/
oplhttp://www.openlinksw.com/schema/attribution#
n19http://ods.openlinksw.com/dataspace/%28NULL%29/wiki/ODS/
n10http://ods.openlinksw.com/dataspace/owiki#
dchttp://purl.org/dc/elements/1.1/
rdfshttp://www.w3.org/2000/01/rdf-schema#
n15http://jena.sourceforge.net/
n21http://rdfs.org/sioc/services#
n2http://ods.openlinksw.com/dataspace/owiki/wiki/ODS/
n27http://ods.openlinksw.com/dataspace/owiki/wiki/ODS/VirtJenaProvider/sioc.
siocthttp://rdfs.org/sioc/types#
n8http://ods.openlinksw.com/dataspace/person/owiki#
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
n20http://ods.openlinksw.com/dataspace/services/wiki/
n14http://ods.openlinksw.com/wiki/main/ODS/VirtJenaProvider/virtjdbc3.
n17http://docs.openlinksw.com/jena/
n11http://docs.openlinksw.com/jena2/
xsdhhttp://www.w3.org/2001/XMLSchema#
n16http://ods.openlinksw.com/wiki/main/ODS/VirtJenaProvider/virt_jena.
n25http://ods.openlinksw.com/dataspace/dav#
n13http://ods.openlinksw.com/wiki/main/ODS/VirtJenaProvider/virt_jena_arch4.
siochttp://rdfs.org/sioc/ns#
n18http://ods.openlinksw.com/wiki/main/ODS/VirtJenaProvider/virtjenasamples.
Subject Item
n22:this
foaf:made
n2:VirtJenaProvider
Subject Item
n20:item
n21:services_of
n2:VirtJenaProvider
Subject Item
n10:this
sioc:creator_of
n2:VirtJenaProvider
Subject Item
n4:ODS
sioc:container_of
n2:VirtJenaProvider
atom:entry
n2:VirtJenaProvider
atom:contains
n2:VirtJenaProvider
Subject Item
n2:VirtJenaProvider
rdf:type
atom:Entry sioct:Comment
dcterms:created
2017-06-13T06:09:01.401640
dcterms:modified
2017-06-29T07:33:56.159512
rdfs:label
VirtJenaProvider
foaf:maker
n8:this n22:this
dc:title
VirtJenaProvider
opl:isDescribedUsing
n27:rdf
sioc:has_creator
n10:this n25:this
sioc:attachment
n9:zip n13:svg n14:jar n16:jar n13:png n18:zip
sioc:content
%META:TOPICPARENT{name="VOSRDFDataProviders"}% %VOSWARNING% %VOSNAV% ---+ Virtuoso Jena Provider %TOC% ---++ What is Jena? Jena is an open source Semantic Web framework for Java. It provides an API to extract data from and write to RDF graphs. The graphs are represented as an abstract "model". A model can be sourced with data from files, databases, URIs or a combination of these. A Model can also be queried through SPARQL and updated through SPARUL. ---++ What is the Virtuoso Jena Provider? The Virtuoso Jena RDF Data Provider is a fully operational Native Graph Model Storage Provider for the Jena Framework, which enables Semantic Web applications written using the Jena RDF Frameworks to directly query the Virtuoso RDF Quad Store. <a href="VOSDownload#Jena%20Provider">Providers are available</a> for the latest [[http://jena.sourceforge.net/][Jena]] 2.6.x - 2.13.x and 3.0.x versions. %BR%%BR%<img src="%ATTACHURLPATH%/virt_jena_arch4.png" style="wikiautogen"/>%BR%%BR% ---++ Setup ---+++ Prerequisites <a href="VOSDownload#Jena%20Provider">Download the latest</a> Virtuoso Jena Provider for your Jena framework version, Virtuoso JDBC Driver, Jena Framework, and associated classes and sample programs. * <i><b>Note:</b> You must use a matching set of Jena Provider and JDBC Driver.</i> * <i>The Jena Provider for Jena 2.6 requires the Virtuoso JDBC 3 Driver.</i> * <i>The Jena Provider for Jena 2.1x.x and 3.0.x requires the Virtuoso JDBC 4 Driver.</i> %BR%%BR% * The version of the Jena Provider (<code>virt_jena.jar</code>) can be verified thus: <verbatim> $ java -jar virt_jena3.jar OpenLink Virtuoso(TM) Provider for Jena(TM) Version 3.0.0 [Build 1.25] $ java -jar ./virt_jena2.jar OpenLink Virtuoso(TM) Provider for Jena(TM) Version 2.10.1 [Build 1.10] $ java -jar ./virt_jena.jar OpenLink Virtuoso(TM) Provider for Jena(TM) Version 2.6.2 [Build 1.10] </verbatim> * Files contained in the zip files are generally older than specifically linked downloads (e.g., the Virtuoso JDBC Driver, <code>virtjdbc3.jar</code>), so don't replace if prompted during extraction. Instead, rename the file extracted from the zip, and compare their versions to be sure you keep only the most recent. <verbatim> $ java -cp ./virtjdbc3.jar virtuoso.jdbc3.Driver OpenLink Virtuoso(TM) Driver for JDBC(TM) Version 3.x [Build 3.62] $ java -cp ./virtjdbc3.fromzip.jar virtuoso.jdbc3.Driver OpenLink Virtuoso(TM) Driver for JDBC(TM) Version 3.x [Build 3.11] </verbatim> ---+++ Compiling Jena Sample Programs 1 Edit the sample programs <code><nowiki>VirtuosoSPARQLExample<i>X</i>.java</nowiki></code>, where <code><i>X</i> = {1,2,3,4,5,6,7,8,9,13,14}</code>. Set the JDBC connection strings therein to point to a valid Virtuoso Server instance, using the form: <verbatim> "jdbc:virtuoso://&lt;virtuoso-hostname-or-IP-address&gt;[:&lt;data port&gt;]/charset=UTF-8/log_enable=2", "&lt;username&gt;", "&lt;password&gt;" </verbatim> For example, <verbatim> "jdbc:virtuoso://localhost:1111/charset=UTF-8/log_enable=2", "dba", "dba" </verbatim> * Use <b><code>charset=UTF-8</code></b> to ensure compatibility with non-Western codepages or character sets such as Cyrillic * Use <b><code>log_enable=2</code></b> to turn on row-level autocommit, important when processing large RDF data sets 1 Ensure your active <code>CLASSPATH</code> includes full paths to all of the following files * Required Jena jar file for the version being used, as indicated in the <code>Testing</code> section next * <code>virt_jenaX.jar</code> - Virtuoso Jena Provider for the required version * <code>virtjdbcX.jar</code> - Virtuoso JDBC Driver for the required version 1 Compile the Jena Sample applications using the following command: <verbatim> javac VirtuosoSPARQLExample*.java </verbatim> ---++ Testing Once the Provider classes and sample program have been successfully compiled, the Provider can be tested using the included sample programs. ---+++ Prerequisites Ensure your active <code>CLASSPATH</code> includes the full path to the directory containing the compiled <code>VirtuosoSPARQLExample*.class</code> files, as well as to each of the following files depending on Jena version in use -- ---++++ Jena 2.6 * <code><nowiki>icu4j_3_4.jar</nowiki></code> * <code>iri.jar</code> * <code>xercesImpl.jar</code> * <code>axis.jar</code> * <code>commons-logging-1.1.1.jar</code> * <code>jena.jar</code> * <code>arq.jar</code> * <code>virtjdbc3.jar</code> * <code>virt_jena.jar</code> ---++++ Jena 2.7 * <code><nowiki>jena-arq-2.9.4.jar</nowiki></code> * <code><nowiki>jena-iri-0.9.4.jar</nowiki></code> * <code><nowiki>jena-core-2.7.4.jar</nowiki></code> * <code><nowiki>jcl-over-slf4j-1.6.4.jar</nowiki></code> * <code><nowiki>log4j-1.2.16.jarslf4j-api-1.6.4.jar</nowiki></code> * <code><nowiki>slf4j-log4j12-1.6.4.jar</nowiki></code> * <code><nowiki>xercesImpl-2.10.0.jar</nowiki></code> * <code><nowiki>xml-apis-1.4.01.jar</nowiki></code> * <code><nowiki>commons-lang3-3.4.jar</nowiki></code> * <code><nowiki>virtjdbc4.jar</nowiki></code> * <code><nowiki>virt_jena2.jar</nowiki></code> ---++++ Jena 2.1x.x * <code><nowiki>junit-4.5.jar</nowiki></code> * <code><nowiki>jena-arq-2.10.1.jar</nowiki></code> * <code><nowiki>jena-iri-0.9.6.jar</nowiki></code> * <code><nowiki>jena-core-2.10.1.jar</nowiki></code> * <code><nowiki>jena-core-2.10.1-tests.jar</nowiki></code> * <code><nowiki>jcl-over-slf4j-1.6.4.jar</nowiki></code> * <code><nowiki>log4j-1.2.16.jar</nowiki></code> * <code><nowiki>slf4j-api-1.6.4.jar</nowiki></code> * <code><nowiki>slf4j-log4j12-1.6.4.jar</nowiki></code> * <code><nowiki>xercesImpl-2.11.0.jar</nowiki></code> * <code><nowiki>xml-apis-1.4.01.jar</nowiki></code> * <code><nowiki>virtjdbc4.jar</nowiki></code> * <code><nowiki>virt_jena2.jar</nowiki></code> ---++++ Jena 3.0.x * <code><nowiki>junit-4.5.jar</nowiki></code> * <code><nowiki>commons-lang3-3.3.2.jar</nowiki></code> * <code><nowiki>jena-arq-3.0.0.jar</nowiki></code> * <code><nowiki>jena-iri-3.0.0.jar</nowiki></code> * <code><nowiki>jena-base-3.0.0.jar</nowiki></code> * <code><nowiki>jena-core-3.0.0.jar</nowiki></code> * <code><nowiki>jena-core-3.0.0-tests.jar</nowiki></code> * <code><nowiki>jcl-over-slf4j-1.7.12.jar</nowiki></code> * <code><nowiki>log4j-1.2.17.jar</nowiki></code> * <code><nowiki>slf4j-api-1.7.12.jar</nowiki></code> * <code><nowiki>slf4j-log4j12-1.7.12.jar</nowiki></code> * <code><nowiki>xercesImpl-2.11.0.jar</nowiki></code> * <code><nowiki>xml-apis-1.4.01.jar</nowiki></code> * <code><nowiki>jena-shaded-guava-3.0.0.jar</nowiki></code> * <code><nowiki>virtjdbc4.jar</nowiki></code> * <code><nowiki>virt_jena3.jar</nowiki></code> If you've extracted the zips into the same directory where you compiled the example files, a command like this should do the job -- <verbatim> export CLASSPATH=`pwd`:`pwd`/*.jar:$CLASSPATH </verbatim> ---+++ The Tests 1 [[VirtJenaSPARQLExample1][Example 1]] returns the contents of the RDF Quad store of the targeted Virtuoso instance, with the following command: <verbatim> java VirtuosoSPARQLExample1 </verbatim> 1 [[VirtJenaSPARQLExample2][Example 2]] reads in the contents of the following FOAF URIs -- <verbatim> http://kidehen.idehen.net/dataspace/person/kidehen#this http://www.w3.org/People/Berners-Lee/card#i http://demo.openlinksw.com/dataspace/person/demo#this </verbatim> -- and returns the RDF data stored, with the following command: <verbatim> java VirtuosoSPARQLExample2 </verbatim> 1 [[VirtJenaSPARQLExample3][Example 3]] performs simple addition and deletion operation on the content of the triple store, with the following command: <verbatim> java VirtuosoSPARQLExample3 </verbatim> 1 [[VirtJenaSPARQLExample4][Example 4]] demonstrates the use of the <code>graph.contains</code> method for searching triples, with the following command: <verbatim> java VirtuosoSPARQLExample4 </verbatim> 1 [[VirtJenaSPARQLExample5][Example 5]] demonstrates the use of the <code>graph.find</code> method for searching triples, with the following command: <verbatim> java VirtuosoSPARQLExample5 </verbatim> 1 [[VirtJenaSPARQLExample6][Example 6]] demonstrates the use of the <code>graph.getTransactionHandler</code> method, with the following command: <verbatim> java VirtuosoSPARQLExample6 </verbatim> 1 [[VirtJenaSPARQLExample7][Example 7]] demonstrates the use of the <code>graph.getBulkUpdateHandler</code> method, with the following command: <verbatim> java VirtuosoSPARQLExample7 </verbatim> 1 [[VirtJenaSPARQLExample8][Example 8]] demonstrates how to insert triples into a graph, with the following command: <verbatim> java VirtuosoSPARQLExample8 </verbatim> 1 [[VirtJenaSPARQLExample9][Example 9]] demonstrates the use of the <code>CONSTRUCT</code>, <code>DESCRIBE</code>, and <code>ASK</code> SPARQL query forms, with the following command: <verbatim> java VirtuosoSPARQLExample9 </verbatim> 1 [[VirtJenaSPARQLExample13][Example 13]] demonstrates the use of inference rules with the following command: <verbatim> java VirtuosoSPARQLExample13 </verbatim> 1 [[VirtJenaSPARQLExample14][Example 14]] demonstrates the use of the Jena in memory Inference and Ontology Model rules with the following command: <verbatim> java VirtuosoSPARQLExample14 </verbatim> ---++ Javadoc API Documentation Javadocs covers the complete set of classes, interfaces, and methods implemented by the provider: * [[http://docs.openlinksw.com/jena/][Javadoc API Documentation for the Jena 2.6 Provider]] * [[http://docs.openlinksw.com/jena2/][Javadoc API Documentation for the Jena 2.10+ Provider]] ---++ Notes ---+++ Bypass Jena/ARQ parser To use Virtuoso-specific SPARQL extensions (such as <code>bif:contains</code>), queries must bypass the Jena/ARQ parser and go straight to the Virtuoso server. This is done by using the <code>VirtuosoQueryExecutionFactory.create()</code> method, instead of and without the Jena-specific <code>QueryFactory.create()</code> method, which always invokes the Jena/ARQ parser, which in turn rejects any Virtuoso-specific extensions. Thus one would execute a query as follows to bypass the Jena parser -- <verbatim> VirtuosoQueryExecution vqe = VirtuosoQueryExecutionFactory.create (query, set); vqe.execSelect(); </verbatim> -- rather than -- <verbatim> Query sparql = QueryFactory.create(query); VirtuosoQueryExecution vqe = VirtuosoQueryExecutionFactory.create (sparql, set); vqe.execSelect(); </verbatim> CategoryRDF CategoryOpenSource CategoryVirtuoso CategoryVOS CategoryJena CategoryDocumentation %VOSCOPY%
sioc:id
428506d27a835da6c7f315f59c53d25d
sioc:link
n2:VirtJenaProvider
sioc:has_container
n4:ODS
n21:has_services
n20:item
atom:title
VirtJenaProvider
sioc:links_to
n11: n15: n17: n2:CategoryOpenSource n19:CategoryJena n19:VirtJenaSPARQLExample13 n19:VirtJenaSPARQLExample8 n19:VirtJenaSPARQLExample9 n19:VirtJenaSPARQLExample6 n19:VirtJenaSPARQLExample7 n19:VirtJenaSPARQLExample4 n19:VirtJenaSPARQLExample5 n19:VirtJenaSPARQLExample2 n19:VirtJenaSPARQLExample3 n19:VirtuosoSPARQLExample n19:VirtJenaSPARQLExample1 n2:CategoryVirtuoso n2:CategoryDocumentation n2:CategoryRDF n2:CategoryVOS
atom:source
n4:ODS
atom:author
n22:this
atom:published
2017-06-13T06:09:01Z
atom:updated
2017-06-29T07:33:56Z
sioc:topic
n4:ODS
Subject Item
n2:VirtRDFDriverRedland
sioc:links_to
n2:VirtJenaProvider
Subject Item
n25:this
sioc:creator_of
n2:VirtJenaProvider