RDFDB: Efficient RDF graph storage in a relational database

The project includes:

  • Loading RDF triples, RDF Schema and OWL ontology into a DBMS server.
  • RDF database, RDF Schema and OWL ontology dictionary-encoder utility.
  • Loading Data according to two storage schemas:
    • One triples table.
    • Table per Role and Concept.

Note that for each loading (new graph and/or new data) a new database will be created.


  • To run RDFDB, you need the Java Runtime Environment (JRE). The tool was tested with JRE 1.8.
  • The tool is configured by default to be used with PostgreSQL.


You should download the latest version RDFDB.zip and extract it to a working directory. The directory should have the following structure:

  • The RDFDB JAR file named something like RDFDB-{version}.jar.
  • The conf directory which contains the conf file used by the RDFDB.
  • The resource directory which contains two directory:
    • The ontology directory: ontology files in owl or rdf formats.
    • The triple directory: triples files in RDF format


| + conf
|     - dataLoading.prop
| + resources
|     + ontologies
          - *.owl
          - *.rdf
|     + triples
          - *.nt
|  RDFDB-version.jar

How to use

Data can be loaded using two ways:

  • Starting from a data file and a separated schema file; the data file needs to be in n-triples format, and the schema file can be in RDF-XML or OWL-XML:
    java -jar RDFDB-version.jar - (owl | rdfs)  ontology_file (.owl|.rdf)  -data triple_file (.nt)
  • Starting from a single n-triples format file with the schema and the data triples:
    java -jar RDFDB-version.jar -input allIn_file.nt
  • The conf folder contains the default property file nammed dataLoading.prop. However, it is possible to specify another property file using the parameter:
    -pf the_path_of_a_new_property_file.prop

Generating the JAR file using Maven

    1. Import the project into your workspace.
    2. Use ‘mvn package’ command line under the project folder to generate the JAR File
    3. The JAR file will be generated under ‘target’ folder named: ‘RDFDB-{version}.jar’

More details to how build project using maven can be found here: https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html


RDBMS engine properties

# Database engine

database.engine = POSTGRESQL

# Database host
database.host = localhost

# Database port
database.port = 5432

# Database name
database.name = dbrdftest

# Database user
database.user = postgres

# Database password
database.password = postgres

# If this parameter is true and if there already exists a database of the given name,
# then the database is dropped before being rewritten.
database.drop_existing_db = true

Triple tables properties

# The RDBMS (input) triples table name
database.triples_table_name = triples
# The encoded triples table name
database.encoded_triples_table_name = encoded_triples

Dictionary properties

# Database dictionary table name.
# Use to encode the input query and ontology and decode the results.
database.dictionary_table_name = dictionary

# Dictionary resultSet fetch size.
dictionary.fetch_size = 1000

Database storage layout

# Database (physical) storage layout.
database.storage_layout = TRIPLES_TABLE
#database.storage_layout = TABLE_PER_ROLE_AND_CONCEPT

Saturation properties

# Batch size.
saturation.batch_size = 1000
# Enable/disable saturation
saturation.enable = false

Statistics properties

# Flag indicating the statistics tables generation (or not) for the triples table.
statistics.create_tables_flag = true

Comments are closed.