7 RDF Graph Support for Apache Jena
RDF Graph support for Apache Jena (also referred to here as support for Apache Jena) provides a Java-based interface to Oracle Graph RDF Graph by implementing the well-known Jena Graph, RDF graph, and DatasetGraph APIs.
Note:
This feature was previously referred to as the Jena Adapter for Oracle Database and the Jena Adapter.
Support for Apache Jena extends the RDF data management capabilities of Oracle Database RDF/OWL.
(Apache Jena is an open source framework. For license and copyright conditions, see http://www.apache.org/licenses/
and http://www.apache.org/licenses/LICENSE-2.0
.)
The DatasetGraph APIs are for managing named graph data, also referred to as quads. In addition, RDF Graph support for Apache Jena provides network analytical functions on top of RDF data through integrating with the Oracle Spatial Network Data Model Graph feature.
This chapter assumes that you are familiar with major concepts explained in RDF Graph Overview and OWL
Concepts . It also assumes that you are familiar with the overall
capabilities and use of the Jena Java framework. For information about the Jena
framework, see http://jena.apache.org/
, especially the
Jena Documentation page. If you use the network analytical function, you should also be
familiar with the Network Data Model feature, which is documented in Oracle Spatial Topology and
Network Data Model Developer's Guide.
Note:
The current RDF Graph support for Apache Jena release has been tested against Apache Jena 3.1.0, and it supports the RDF schema-private networks environment in Release 19c databases. Because of the nature of open source projects, you should not use this support for Apache Jena with later versions of Jena.
Apache Joseki support has been deprecated, although it still is part of the OTN kit distribution for adapter version 3.1.0 with support for Release 19c databases. References to Joseki have been removed from this book for Release 19c, but you can find information about Joseki in previous versions of the book.
- Setting Up the Software Environment
To use the support for Apache Jena, you must first ensure that the system environment has the necessary software, including Oracle Database with RDF Graph support enabled, Apache Jena 3.12.0, and JDK 1.8 or later. - Setting Up the SPARQL Service
This section explains how to set up a SPARQL web service endpoint by deploying thefuseki.war
file in WebLogic Server. - Setting Up the RDF Graph Environment
To use the support for Apache Jena to perform queries, you can connect as any user (with suitable privileges) and use any RDF graphs in the RDF network. - SEM_MATCH and RDF Graph Support for Apache Jena Queries Compared
There are two ways to query RDF data stored in Oracle Database: SEM_MATCH-based SQL statements and SPARQL queries through the support for Apache Jena. - Retrieving User-Friendly Java Objects from SEM_MATCH or SQL-Based Query Results
You can query an RDF graph using any of the following approaches. - Optimized Handling of SPARQL Queries
This section describes some performance-related features of the support for Apache Jena that can enhance SPARQL query processing. These features are performed automatically by default. - Additions to the SPARQL Syntax to Support Other Features
RDF Graph support for Apache Jena allows you to pass in hints and additional query options. It implements these capabilities by overloading the SPARQL namespace prefix syntax by using Oracle-specific namespaces that contain query options. - Functions Supported in SPARQL Queries through RDF Graph Support for Apache Jena
SPARQL queries through the support for Apache Jena can use the following kinds of functions. - SPARQL Update Support
RDF Graph support for Apache Jena supports SPARQL Update (http://www.w3.org/TR/sparql11-update/
), also referred to as SPARUL. - Analytical Functions for RDF Data
You can perform analytical functions on RDF data by using theSemNetworkAnalyst
class in theoracle.spatial.rdf.client.jena
package. - Support for Server-Side APIs
This section describes some of the RDF Graph features that are exposed by RDF Graph support for Apache Jena. - Bulk Loading Using RDF Graph Support for Apache Jena
To load thousands to hundreds of thousands of RDF/OWL data files into an Oracle database, you can use theprepareBulk
andcompleteBulk
methods in theOracleBulkUpdateHandler
Java class to simplify the task. - Automatic Variable Renaming
Automatic variable renaming can enable certain queries that previously failed to run successfully. - JavaScript Object Notation (JSON) Format Support
JavaScript Object Notation (JSON) format is supported for SPARQL query responses. JSON data format is simple, compact, and well suited for JavaScript programs. - Other Recommendations and Guidelines
This section contains various recommendations and other information related to SPARQL queries. - Example Queries Using RDF Graph Support for Apache Jena
This section includes example queries using the support for Apache Jena. Each example is self-contained: it typically creates a model, creates triples, performs a query that may involve inference, displays the result, and drops the RDF graph. - SPARQL Gateway and RDF Data
SPARQL Gateway is a J2EE web application that is included with the support for Apache Jena. It is designed to make RDF data (RDF/OWL/SKOS) easily available to applications that operate on relational and XML data, including Oracle Business Intelligence Enterprise Edition (OBIEE) 11g. - Deploying Fuseki in Apache Tomcat
To deploy Fuseki in Apache Tomcat, you can use the Tomcat admin web page, or you can just copy the Fuseki.war
file into thewebapps
folder of Tomcat and it will be automatically deployed. - ORARDFLDR Utility for Bulk Loading RDF Data
This section describes using the ORARDFLDR utility program for Bulk Loading RDF Data.
Parent topic: Conceptual and Usage Information