Offline Loading
Tentris provides the load subcommand for the offline loading of RDF graphs and datasets.
load works by reading the data from streams (e.g., standard input and local files).
Offline loading is recommended for large datasets, as it is faster than inserting large amounts of data while the server is running.
For online loading, please refer to the chapter SPARQL endpoints.
Note:
loadcan also be used to initialize new databases.
Examples
Load a single file
tentris load < ./example-rdf-graph.nt
tentris load /example-rdf-graph.nt
Load multiple files
tentris load ./example-graph-part1.nt ./example-graph-part2.nt
tentris load ./example-dir-1/*
Load files from directories
tentris load --recursive ./example-dir
tentris load --recursive ./example-dir-1 ./example-dir-2
Note: With the
--recursiveflag enabled, Tentris will try to read all files (i.e., also non-RDF files) that are found in the provided directories.
Load multiple files using cat
cat ./example-graph-part1.nt ./example-graph-part2.nt | tentris load
Note: When loading multiple files with
cat, Tentris considers the contents of the provided files to be part of the same file/graph when assigning blank node identifiers.
Load triples into a particular graph
tentris load --into-graph "https://example.com#my-graph" < ./example-rdf-graph.nt
Data Formats
Tentris automatically detects the format of the input, which can also be manually specified. The available formats are N-Triples, Turtle, N-Quads, and TriG.
Options
-
--format <FORMAT>
Manually specifies the format of the RDF file.tentris load --format turtle < ./example-rdf-graph.ttl -
--into-graph <GRAPH_IRI>
Loads the triples into a specific named graph.tentris load --into-graph "http://example.com#graph" < ./example-rdf-graph.nt -
--force-no-snapshot
Prevents Tentris from creating a snapshot after the data has been loaded. This is useful for improving the performance ofload, when loading multiple files sequentially, especially on filesystems that do not support reflinks (e.g., ext4).# Load the first file without creating a snapshot tentris load --force-no-snapshot < ./example-graph-part1.nt # Load the final file and allow a snapshot to be created for safety tentris load < ./example-graph-part2.nt⚠️ Warning: Preventing the creation of a snapshot after the final
load, the database may be unrecoverable in case of a server crash.