Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save cristianvasquez/846c8288d2bdebec467748ca2763157c to your computer and use it in GitHub Desktop.

Select an option

Save cristianvasquez/846c8288d2bdebec467748ca2763157c to your computer and use it in GitHub Desktop.
RML Command line

Transform using RML

Get the mappings

First, clone or download this repository

git clone https://github.com/OP-TED/ted-rdf-mapping-eforms.git

Install Java

Ensure that Java is installed on your machine.

Download the RML Mapper

Download the RML Mapper .jar file from the following link:

rmlmapper-6.2.2-r371-all.jar

This is the engine used to execute the mappings in this repository

Transforming One Notice

Prepare the Notice

The transformation is performed using the rmlmapper.jar file, applying the transformation rules located in the directory:

mappings/package_cn_v1.9/transformation/mappings

This directory contains several Turtle files, with rules grouped roughly by entity. The rules look for a specific input file that contains the notice, called source.xml.

To do a mapping:

  1. Copy the notice XML file to the data directory with the name source.xml:
cp path/to/your/notice.xml mappings/package_cn_v1.9/data/source.xml

Run the Mapper

Navigate to the directory containing the transformation mappings:

Run the RML mapper with the following command:

java -jar rmlmapper-6.2.2-r371-all.jar -m transformation/mappings/** -s turtle -o output.ttl
  • -m transformation/mappings/** specifies that the mappings are used together.
  • The results will be written to output.ttl.
  • from the /workspaces/ted-rdf-mapping-eforms/mappings/package_cn_v1.9 directory

Script for Multiple Notices

For transforming multiple notices, you can use a script.

@TODO

Feel free to explore the script for a more automated approach to processing multiple notices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment