A back arrow icon.
RDFox Blog

How to Import Data into RDFox

How to Import Data into RDFox
Felicity Mulford

RDFox ingests data in the open standard RDF-triple format which can be imported, written from scratch, or easily converted to from SQL or CSV sources.

Once triples have been imported, they are available for querying and reasoning. Additionally, triples can be scheduled for incremental addition and incremental deletion, which makes them available for incremental reasoning.

Thus, triples can be added programmatically, read from files of certain formats, or extracted from an OWL 2 DL ontology.

How to convert data to RDF-triple format

Converting data to RDF-triple format requires establishing a mapping pattern between the data source and the desired graph structure. The following provides an example of a mapping pattern for data in sql/csv format:


This mapping is done in a two stage process using rules:

  • The first step is to attach the data source to RDFox as a relation. For example, each row of a table would become a table “type” relation and each column would become an argument of the relation.
  • The second step is to map the arguments of the relation to the desired graph structure with rules.

In the following example, a company’s employee table is first converted to an employee relation and then mapped to the desired graph structure using a rule.

The materialisation of the following rule will generate the graph from the relation:

[?x, a,         :employee] ,
[?x, :worksfor, :company] ,
[?x, :hasName,  ?y] ,
[?x, :hasJob,   ?z] :-
  fg:employee(?x , ?y , ?z) .

The flexibility of rules means it is possible to import data from different data sources into a the graph by first populating the binary relations in the graph as well as creating new ones.


Data can sometimes be incomplete especially when importing it from new data sources. RDFox can identify missing values or fill them in using a user defined strategy. This strategy can be applied during or after the import which improves the quality of the data.

For help converting data to RDF-triples from XML or Json, contact us at info@oxfordsemantic.tech. Find out more about RDFox or try it for yourself, for free!

Take your first steps towards a solution.

Start with a free RDFox demo!

Take your first steps towards a solution.

Get started with RDFox for free!

Team and Resources

The team behind Oxford Semantic Technologies started working on RDFox in 2011 at the Computer Science Department of the University of Oxford with the conviction that flexible and high-performance reasoning was a possibility for data-intensive applications without jeopardising the correctness of the results. RDFox is the first market-ready knowledge graph designed from the ground up with reasoning in mind. Oxford Semantic Technologies is a spin-out of the University of Oxford and is backed by leading investors including Samsung Venture Investment Corporation (SVIC), Oxford Sciences Enterprises (OSE) and Oxford University Innovation (OUI).