An example of RML mapping to transform a JSON dataset to RDF.
RML is a generic scalable mapping language to express transformation of data of heterogeneous formats into RDF data. The RML spec is available here. RML-Mapper is a mapper that read an RML file to transform a non-RDF datasource into RDF.
In this example, we show how to use RML & RML-Mapper to transform a json dataset about roman emperors into an RDF structure.
Get RML-mapper by cloning this repository and update dependencies by executing:
git clone --recursive https://github.com/RMLio/RML-Mapper.git
git submodule update --init --recursive
go into the RML-mapper directory and build it with:
bin/RML-Mapper
RML-Mapper is now ready to work.
Copy the mapping file (roman-emperors.rml file) and the json dataset (roman-emperors.json) into the RML-Mapper folder.
You can generate the RDF file (turtle by default) with this command:
bin/RML-Mapper -m <rml_file> -o <output_file>
For our example:
bin/RML-Mapper -m roman-emperors.rml -o roman-emperors.ttl