8.7 Efficiently Loading RDF Data

The Oracle RDF Graph Adapter for Eclipse RDF4J provides additional or improved Java methods for efficiently loading a large amount of RDF data from files or collections.

Bulk Loading of RDF Data

The bulk loading capability of the adapter involves the following two steps:

  1. Loading RDF data from a file or collection of statements to a staging table.
  2. Loading RDF data from the staging table to the RDF storage tables.

The OracleBulkUpdateHandler class in the adapter provides methods that allow two different pathways for implementing a bulk load:

  1. addInBulk: These methods allow performing both the steps mentioned in Bulk Loading of RDF Data with a single invocation. This pathway is better when you have only a single file or collection to load from.
  2. prepareBulk and completeBulk: You can use one or more invocations of prepareBulk. Each call implements the step 1 of Bulk Loading of RDF Data.

    Later, a single invocation of completeBulk can be used to perform step 2 of Bulk Loading of RDF Data to load staging table data obtained from those multiple prepareBulk calls. This pathway works better when there are multiple files to load from.

In addition, the OracleSailRepositoryConnection class in the adapter provides bulk loading implementation for the following method in SailRepositoryConnection class: .

public void add(InputStream in,
                     String baseURI,
                     RDFFormat dataFormat,
                     Resource... contexts)

Bulk loading from compressed file is supported as well, but currently limited to gzip files only.