Skip to content

kg-construct/rml-test-cases

Repository files navigation

RML Test Cases

The RML test cases are used to determine the conformance to the RML specification of tools that execute RML rules.

In the folder test-cases you can find the different test cases. Each test case is contained in a single folder, containing three types of files:

  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • Zero or one file with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF.

The details about the test cases cases are also available as a knowledge graph in metadata.nt. The knowledge graph is generated by executing the RML rules in rules.ttl, available as YARRRML in rules.yml. The data source used by the rules is metadata.csv.

Getting the RDF metadata

The metadata RDF is generated based on the metadata.csv file and the rules.yml YARRRML file, you can use following commands to re-generate them.

curl -L https://github.com/RMLio/rmlmapper-java/releases/download/v6.0.0/rmlmapper-6.0.0-r363-all.jar -o rmlmapper.jar # Feel free to use the latest release at https://github.com/RMLio/rmlmapper-java/releases
npm i -g @rmlio/yarrrml-parser
yarrrml-parser -i rules.yml -o rules.ttl -p # If the rules file changed
java -jar ./rmlmapper.jar -m ./rules.ttl -o ./metadata.nt
java -jar ./rmlmapper.jar -m ./rules.ttl -o ./metadata.hdt -s hdt

Documentation

A website describing the test cases is available in docs. The website is generated by doing the following:

  1. Install node.js dependencies: npm i
  2. Run Eleventy: npx eleventy
  3. Find the website in the folder _site

Snapshots of the website can be found in snapshots.

License

This code is copyrighted by Ghent University – imec and released under the Creative Commons Attribution 4.0 International License.