The tool translates mapping rules from YARRRML in a turtle-based serialization of RML or R2RML.
pip install yatter
To execute from command line run the following:
From YARRRML to [R2]RML
python3 -m yatter -i path_to_input_yarrrml.yml -o path_to_rdf_mapping.ttl [-f R2RML]
From [R2]RML to YARRRML
python3 -m yatter -i path_to_input_rdf_mapping.ttl -o path_to_output_yarrrml.yml [-f R2RML]
-f R2RML
is an optional parameter for translating input YARRRML to R2RML (and inverse)
If you want to include the module in your implementation:
import yatter
from ruamel.yaml import YAML
# YARRRML to RML
yaml = YAML(typ='safe', pure=True)
rml_content = yatter.translate(yaml.load(open("path-to-yarrrml")))
# RML to YARRRML
yarrrml_content = yatter.inverse_translate("rdf_mapping_content")
import yatter
from ruamel.yaml import YAML
R2RML_URI = 'http://www.w3.org/ns/r2rml#'
yaml = YAML(typ='safe', pure=True) rml_content = yatter.translate(yaml.load(open("path-to-yarrrml")), mapping_format=R2RML_URI)
yarrrml_content = yatter.inverse_translate("rdf_mapping_content", mapping_format=R2RML_URI)
- for merging TriplesMap based on id:
```python
import yatter
list_yarrrml_mappings = ["content_mapping_yarrrml1", "content_mapping_yarrrml1"]
yarrrml_content = yatter.merge_mappings(list_yarrrml_mappings)
These are the following specifications used by the translation process:
To be implemented soon:
If you used Yatter in your work, please cite the ICWE2023 paper:
@inproceedings{iglesias2023human,
title={Human-Friendly RDF Graph Construction: Which One Do You Chose?},
author={Iglesias-Molina, Ana and Chaves-Fraga, David and Dasoulas, Ioannis and Dimou, Anastasia},
booktitle={International Conference on Web Engineering},
pages={262--277},
year={2023},
doi={10.1007/978-3-031-34444-2_19},
organization={Springer}
}
Ontology Engineering Group: