Not logged in : Login

About: VirtJenaProvider     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : atom:Entry, within Data Space : www.openlinksw.com associated with source document(s)
QRcode icon
http://www.openlinksw.com/describe/?url=http%3A%2F%2Fwww.openlinksw.com%2Fdataspace%2Fdav%2Fwiki%2FVOS%2FVirtJenaProvider

AttributesValues
has container
Date Created
maker
topic
described by
seeAlso
Date Modified
link
id
  • 84ae922aa637ecd178bfa447c68cccbd
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. Providers are available for the latest [[http://jena.sourceforge.net/][Jena]] 2.6.x and 2.10.x versions. %BR%%BR%%BR%%BR% ---++ Setup ---+++ Prerequisites Download the latest Virtuoso Jena Provider for your Jena framework version, Virtuoso JDBC 3 Driver, Jena Framework, and associated classes and sample programs. * Note: The Jena Provider is explicitly bound to the Virtuoso JDBC 3 Driver. You cannot use the Virtuoso JDBC 4 Driver for this purpose at this time. * The version of the Jena Provider (virt_jena.jar) can be verified with the command: $ java -jar virt_jena.jar OpenLink Virtuoso(TM) Provider for Jena(TM) Version 2.6.2 [Build 1.2] * Files contained in the zip files are generally older than specifically linked downloads (e.g., the Virtuoso JDBC Driver, virtjdbc3.jar), 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. $ java -cp virtjdbc3.jar virtuoso.jdbc3.Driver OpenLink Virtuoso(TM) Driver for JDBC(TM) Version 3.x [Build 3.57] $ java -cp virtjdbc3.fromzip.jar virtuoso.jdbc3.Driver OpenLink Virtuoso(TM) Driver for JDBC(TM) Version 3.x [Build 3.11] ---+++ Compiling Jena Sample Programs 1 Edit the sample programs VirtuosoSPARQLExampleX.java, where X = {1,2,3,4,5,6,7,8,9,13}. Set the JDBC connection strings therein to point to a valid Virtuoso Server instance, using the form: "jdbc:virtuoso://<virtuoso-hostname-or-IP-address>[:<data port>]/charset=UTF-8/log_enable=2", "<username>", "<password>" For example, "jdbc:virtuoso://localhost:1111/charset=UTF-8/log_enable=2", "dba", "dba" * Use charset=UTF-8 to ensure compatibility with non-Western codepages or character sets such as Cyrillic * Use log_enable=2 to turn on row-level autocommit, important when processing large RDF data sets 1 Ensure your active CLASSPATH includes full paths to all of the following files * jena.jar * arq.jar * virt_jena.jar * virtjdbc3.jar 1 Compile the Jena Sample applications using the following command: javac VirtuosoSPARQLExample*.java ---++ 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 CLASSPATH includes the full path to the directory containing the compiled VirtuosoSPARQLExample*.class files, as well as to each of the following files -- * icu4j_3_4.jar * iri.jar * xercesImpl.jar * axis.jar * commons-logging-1.1.1.jar * jena.jar * arq.jar * virtjdbc3.jar * virt_jena.jar If you've extracted the zips into the same directory where you compiled the example files, a command like this should do the job -- export CLASSPATH=`pwd`:`pwd`/*.jar:$CLASSPATH ---+++ The Tests 1 [[VirtJenaSPARQLExample1][Example 1]] returns the contents of the RDF Quad store of the targeted Virtuoso instance, with the following command: java VirtuosoSPARQLExample1 1 [[VirtJenaSPARQLExample2][Example 2]] reads in the contents of the following FOAF URIs -- 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 -- and returns the RDF data stored, with the following command: java VirtuosoSPARQLExample2 1 [[VirtJenaSPARQLExample3][Example 3]] performs simple addition and deletion operation on the content of the triple store, with the following command: java VirtuosoSPARQLExample3 1 [[VirtJenaSPARQLExample4][Example 4]] demonstrates the use of the graph.contains method for searching triples, with the following command: java VirtuosoSPARQLExample4 1 [[VirtJenaSPARQLExample5][Example 5]] demonstrates the use of the graph.find method for searching triples, with the following command: java VirtuosoSPARQLExample5 1 [[VirtJenaSPARQLExample6][Example 6]] demonstrates the use of the graph.getTransactionHandler method, with the following command: java VirtuosoSPARQLExample6 1 [[VirtJenaSPARQLExample7][Example 7]] demonstrates the use of the graph.getBulkUpdateHandler method, with the following command: java VirtuosoSPARQLExample7 1 [[VirtJenaSPARQLExample8][Example 8]] demonstrates how to insert triples into a graph, with the following command: java VirtuosoSPARQLExample8 1 [[VirtJenaSPARQLExample9][Example 9]] demonstrates the use of the CONSTRUCT, DESCRIBE, and ASK SPARQL query forms, with the following command: java VirtuosoSPARQLExample9 1 [[VirtJenaSPARQLExample13][Example 13]] demonstrates the use of inference rules with the following command: java VirtuosoSPARQLExample13 ---++ Javadoc API Documentation The [[http://docs.openlinksw.com/jena/][Javadoc API Documentation for the Jena Provider]] covers the complete set of classes, interfaces, and methods implemented by the provider. ---++ Notes ---+++ Bypass Jena/ARQ parser To use Virtuoso-specific SPARQL extensions (such as bif:contains), queries must bypass the Jena/ARQ parser and go straight to the Virtuoso server. This is done by using the VirtuosoQueryExecutionFactory.create() method, instead of and without the Jena-specific QueryFactory.create() 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 -- VirtuosoQueryExecution vqe = VirtuosoQueryExecutionFactory.create (query, set); vqe.execSelect(); -- rather than -- Query sparql = QueryFactory.create(query); VirtuosoQueryExecution vqe = VirtuosoQueryExecutionFactory.create (sparql, set); vqe.execSelect(); CategoryRDF CategoryOpenSource CategoryVirtuoso CategoryVOS CategoryJena CategoryDocumentation %VOSCOPY%
  • %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. Providers are available for the latest [[http://jena.sourceforge.net/][Jena]] 2.6.x and 2.10.x versions. %BR%%BR%%BR%%BR% ---++ Setup ---+++ Prerequisites Download the latest Virtuoso Jena Provider for your Jena framework version, Virtuoso JDBC Driver, Jena Framework, and associated classes and sample programs. * Note: You must use a matching set of Jena Provider and JDBC Driver. * The Jena Provider for Jena 2.6 requires the Virtuoso JDBC 3 Driver. * The Jena Provider for Jena 2.10 requires the Virtuoso JDBC 4 Driver. %BR%%BR% * The version of the Jena Provider (virt_jena.jar) can be verified thus: $ 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] * Files contained in the zip files are generally older than specifically linked downloads (e.g., the Virtuoso JDBC Driver, virtjdbc3.jar), 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. $ 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] ---+++ Compiling Jena Sample Programs 1 Edit the sample programs VirtuosoSPARQLExampleX.java, where X = {1,2,3,4,5,6,7,8,9,13}. Set the JDBC connection strings therein to point to a valid Virtuoso Server instance, using the form: "jdbc:virtuoso://<virtuoso-hostname-or-IP-address>[:<data port>]/charset=UTF-8/log_enable=2", "<username>", "<password>" For example, "jdbc:virtuoso://localhost:1111/charset=UTF-8/log_enable=2", "dba", "dba" * Use charset=UTF-8 to ensure compatibility with non-Western codepages or character sets such as Cyrillic * Use log_enable=2 to turn on row-level autocommit, important when processing large RDF data sets 1 Ensure your active CLASSPATH includes full paths to all of the following files * jena.jar * arq.jar * virt_jena.jar * virtjdbc3.jar 1 Compile the Jena Sample applications using the following command: javac VirtuosoSPARQLExample*.java ---++ 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 CLASSPATH includes the full path to the directory containing the compiled VirtuosoSPARQLExample*.class files, as well as to each of the following files -- * icu4j_3_4.jar * iri.jar * xercesImpl.jar * axis.jar * commons-logging-1.1.1.jar * jena.jar * arq.jar * virtjdbc3.jar * virt_jena.jar If you've extracted the zips into the same directory where you compiled the example files, a command like this should do the job -- export CLASSPATH=`pwd`:`pwd`/*.jar:$CLASSPATH ---+++ The Tests 1 [[VirtJenaSPARQLExample1][Example 1]] returns the contents of the RDF Quad store of the targeted Virtuoso instance, with the following command: java VirtuosoSPARQLExample1 1 [[VirtJenaSPARQLExample2][Example 2]] reads in the contents of the following FOAF URIs -- 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 -- and returns the RDF data stored, with the following command: java VirtuosoSPARQLExample2 1 [[VirtJenaSPARQLExample3][Example 3]] performs simple addition and deletion operation on the content of the triple store, with the following command: java VirtuosoSPARQLExample3 1 [[VirtJenaSPARQLExample4][Example 4]] demonstrates the use of the graph.contains method for searching triples, with the following command: java VirtuosoSPARQLExample4 1 [[VirtJenaSPARQLExample5][Example 5]] demonstrates the use of the graph.find method for searching triples, with the following command: java VirtuosoSPARQLExample5 1 [[VirtJenaSPARQLExample6][Example 6]] demonstrates the use of the graph.getTransactionHandler method, with the following command: java VirtuosoSPARQLExample6 1 [[VirtJenaSPARQLExample7][Example 7]] demonstrates the use of the graph.getBulkUpdateHandler method, with the following command: java VirtuosoSPARQLExample7 1 [[VirtJenaSPARQLExample8][Example 8]] demonstrates how to insert triples into a graph, with the following command: java VirtuosoSPARQLExample8 1 [[VirtJenaSPARQLExample9][Example 9]] demonstrates the use of the CONSTRUCT, DESCRIBE, and ASK SPARQL query forms, with the following command: java VirtuosoSPARQLExample9 1 [[VirtJenaSPARQLExample13][Example 13]] demonstrates the use of inference rules with the following command: java VirtuosoSPARQLExample13 ---++ 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 bif:contains), queries must bypass the Jena/ARQ parser and go straight to the Virtuoso server. This is done by using the VirtuosoQueryExecutionFactory.create() method, instead of and without the Jena-specific QueryFactory.create() 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 -- VirtuosoQueryExecution vqe = VirtuosoQueryExecutionFactory.create (query, set); vqe.execSelect(); -- rather than -- Query sparql = QueryFactory.create(query); VirtuosoQueryExecution vqe = VirtuosoQueryExecutionFactory.create (sparql, set); vqe.execSelect(); CategoryRDF CategoryOpenSource CategoryVirtuoso CategoryVOS CategoryJena CategoryDocumentation %VOSCOPY%
Title
  • VirtJenaProvider
attachment
has creator
is described using
atom:source
atom:updated
  • 2014-04-29T00:56:03Z
  • 2014-10-29T17:06:23Z
atom:title
  • VirtJenaProvider
links to
atom:author
label
  • VirtJenaProvider
topic
atom:published
  • 2010-02-01T13:19:57Z
Faceted Search & Find service v1.17_git63 as of Apr 23 2021


Alternative Linked Data Documents: iSPARQL | ODE     Content Formats:       RDF       ODATA       Microdata      About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 08.03.3322 as of Jun 3 2021, on Linux (x86_64-generic-linux-glibc25), Single-Server Edition (30 GB total memory)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2021 OpenLink Software