Command-Line Program to Execute RML Mappings

HeFQUIN comes with its own RML processor. The primary use of this RML processor is to create ephemeral RDF representations of non-RDF data obtained from some types of federation members at query runtime (e.g., from JSON-based Web APIs). However, for debugging purposes we also provide a command-line program called hefquin-rmlmat via which the RML processor of HeFQUIN can be used to execute an RML mapping and save the resulting RDF data into a file. This page describes how to use this program. There are related pages that describe the specifics of RML support in HeFQUIN and how to set up the command-line programs.

The core functionality of the hefquin-rmlmat program is to read an RDF file that describes an RML mapping, to apply this mapping to the source data files mentioned in the mapping, and to print out the RDF data produced by the previous step. For the moment, only JSON files are supported as source data files.

You can use the program as follows, assuming the file that contains your RML mapping is called MyMapping.ttl, and assuming that you have added the HeFQUIN programs to your PATH (otherwise, enter the directory in which you have unpacked the HeFQUIN release and replace hefquin-rmlmat by bin/hefquin-rmlmat). When using the program in this way, the resulting RDF data will be written to stdout.

hefquin-rmlmat --mapping MyMapping.ttl

Further arguments can be passed to the program, which are described in detail below. You can also have the list of supported arguments printed by executing the program with the argument --help.

hefquin-rmlmat --help

RML-Specific Arguments of the Program

--mapping <file> (mandatory argument)

Refers to an RDF file that describes the RML mapping; hence, the file must contain rml:TriplesMap definitions. Every rml:TriplesMap found in the file will be used for the materialization. Supported serialization formats for the given RDF file include Turtle, RDF/XML, JSON-LD and N-Triples.

--baseIRI <iri>

Use this argument to provide the base IRI to be used for the mapping process. If not provided, an internal default base IRI is used.

Output-Related Arguments of the Program

--output <format>

Use this argument to specify the format in which the RDF output should be serialized. If the specified format supports streaming, the output is streamed. Otherwise, the output is produced using a non-streaming writer.

The --output, --formatted and --stream arguments are mutually exclusive.

--formatted <format>

Use this argument to specify the format in which the RDF output should be serialized using pretty printing. This option uses a non-streaming writer and therefore consumes memory while producing the output.

--stream <format>

Use this argument to specify the format in which the RDF output should be serialized using a streaming writer. This option is useful for producing output without keeping the entire RDF dataset in memory.

Supported Output Formats

The following formats are supported:

The --output and --formatted arguments support all of the formats listed above. The --stream argument supports Turtle, N-Triples, N-Quads, TriG, TriX, RDF-THRIFT and RDF-PROTO.

--compress

Use this argument to compress the RDF output using GZIP.

--outputToFile <file>

Use this argument if you want the produced RDF data to be written into a file. If this argument is omitted, the result is written to stdout. If the given file already exists, it will be overwritten.

Experiments-Related Arguments of the Program

--time

Use this argument to print the total time spent in the core materialization phase (mapping execution + RDF generation).

Other Arguments of the Program

--help

If this argument is given, the program prints a list of all supported arguments and terminates (i.e., all other given arguments are ignored).