11.20 ORARDFLDR Utility for Bulk Loading RDF Data

This section describes using the ORARDFLDR utility program for Bulk Loading RDF Data.

This utility program loads all files in a directory into an RDF graph in Oracle AI Database. It supports several RDF serializations like RDF/XML, Turtle, N-Triple, N-Quads and Trig. Files compressed with gzip can be directly loaded without uncompressing the gzip file. In addition, Unicode character escaping and long literals (CLOBs) are handled automatically.

Running ORARDFLDR Utility Program

The following describes the commands to execute ORARDFLDR:

Prerequisite: Ensure that the environment variable ${ORACLE_JENA_HOME} is pointing to the directory where the OTN kit is stored.

Usage:
java -cp ${ORACLE_JENA_HOME}/jar/'*' oracle.spatial.rdf.client.jena.utilities.RDFLoader <command_line_arguments>
For help details:
java -cp ${ORACLE_JENA_HOME}/jar/'*' oracle.spatial.rdf.client.jena.utilities.RDFLoader --help

For convenience, a shell script in the bin directory can also be executed. The following describes the commands to use this script

Prerequisite: Set ${ORACLE_JENA_HOME} and ensure ${ORACLE_JENA_HOME}/bin is in your Unix PATH environment variable.

Usage:
orardfldr <command_line_arguments>
For help details:
orardfldr --help

11.20.1 Using ORARDFLDR with Oracle Autonomous AI Database

This section describes using the ORARDFLDR utility with Oracle Autonomous AI Database.

The ORARDFLDR utility included with support for Apache Jena can be used to bulk load RDF files from your client computer to Oracle Autonomous AI Database. See Connecting JDBC-based RDF Applications to Oracle Autonomous AI Database for more information on how to obtain a JDBC URL to connect to the Autonomous AI Database.

The following example describes establishing a JDBC connection to Autonomous AI Database following the approach described in Java Connectivity Using 19c and 18.3 JDBC.

Example 11-34 JDBC connectivity to Oracle Autonomous AI Database

Prerequisite: Ensure you have the following Oracle jar files: ojdbc8.jar, ucp.jar, oraclepki.jar, osdt_core.jar, and osdt_cert.jar.

Unzip your wallet_<dbname>.zip file. You should see something similar to the listing below after unzipping the file.

[oracle@localhost Wallet_Info]$ ls
cwallet.sso  keystore.jks      README      tnsnames.ora
ewallet.p12  ojdbc.properties  sqlnet.ora  truststore.jks

Use the following JDBC URL:

jdbc:oracle:thin:@dbname_alias?TNS_ADMIN=<path_to_wallet_directory>

The following examples loads the RDF files using the ORAFLDR utility for a database named rdfdb and having a wallet directory as /home/oracle/RDF/Wallet_Info/ .

Example 11-35 Using ORAFLDR Utility to load RDF Data files

Prerequisite: Ensure you have copied the prerequisite jars listed in Example 11-34 to $ORACLE_JENA_HOME/jar/.

Invoke ORARDFLDR to load RDF files from your client computer to an Autonomous AI Database.

orardfldr --modelName=M1 --fileDir=./data --lang=N-TRIPLE 
    --jdbcUrl=jdbc:oracle:thin:@rdfdb_medium?TNS_ADMIN=/home/oracle/RDF/Wallet_Info/ 
    --user="RDFUSER" --password=password --networkOwner="RDFUSER" --networkName=NET1

It loads RDF data in N-Triple format into a model named M1 in a network named NET1 owned by RDFUSER. RDFUSER is also used for the database connection.