Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.

Examples

Load a single file

tentris load < ./example-rdf-graph.nt

Note: load can also be used to initialize new databases.

Load multiple files using cat

cat ./example-graph-part1.nt ./example-graph-part2.nt | tentris load

Note: Using this method, Tentris considers the two files to be part of the same graph. If they are not part of the same graph, two separate load commands should be used.

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 of load, 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.