8.8 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:
- Loading RDF data from a file or collection of statements to a staging table.
- 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:
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.prepareBulk
andcompleteBulk
: You can use one or more invocations ofprepareBulk
. 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 multipleprepareBulk
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.
Parent topic: RDF Graph Support for Eclipse RDF4J