tg-load-turtle
Loads triples into the knowledge graph from Turtle (RDF) files.
Synopsis
tg-load-turtle -f FLOW_ID --document-id DOC_ID [options] FILE [FILE ...]
Description
The tg-load-turtle command parses Turtle (RDF) files using rdflib and imports the triples into the TrustGraph knowledge graph via the bulk API. This allows you to load externally produced RDF data into TrustGraph for querying and retrieval.
Options
Required Arguments
| Option | Description |
|---|---|
-f, --flow-id FLOW_ID | Flow identifier for the import |
--document-id DOC_ID | Identifier for the loaded triples |
FILE [FILE ...] | One or more Turtle (.ttl) files to load |
Optional Arguments
| Option | Default | Description |
|---|---|---|
-u, --url URL | $TRUSTGRAPH_URL or http://localhost:8088/ | TrustGraph API URL |
-t, --token TOKEN | $TRUSTGRAPH_TOKEN | Authentication token |
-w, --workspace WORKSPACE | $TRUSTGRAPH_WORKSPACE or default | Workspace identifier |
-C, --collection COLLECTION | default | Collection identifier |
Examples
Load a Single Turtle File
tg-load-turtle -f default --document-id "research-triples" data.ttl
Load Multiple Files into a Collection
tg-load-turtle \
-f default \
--document-id "ontology-import" \
-C ontologies \
schema.ttl classes.ttl properties.ttl
Load from a Remote Instance
tg-load-turtle \
-u http://production:8088/ \
-f default \
--document-id "external-data" \
external-graph.ttl
Environment Variables
TRUSTGRAPH_URL: Default API URLTRUSTGRAPH_TOKEN: Default authentication tokenTRUSTGRAPH_WORKSPACE: Default workspace identifier
Related Commands
tg-graph-to-turtle- Export knowledge graph to Turtle formattg-load-knowledge- Load knowledge into graphtg-show-graph- Display graph triplestg-query-graph- Query the knowledge graph