Skip to content

Latest commit

 

History

History
85 lines (66 loc) · 1.86 KB

File metadata and controls

85 lines (66 loc) · 1.86 KB

TriplyDB File Upload -- Java

Java reference implementation for uploading files to TriplyDB using the TUS resumable upload protocol.

Requirements

  • Java 11+
  • Maven 3.6+

Setup

# Build the executable JAR
./build.sh

This compiles the source and creates target/triplydb-uploader-1.0.0.jar with all dependencies bundled.

Usage

Via wrapper script

./upload.sh \
  --file path/to/data.ttl \
  --account your-account \
  --dataset your-dataset \
  --token YOUR_API_TOKEN

Via JAR directly

java -jar target/triplydb-uploader-1.0.0.jar \
  --file path/to/data.ttl \
  --account your-account \
  --dataset your-dataset \
  --token YOUR_API_TOKEN

With optional parameters

./upload.sh \
  --file path/to/data.nt \
  --account your-account \
  --dataset your-dataset \
  --token YOUR_API_TOKEN \
  --api-url http://api.triplydb.local \
  --default-graph "http://example.org/my-graph" \
  --overwrite-all

Parameters

Parameter Required Description
--file Yes Path to the file to upload
--account Yes TriplyDB account name
--dataset Yes TriplyDB dataset name
--token Yes TriplyDB API token
--api-url No API URL (default: https://api.triplydb.com)
--default-graph No Default graph name for imported triples
--overwrite-all No Overwrite all existing graphs in the dataset
--merge-graphs No Merge data into existing graphs

Dependencies

Library Version Purpose
OkHttp 4.12.0 HTTP client
Jackson 2.16.1 JSON parsing
tus-java-client 0.5.1 TUS protocol

Project Structure

java/
├── pom.xml
├── build.sh
├── upload.sh
├── README.md
└── src/main/java/com/triply/upload/
    └── TriplyDBUploader.java