UltipaDocs
Products
Solutions
Resources
Company
Start Free Trial
UltipaDocs
Start Free Trial
  • Ultipa CLI
    • Overview
    • Importer
    • Import Configurations
      • Import from CSV
      • Import from JSON / JSONL
      • Import from a Relational Database
      • Import from Neo4j
      • Import from BigQuery
      • Import from Kafka
      • Import from Hive
      • Import from Salesforce
      • Import from RDF
      • Import from GraphML
    • Exporter
    • Export Configurations
      • Export to CSV
      • Export to JSON / JSONL
      • Export to GraphML
  1. Docs
  2. /
  3. Ultipa Tools
  4. /
  5. Data Import

Import from RDF

This page walks through importing an RDF graph into a GQLDB graph using gqldb-importer. The importer reads a single RDF file, parses every triple, and writes the subjects/objects as nodes and the predicates as edges.

Supported RDF serializations:

format valueSerialization
ntriplesN-Triples (.nt)
turtleTurtle (.ttl)
rdfxmlRDF/XML (.rdf, .xml)

Usage Guides

Prepare the RDF File

Place the RDF file in a directory accessible from where you will run gqldb-importer. A common layout is to keep the file in a ./data subdirectory next to the importer binary.

Directory layout
.
├── gqldb-importer
└── data/
    └── ontology.nt

Generate Configuration File

Bash
./gqldb-importer -sample rdf

A file named import.sample.rdf.yml will be created in the current directory. Rename it before editing so a re-run of -sample rdf doesn't clobber your changes:

Bash
mv import.sample.rdf.yml import.rdf.yml

Modify Configuration File

Edit import.rdf.yml. RDF-specific configuration lives under the top-level rdf: block; see the Import Configurations for the rest of the file (server, settings).

config snippet
rdf:
  file: "./data/ontology.nt"
  format: ntriples            # ntriples, turtle, rdfxml
  defaultSchema: "RDFNode"
  • file — path to the RDF file.
  • format — the RDF serialization. Must match the file's actual format.
  • defaultSchema — the label applied to every node created from an RDF subject or object.

Unlike the file/table-based sources, RDF imports do not declare nodes / edges entries — the importer derives them automatically from the triples: each subject and object becomes a node (labeled defaultSchema); each predicate becomes an edge whose label is the predicate IRI.

Execute Import

Bash
./gqldb-importer -c import.rdf.yml

How Triples Map to the Graph

Given a triple <s> <p> <o>:

RDF elementBecomes
Subject <s>A node with ID <s> and label defaultSchema.
Object <o> (IRI)A node with ID <o> and label defaultSchema.
Object <o> (literal)A property on the subject node, keyed by the predicate IRI.
Predicate <p>When the object is an IRI: an edge from the subject node to the object node with label <p>.

Blank nodes are assigned synthetic IDs derived from their position in the file.