triple-loader
provides command line tools and Clojure API for managing Eclipse RDF4J/Sesame repository. Moreover since version 0.1.15 this project provides external Clojure API. Both snapshots and releases - standard jars - are published only on Clojars. Stand-alone (uber) jars will be still published in GitHub.
Leiningen/Boot:
[adalab/triple-loader "0.2.3"]
The software development was supported by CHIST-ERA (Call 2013 – AMCE), with funding from EPSRC (Grant no. EP/M015661/1; AdaLab).
The AdaLab project web page can be found at: http://www.adalab-project.org/.
All API documentation is available at https://jgrzebyta.github.io/triple-loader/.
java -cp triple-loader-standalone.jar <command> <options>
Loads data into triple store.
- –server URL, -s
- Sesame SPARQL endpoint URL. Default: http://localhost:8080/rdf4j-server
- –repositiry NAME, -r
- Repository id. Default: test
- –file FILE, -f
- Data file path
- –context IRI, -c
- Context (graph name) of the dataset. If FILE’s format is context-aware (e.g. TriG) than this option is ignored.
- –version, -V
- Print version number
- –help, -h
- Help
Populate triple store at http://localhost:8090/rdf4j-server/test
with data from two files.
java -cp triple-loader-standalone.jar rdf4j.loader -s http://localhost:8090/rdf4j-server/ -r test -f ~/database/data1.ttl -f ~/database/data2.ttl
Executes SPARQL query on data provided by file. The query is executed among different types of repository: `simple`, `lucene` and `native`
- –file FILE, -f
- Data file path.
- –query STRING, -q
- Path to file with query or the query itself.
- –formaT, -t
- Format of SPARQL query resut. Option ‘-t help’ gives full list of supported formats.
By default writers formats are
sparql/tsv
andtrig
fortuple query
andgraph query
respectively. - –repository -r
- Local repository settings. Possible options:
simple
,lucene
,native
. - –version, -v
- Print version number.
- –bind, -b
- Accepts set of properties as SPARQL bindings. Given values are parsed to literal.
- –help, -h
- Help.
Process SPARQL request select * where {?s ?p ?o} limit 10
on data located in two files.
java -cp triple-loader-standalone.jar rdf4j.sparql -f ~/database/data1.ttl -f ~/database/data2.ttl -q "select * where {?s ?p ?o} limit 10"
Process SPARQL request from file ~/database/process.sparql
on data located in two files.
java -cp triple-loader-standalone.jar rdf4j.sparql -f ~/database/data1.ttl -f ~/database/data2.ttl -q ~/database/process.sparql
Process SPARQL request from file ~/database/process.sparql
on data located in two files and print results in sprarql/json
format.
java -cp triple-loader-standalone.jar rdf4j.sparql -f ~/database/data1.ttl -f ~/database/data2.ttl -q ~/database/process.sparql -t sparql/json
Process SPARQL request with binding
java -cp triple-loader-standalone.jar rdf4j.sparql -f tests/resources/beet.rdf -t sparql/csv -q "select ?s ?country where {?s <file:/tmp2/beet-1.csvCountries> ?country}" -b "country=Poland"
Creates remote repository dump file in TriG format. rdf4j.loader function is suitable for restoring triple.
- –help, -h
- Help
- –server URL, -s
- RDF4J SPARQL endpoint URL, default
http://localhost:8080/rdf4j-server
- –repositiry NAME, -r
- Repository id, default:
test
- –file FILE, -f
- Data file path or standard output if not given
- –version, -V
- Display program version
Dump http://localhpost:8090/rdf4j-server/test
repository to standard output.
java -cp triple-loader-standalone.jar rdf4j.dump -s http://localhpost:8090/rdf4j-server -r test
Dump http://localhpost:8090/rdf4j-server/test
repository to /tmp/test-repo.trig
file.
java -cp triple-loader-standalone.jar rdf4j.dump -s http://localhpost:8090/rdf4j-server -r test -f /tmp/test-repo.trig
Converts RDF files among different formats. It supports following formats: ntriples, n3, turtle, rdfjson, rdfxml, trig, trix, nquads, jsonld and binary.
- –help, -h
- Print this screen
- –version, -V
- Display version
- –input FORMAT, -i
- Input format. Available formats: ntriples, n3, turtle, rdfjson, rdfxml, trig, trix, nquads, jsonld, binary
- –output FORMAT, -o
- Output format. Available formats: ntriples, n3, turtle, rdfjson, rdfxml, trig, trix, nquads, jsonld, binary
Convert turtle file to rdfxml
java -cp triple-loader-standalone rdf4j.convert -i turtle -o rdfxml tests/resources/yeastract_raw.ttl
Convert turtle file to trig
java -cp triple-loader-standalone rdf4j.convert -i turtle -o trig tests/resources/yeastract_raw.ttl
To contact with me please use Issues interface.