Skip to content

jgrzebyta/triple-loader

Repository files navigation

triple loader

https://travis-ci.org/jgrzebyta/triple-loader.svg?branch=master

https://img.shields.io/clojars/v/adalab/triple-loader.svg

1. What is that?

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"]

1.1. Acknowledgements

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/.

2. API Documentation

All API documentation is available at https://jgrzebyta.github.io/triple-loader/.

3. Command line tools

java -cp triple-loader-standalone.jar <command> <options>

Commands

rdf4j.loader

Loads data into triple store.

Options

–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

Examples

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

rdf4j.sparql

Executes SPARQL query on data provided by file. The query is executed among different types of repository: `simple`, `lucene` and `native`

Options

–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 and trig for tuple query and graph 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.

Examples

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"

rdf4j.dump

Creates remote repository dump file in TriG format. rdf4j.loader function is suitable for restoring triple.

Options

–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

Examples

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

rdf4j.convert

Converts RDF files among different formats. It supports following formats: ntriples, n3, turtle, rdfjson, rdfxml, trig, trix, nquads, jsonld and binary.

Options

–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

Examples

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

4. Build server

5. Contacts

To contact with me please use Issues interface.

About

Framework and CL tools for hight throughput manipulation on RDF statements (triples and quads).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published