D.4 Example Queries Using Graph Adapter for Eclipse RDF4J
This section describes example queries for using Oracle RDF Graph Adapter for Eclipse RDF4J in an existing MDSYS network.
To run a query, you must do the following:
- Include any example code described in Example Queries Using Oracle RDF Graph Adapter for Eclipse RDF4J in a Java source file.
- Define a
CLASSPATH
environment variable namedCP
to include the relevant jar files. For example, it may be defined as follows:setenv CP .:ojdbc8.jar:ucp.jar:oracle-rdf4j-adapter-4.2.1.jar:log4j-api-2.17.2.jar:log4j-core-2.17.2.jar:log4j-slf4j-impl-2.17.2.jar:slf4j-api-1.7.36.jar:eclipse-rdf4j-4.2.1-onejar.jar:commons-io-2.11.0.jar
Note:
The precedingsetenv
command assumes that the jar files are located in the current directory. You may need to alter the command to indicate the location of these jar files in your environment. - Compile the Java source file. For example, to compile the source file
Test.java
, run the following command:javac -classpath $CP Test.java
- Run the compiled file on an RDF graph (model) named
TestModel
in an existing MDSYS network by executing the following command:java -classpath $CP Test jdbc:oracle:thin:@localhost:1521:orcl scott <password-for-scott> TestModel
Parent topic: MDSYS-Owned Semantic Network