Lutra is our open source (LGPL licence) reference implementation of the OTTR language. Lutra can read and write OTTR templates and instances on different serialisation formats, and expand instances into regular RDF graphs or OWL ontologies. Lutra is written in Java and is available as a command line interface, and as feature limited version web application: https://weblutra.ottr.xyz/

This is the command line interface of Lutra:

java -jar lutra.jar --version java -jar lutra.jar --help

0.6.4 Usage: lutra [-fhV] [--quiet] [--stdout] [--haltOn=<haltOn>] [-F=<fetchFormat>] [-I=<inputFormat>] [-L=<libraryFormat>] [-m=<mode>] [-o=<out>] [-O=<outputFormat>] [-e=<extensions>[,<extensions>...]]... [-E=<ignoreExtensions>[,<ignoreExtensions>...]]... [-l=<library>]... [<inputs>...] DESCRIPTION: Tool for working with OTTR Templates, for expanding instances and template definition, translating between different formats and for checking the integrity of a template library. PARAMETERS: [<inputs>...] Files of instances to which operations are to be applied. OPTIONS: --haltOn=<haltOn> Halt on messages with a severity equal to or below the flag. (legal values: 3=INFO, 2=WARNING, 1=ERROR, 0=FATAL; default: 1) --quiet Suppress all messages, including errors and warnings. (default: false) --stdout Print result of operations to standard out. (default: false) -e, --extension=<extensions>[,<extensions>...] File extension of files to use as input to template library. (default: []) -E, --ignoreExtension=<ignoreExtensions>[,<ignoreExtensions>...] File extensions of files to ignore as input to template library. (default: []) -f, --fetchMissing Fetch missing template dependencies. It is here assumed that templates' definitions are accessible via their IRI, that is, the IRI is either a path to a file, a URL, or similar. (default: false) -F, --fetchFormat=<fetchFormat> The input format of the templates fetched via the -f flag. -h, --help Show this help message and exit. -I, --inputFormat=<inputFormat> Input format of instances. (legal values: legacy, wottr, stottr, tabottr default: wottr) -l, --library=<library> Folder containing templates to use as library. Can be used multiple times for multiple libraries. -L, --libraryFormat=<libraryFormat> The input format of the libraries. If omitted, all available formats are attempted. (legal values: stottr, legacy, wottr) -m, --mode=<mode> The mode of operation to be applied to input. (legal values: expand, expandLibrary, format, formatLibrary, lint; default: expand) -o, --output=<out> Path to which output from operations are to be written. -O, --outputFormat=<outputFormat> Output format of output of operation defined by the mode. (legal values: legacy, stottr, wottr; default: wottr) -V, --version Print version information and exit. EXAMPLES: The following command reads all .ttl and .owl-files in ./lib as a template library and checks its intergrity: lutra -L wottr -m lint -l ./lib -e "ttl,owl" The following translates all template files (with .ttl-extension) in ./lib from the legacy format to wottr, and writes them to ./wottr: lutra -L legacy -O wottr -m formatLibrary -l ./lib -o ./wottr The following expands all instances in ins1.xlsx and ins2.xlsx in tabOTTR using the templates in ./baselib and ./domain and writes the expanded instances to exp.ttl in the wOTTR format: lutra -I tabottr -O wottr -m expand -l ./baselib -l ./domain -o exp.ttl ins1.xlsx ins2.xlsx DISCUSSION: Note that with -O wottr all triple-instances outside of template definitions are written as normal RDF triples, thus to expand a set of instances into an RDF graph this is what should be used. When a set of template definitions are written with -o <fpath>, each template will be writen to a folder path of the form <fpath>/<tpath>/<name>.ttl, where <tpath> is the path-part of the template's IRI, and <name> is the fragment of the IRI. E.g. with -o ./templates, the template with IRI http://example.org/draft/owl/SubclassOf will be written to the path ./templates/draft/owl/SubclassOf.ttl. Note that one can omit giving a format for libraries. In this case all possible formats are attempted, and the first to succeed for each library is used for that library. However, all files within one library needs to be of the same format, but different libraries can have files of different formats. FURTHER INFORMATION: Website: https://ottr.xyz Source: https://gitlab.com/ottr/lutra/lutra REPORTING BUGS: Please report any bugs as issues to our Git repository at https://gitlab.com/ottr/lutra/lutra/issues.