. . . "2017-06-13T06:09:01Z" . . . . . . "2b255c19324bc26f272c3c5597fe3561" . . "VirtJenaProvider" . "%META:TOPICPARENT{name=\"VOSRDFDataProviders\"}%\n%VOSWARNING%\n%VOSNAV%\n\n---+ Virtuoso Jena Provider\n\n%TOC%\n\n---++ What is Jena?\n\nJena is an open source Semantic Web framework for Java. It provides an API to extract data from and write to RDF graphs. \nThe graphs are represented as an abstract \"model\". A model can be sourced with data from files, databases, URIs or a \ncombination of these. A Model can also be queried through SPARQL and updated through SPARUL.\n\n---++ What is the Virtuoso Jena Provider?\n\nThe Virtuoso Jena RDF Data Provider is a fully operational Native Graph Model Storage Provider for the Jena Framework, \nwhich enables Semantic Web applications written using the Jena RDF Frameworks to directly query the Virtuoso RDF Quad \nStore. Providers are available for the latest [[http://jena.sourceforge.net/][Jena]] \n2.6.x - 2.13.x and 3.0.x versions.\n%BR%%BR%%BR%%BR%\n\n---++ Setup\n\n---+++ Prerequisites\n\nDownload the latest Virtuoso Jena Provider for your Jena framework version, \nVirtuoso JDBC Driver, Jena Framework, and associated classes and sample programs. \n\n * Note: You must use a matching set of Jena Provider and JDBC Driver.\n * The Jena Provider for Jena 2.6 requires the Virtuoso JDBC 3 Driver.\n * The Jena Provider for Jena 2.1x.x and 3.0.x requires the Virtuoso JDBC 4 Driver.\n%BR%%BR%\n * The version of the Jena Provider (virt_jena.jar) can be verified thus:\n\n$ java -jar virt_jena3.jar\nOpenLink Virtuoso(TM) Provider for Jena(TM) Version 3.0.0 [Build 1.25]\n\n$ java -jar ./virt_jena2.jar\nOpenLink Virtuoso(TM) Provider for Jena(TM) Version 2.10.1 [Build 1.10]\n\n$ java -jar ./virt_jena.jar\nOpenLink Virtuoso(TM) Provider for Jena(TM) Version 2.6.2 [Build 1.10]\n\n * Files contained in the zip files are generally older than specifically linked downloads (e.g., the Virtuoso JDBC \nDriver, virtjdbc3.jar), so don't replace if prompted during extraction. Instead, rename the file extracted \nfrom the zip, and compare their versions to be sure you keep only the most recent.\n\n$ java -cp ./virtjdbc3.jar virtuoso.jdbc3.Driver\nOpenLink Virtuoso(TM) Driver for JDBC(TM) Version 3.x [Build 3.62]\n\n$ java -cp ./virtjdbc3.fromzip.jar virtuoso.jdbc3.Driver\nOpenLink Virtuoso(TM) Driver for JDBC(TM) Version 3.x [Build 3.11]\n\n\n---+++ Compiling Jena Sample Programs\n\n 1 Edit the sample programs VirtuosoSPARQLExampleX.java, where X = \n{1,2,3,4,5,6,7,8,9,13,14}. Set the JDBC connection strings therein to point to a valid Virtuoso Server \ninstance, using the form:\n\n\"jdbc:virtuoso://<virtuoso-hostname-or-IP-address>[:<data port>]/charset=UTF-8/log_enable=2\", \"<username>\", \"<password>\" \n\nFor example,\n\n\"jdbc:virtuoso://localhost:1111/charset=UTF-8/log_enable=2\", \"dba\", \"dba\" \n\n * Use charset=UTF-8 to ensure compatibility with non-Western codepages or character sets \nsuch as Cyrillic\n * Use log_enable=2 to turn on row-level autocommit, important when processing large RDF \ndata sets\n 1 Ensure your active CLASSPATH includes full paths to all of the following files\n * Required Jena jar file for the version being used, as indicated in the Testing section next\n * virt_jenaX.jar - Virtuoso Jena Provider for the required version\n * virtjdbcX.jar - Virtuoso JDBC Driver for the required version\n 1 Compile the Jena Sample applications using the following command:\n \njavac VirtuosoSPARQLExample*.java\n\n\n---++ Testing\n\nOnce the Provider classes and sample program have been successfully compiled, the Provider can be tested using the \nincluded sample programs. \n\n---+++ Prerequisites\n\nEnsure your active CLASSPATH includes the full path to the directory containing the compiled \nVirtuosoSPARQLExample*.class files, as well as to each of the following files depending on Jena version in use --\n\n---++++ Jena 2.6\n\n * icu4j_3_4.jar\n * iri.jar\n * xercesImpl.jar\n * axis.jar\n * commons-logging-1.1.1.jar\n * jena.jar\n * arq.jar\n * virtjdbc3.jar\n * virt_jena.jar\n\n---++++ Jena 2.7\n\n * jena-arq-2.9.4.jar\n * jena-iri-0.9.4.jar\n * jena-core-2.7.4.jar\n * jcl-over-slf4j-1.6.4.jar\n * log4j-1.2.16.jarslf4j-api-1.6.4.jar\n * slf4j-log4j12-1.6.4.jar\n * xercesImpl-2.10.0.jar\n * xml-apis-1.4.01.jar\n * commons-lang3-3.4.jar\n * virtjdbc4.jar\n * virt_jena2.jar\n\n---++++ Jena 2.1x.x\n\n * junit-4.5.jar\n * jena-arq-2.10.1.jar\n * jena-iri-0.9.6.jar\n * jena-core-2.10.1.jar\n * jena-core-2.10.1-tests.jar\n * jcl-over-slf4j-1.6.4.jar\n * log4j-1.2.16.jar\n * slf4j-api-1.6.4.jar\n * slf4j-log4j12-1.6.4.jar\n * xercesImpl-2.11.0.jar\n * xml-apis-1.4.01.jar\n * virtjdbc4.jar\n * virt_jena2.jar\n\n---++++ Jena 3.0.x\n\n * junit-4.5.jar\n * commons-lang3-3.3.2.jar\n * jena-arq-3.0.0.jar\n * jena-iri-3.0.0.jar\n * jena-base-3.0.0.jar\n * jena-core-3.0.0.jar\n * jena-core-3.0.0-tests.jar\n * jcl-over-slf4j-1.7.12.jar\n * log4j-1.2.17.jar\n * slf4j-api-1.7.12.jar\n * slf4j-log4j12-1.7.12.jar\n * xercesImpl-2.11.0.jar\n * xml-apis-1.4.01.jar\n * jena-shaded-guava-3.0.0.jar\n * virtjdbc4.jar\n * virt_jena3.jar\n\nIf you've extracted the zips into the same directory where you compiled the example files, a command like this \nshould do the job --\n\nexport CLASSPATH=`pwd`:`pwd`/*.jar:$CLASSPATH\n\n\n---+++ The Tests\n\n 1 [[VirtJenaSPARQLExample1][Example 1]] returns the contents of the RDF Quad store of the \ntargeted Virtuoso instance, with the following command:\n\njava VirtuosoSPARQLExample1\n\n 1 [[VirtJenaSPARQLExample2][Example 2]] reads in the contents of the following FOAF URIs -- \n\nhttp://kidehen.idehen.net/dataspace/person/kidehen#this\nhttp://www.w3.org/People/Berners-Lee/card#i\nhttp://demo.openlinksw.com/dataspace/person/demo#this\n\n-- and returns the RDF data stored, with the following command:\n\njava VirtuosoSPARQLExample2\n\n 1 [[VirtJenaSPARQLExample3][Example 3]] performs simple addition and deletion operation on the content of \nthe triple store, with the following command:\n\njava VirtuosoSPARQLExample3\n\n 1 [[VirtJenaSPARQLExample4][Example 4]] demonstrates the use of the graph.contains method for \nsearching triples, with the following command:\n\njava VirtuosoSPARQLExample4\n\n 1 [[VirtJenaSPARQLExample5][Example 5]] demonstrates the use of the graph.find method for \nsearching triples, with the following command:\n\njava VirtuosoSPARQLExample5\n\n 1 [[VirtJenaSPARQLExample6][Example 6]] demonstrates the use of the graph.getTransactionHandler \nmethod, with the following command:\n\njava VirtuosoSPARQLExample6\n\n 1 [[VirtJenaSPARQLExample7][Example 7]] demonstrates the use of the graph.getBulkUpdateHandler \nmethod, with the following command:\n\njava VirtuosoSPARQLExample7\n\n 1 [[VirtJenaSPARQLExample8][Example 8]] demonstrates how to insert triples into a graph, with the following \ncommand:\n\njava VirtuosoSPARQLExample8\n\n 1 [[VirtJenaSPARQLExample9][Example 9]] demonstrates the use of the CONSTRUCT, DESCRIBE, \nand ASK SPARQL query forms, with the following command:\n\njava VirtuosoSPARQLExample9\n\n 1 [[VirtJenaSPARQLExample13][Example 13]] demonstrates the use of inference rules with the following command:\n\njava VirtuosoSPARQLExample13\n\n 1 [[VirtJenaSPARQLExample14][Example 14]] demonstrates the use of the Jena in memory Inference and Ontology Model rules with the following command:\n\njava VirtuosoSPARQLExample14\n\n\n---++ Javadoc API Documentation\n\nJavadocs covers the complete set of classes, interfaces, and methods implemented by the provider:\n\n * [[http://docs.openlinksw.com/jena/][Javadoc API Documentation for the Jena 2.6 Provider]]\n * [[http://docs.openlinksw.com/jena2/][Javadoc API Documentation for the Jena 2.10+ Provider]]\n\n---++ Notes \n\n---+++ Bypass Jena/ARQ parser\n\nTo use Virtuoso-specific SPARQL extensions (such as bif:contains), queries must bypass the Jena/ARQ \nparser and go straight to the Virtuoso server. This is done by using the VirtuosoQueryExecutionFactory.create() \nmethod, instead of and without the Jena-specific QueryFactory.create() method, which always invokes the \nJena/ARQ parser, which in turn rejects any Virtuoso-specific extensions. Thus one would execute a query as follows to \nbypass the Jena parser --\n\nVirtuosoQueryExecution vqe = VirtuosoQueryExecutionFactory.create (query, set);\nvqe.execSelect();\n\n-- rather than -- \n\nQuery sparql = QueryFactory.create(query);\nVirtuosoQueryExecution vqe = VirtuosoQueryExecutionFactory.create (sparql, set);\nvqe.execSelect();\n\n\nCategoryRDF CategoryOpenSource CategoryVirtuoso CategoryVOS CategoryJena CategoryDocumentation\n\n%VOSCOPY%" . . . . "2017-06-13T06:09:01Z" . "VirtJenaProvider" . . . . . . . . . . . . . . "VirtJenaProvider" . . . . . . . . . . . . . . . . "2017-06-13T06:09:01.401640"^^ . "2017-06-13T06:09:01.401640"^^ .