Skip to content

Commit 9142863

Browse files
committed
Updated load-knowledge CLI
1 parent b29a56d commit 9142863

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
---
2-
title: tg-load-turtle
2+
title: tg-load-knowledge
33
layout: default
44
parent: CLI
55
---
66

7-
# tg-load-turtle
7+
# tg-load-knowledge
88

9-
Loads RDF triples from Turtle files into the TrustGraph knowledge graph.
9+
Loads RDF triples from RDF Turtle files into the TrustGraph knowledge graph.
1010

1111
## Synopsis
1212

1313
```bash
14-
tg-load-turtle -i DOCUMENT_ID [options] file1.ttl [file2.ttl ...]
14+
tg-load-knowledge -i DOCUMENT_ID [options] file1.ttl [file2.ttl ...]
1515
```
1616

1717
## Description
1818

19-
The `tg-load-turtle` command loads RDF triples from Turtle (TTL) format files into TrustGraph's knowledge graph. It parses Turtle files, converts them to TrustGraph's internal triple format, and imports them using WebSocket connections for efficient batch processing.
19+
The `tg-load-knowledge` command loads RDF triples from Turtle (TTL) format files into TrustGraph's knowledge graph. It parses Turtle files, converts them to TrustGraph's internal triple format, and imports them using WebSocket connections for efficient batch processing.
2020

2121
The command supports retry logic and automatic reconnection to handle network interruptions during large data imports.
2222

@@ -38,20 +38,20 @@ The command supports retry logic and automatic reconnection to handle network in
3838

3939
### Basic Turtle Loading
4040
```bash
41-
tg-load-turtle -i "doc123" knowledge-base.ttl
41+
tg-load-knowledge -i "doc123" knowledge-base.ttl
4242
```
4343

4444
### Multiple Files
4545
```bash
46-
tg-load-turtle -i "ontology-v1" \
46+
tg-load-knowledge -i "ontology-v1" \
4747
schema.ttl \
4848
instances.ttl \
4949
relationships.ttl
5050
```
5151

5252
### Custom Flow and Collection
5353
```bash
54-
tg-load-turtle \
54+
tg-load-knowledge \
5555
-i "research-data" \
5656
-f "knowledge-import-flow" \
5757
-U "research-team" \
@@ -61,7 +61,7 @@ tg-load-turtle \
6161

6262
### Load with Custom API URL
6363
```bash
64-
tg-load-turtle \
64+
tg-load-knowledge \
6565
-i "production-data" \
6666
-u "ws://production:8088/" \
6767
production-ontology.ttl
@@ -137,20 +137,20 @@ The loader converts Turtle triples to TrustGraph format:
137137
### Ontology Import
138138
```bash
139139
# Load domain ontology
140-
tg-load-turtle -i "healthcare-ontology" \
140+
tg-load-knowledge -i "healthcare-ontology" \
141141
-C "ontologies" \
142142
healthcare-schema.ttl
143143

144144
# Load instance data
145-
tg-load-turtle -i "patient-data" \
145+
tg-load-knowledge -i "patient-data" \
146146
-C "healthcare-data" \
147147
patient-records.ttl
148148
```
149149

150150
### Knowledge Base Migration
151151
```bash
152152
# Migrate from external knowledge base
153-
tg-load-turtle -i "migration-$(date +%Y%m%d)" \
153+
tg-load-knowledge -i "migration-$(date +%Y%m%d)" \
154154
-C "migrated-data" \
155155
exported-knowledge.ttl
156156
```
@@ -160,7 +160,7 @@ tg-load-turtle -i "migration-$(date +%Y%m%d)" \
160160
# Load research datasets
161161
datasets=("publications" "authors" "citations")
162162
for dataset in "${datasets[@]}"; do
163-
tg-load-turtle -i "research-$dataset" \
163+
tg-load-knowledge -i "research-$dataset" \
164164
-C "research-data" \
165165
"$dataset.ttl"
166166
done
@@ -169,9 +169,9 @@ done
169169
### Structured Data Import
170170
```bash
171171
# Load structured data from various sources
172-
tg-load-turtle -i "products" -C "catalog" product-catalog.ttl
173-
tg-load-turtle -i "customers" -C "crm" customer-data.ttl
174-
tg-load-turtle -i "orders" -C "transactions" order-history.ttl
172+
tg-load-knowledge -i "products" -C "catalog" product-catalog.ttl
173+
tg-load-knowledge -i "customers" -C "crm" customer-data.ttl
174+
tg-load-knowledge -i "orders" -C "transactions" order-history.ttl
175175
```
176176

177177
## Advanced Usage
@@ -183,7 +183,7 @@ for ttl in *.ttl; do
183183
doc_id=$(basename "$ttl" .ttl)
184184
echo "Loading $ttl as document $doc_id..."
185185

186-
tg-load-turtle -i "$doc_id" \
186+
tg-load-knowledge -i "$doc_id" \
187187
-C "bulk-import-$(date +%Y%m%d)" \
188188
"$ttl"
189189
done
@@ -197,7 +197,7 @@ for ttl in "${ttl_files[@]}"; do
197197
(
198198
doc_id=$(basename "$ttl" .ttl)
199199
echo "Loading $ttl in background..."
200-
tg-load-turtle -i "parallel-$doc_id" \
200+
tg-load-knowledge -i "parallel-$doc_id" \
201201
-C "parallel-import" \
202202
"$ttl"
203203
) &
@@ -215,11 +215,11 @@ for ttl in *.ttl; do
215215

216216
if [ $size -lt 10485760 ]; then # < 10MB
217217
echo "Processing small file: $ttl"
218-
tg-load-turtle -i "$doc_id" -C "small-files" "$ttl"
218+
tg-load-knowledge -i "$doc_id" -C "small-files" "$ttl"
219219
else
220220
echo "Processing large file: $ttl"
221221
# Use dedicated collection for large files
222-
tg-load-turtle -i "$doc_id" -C "large-files" "$ttl"
222+
tg-load-knowledge -i "$doc_id" -C "large-files" "$ttl"
223223
fi
224224
done
225225
```
@@ -243,7 +243,7 @@ validate_and_load() {
243243

244244
# Load if valid
245245
echo "Loading $ttl_file..."
246-
tg-load-turtle -i "$doc_id" -C "validated-data" "$ttl_file"
246+
tg-load-knowledge -i "$doc_id" -C "validated-data" "$ttl_file"
247247
else
248248
echo "✗ Invalid Turtle syntax in $ttl_file"
249249
return 1
@@ -301,7 +301,7 @@ monitor_load() {
301301
echo "Starting load: $ttl_file"
302302
start_time=$(date +%s)
303303

304-
tg-load-turtle -i "$doc_id" -C "monitored" "$ttl_file"
304+
tg-load-knowledge -i "$doc_id" -C "monitored" "$ttl_file"
305305

306306
end_time=$(date +%s)
307307
duration=$((end_time - start_time))
@@ -379,7 +379,7 @@ load_batch_optimized() {
379379
echo "Processing batch $((i/5 + 1))..."
380380
for ttl in "${batch[@]}"; do
381381
doc_id=$(basename "$ttl" .ttl)
382-
tg-load-turtle -i "$doc_id" -C "$collection" "$ttl" &
382+
tg-load-knowledge -i "$doc_id" -C "$collection" "$ttl" &
383383
done
384384
wait
385385
done
@@ -400,7 +400,7 @@ load_with_memory_check() {
400400
fi
401401

402402
# Monitor memory during load
403-
tg-load-turtle -i "$doc_id" -C "memory-monitored" "$ttl_file" &
403+
tg-load-knowledge -i "$doc_id" -C "memory-monitored" "$ttl_file" &
404404
load_pid=$!
405405

406406
while kill -0 $load_pid 2>/dev/null; do
@@ -504,7 +504,7 @@ grep -n "\.$" file.ttl | head -5 # Check statement terminators
504504
```bash
505505
# Monitor memory usage
506506
free -h
507-
ps aux | grep tg-load-turtle
507+
ps aux | grep tg-load-knowledge
508508

509509
# Split large files if needed
510510
split -l 10000 large-file.ttl chunk_

0 commit comments

Comments
 (0)