Load data
rudof load copies RDF data into a LadybugDB property graph database: it validates the data with SHACL, derives a property graph schema, and lets the database DDL constrain subsequent mutations. It is the load step of the full connect/ddl/load/query workflow.
rudof load <data...> [--shapes <shapes...>]
Also works inside rudof shell, the same as any other subcommand.
The database can be selected in two ways (in this order of precedence):
--db <PATH>: open the LadybugDB database at the given path.- A connection details file written by
rudof connect(default:.rudof-connection.tomlin the current directory, or the file given with--connection <FILE>).
Example:
$ rudof connect examples/db.lbug
$ rudof load examples/user_no_errors.ttl --shapes examples/user_shapes.ttl
Loaded 19 triples from RDF data
Loaded SHACL shapes (4 shapes)
SHACL validation PASSED ✓
Creating schema (1 node table(s), 1 relationship table(s)) and loading data...
Created node table: Person
Created relationship table: knows (Person → Person)
Inserted 5 node(s)
Inserted 4 relationship(s)
✓ Load complete!
What it does
- Loads the RDF data into an in-memory store.
- Validates the data with SHACL (unless
--skip-validationis given): either against the shapes graph given with--shapes, or against shapes embedded in the data itself. Any validation violation aborts the load, so the database only ever receives conforming data. - Derives a property graph schema from the data (classes from
rdf:type, properties from predicates, relationships from predicates with IRI objects) — the same schema thatrudof ddlprints. - Applies the DDL: creates the node and relationship tables (existing tables are left untouched).
- Copies the data: inserts nodes and relationships through Cypher
CREATEstatements.
Because the node/rel tables act as the schema of the database, subsequent mutations that do not conform to the DDL are rejected by the database itself. This is generally necessary, but not sufficient to guarantee full SHACL conformance — re-run rudof shacl-validate on the RDF source (or re-load) to check the data again.
Options
| Option | Description |
|---|---|
<DATA>... | RDF data files to load |
--db <PATH> | Path to the LadybugDB database (overrides connection details) |
--connection <FILE> | Connection details file (default: .rudof-connection.toml) |
--skip-validation | Copy the data without SHACL validation |
-s, --shapes <INPUT> | Shapes graph: file, URI or -; if not set, shapes come from the data |
-f, --shapes-format <FORMAT> | Shapes file format (default: turtle) |
--base-shapes <IRI> | Base IRI for the shapes |
-t, --data-format <FORMAT> | RDF data format (default: turtle) |
--base-data <IRI> | Base IRI for the data |
--reader-mode <MODE> | RDF reader mode (default: strict) |
Querying the loaded data
Use rudof query --dialect cypher to run Cypher queries against the loaded database.