oeg-upm / yatter

Translate YARRRML into easy-to-read [R2]RML mappings
https://doi.org/10.5281/zenodo.7024500
Apache License 2.0
22 stars 6 forks source link

yarrrml keyword graph is supported, but is not part of yarrrml spec #78

Closed x-m-el closed 7 months ago

x-m-el commented 7 months ago

Describe the bug Given a yarrrml which includes a graph defined as graph: https://example.com/$(id), yatter will convert this correctly, even though yarrrml does not support the keyword graph, instead graphs should be used (see https://rml.io/yarrrml/spec/#graphs)

To Reproduce

mappings:
  test:
    graph: https://example.com/$(id)
    s: https://example.com/$(id)
    po:
      - [a, ext:Test]

Will convert correctly to rml, even though graph is not a valid keyword.

Additional context This is not a big problem, as still parsing correctly while containing a typo, can be seen as a feature. It did cause confusion when using morph_kgc, which had a different output for the given yarrrml (using graph) versus the converted rml file with yatter (which has correct syntax). => this might have been a fluke, but the comment still remains correct.

dachafra commented 7 months ago

Hi! YARRRML spec is not totally complete, and for some cases I also used the test-cases used by the reference formulation (yarrrrml-parser). You can see an example in this file: https://github.com/oeg-upm/yatter/blob/main/test/yarrrml-parser-tests/graph/mapping.yml. This mapping also works in Matey/YARRRML-parser

Maybe it’s good to open an issue in the yarrrml spec: https://github.com/kg-construct/yarrrml-spec

x-m-el commented 7 months ago

This could also mean that RMLio/yarrrml-parser implemented the spec incorrectly. What is the reason that you'd see this as an error in the spec (where the spec should also allow usage of graph), instead of an error in this other parser?

dachafra commented 7 months ago

I'm part of the team creating the new RML ontology and its extensions, so I'm aware of the status of all specs. Additionally, yarrrml-parser is the reference implementation of the spec (yarrrml and yarrrml-parser were created by IDLab at Ghent U. in parallel) so that is why I asked to better open and issue there, bc we will take into account and review the spec.