Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change YARRRML translator to yatter #142

Open
Aklakan opened this issue Feb 20, 2023 · 4 comments
Open

Change YARRRML translator to yatter #142

Aklakan opened this issue Feb 20, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Aklakan
Copy link

Aklakan commented Feb 20, 2023

First of all, thanks for the work of providing this excellent resource.

Describe the bug

The mapping files such as

rr:constant "http://vocab.gtfs.org/terms#StopTime";
includes combinations of properties/values that seem to be in violation of the R2RML spec:

:om_0 a rr:ObjectMap;
    rr:constant "http://vocab.gtfs.org/terms#StopTime";
    rr:termType rr:IRI.

7.1 Constant RDF Terms states:

The constant value of a constant-valued term map is the RDF term that is the value of its rr:constant property.

7.4 IRIs, Literal, Blank Nodes states:

The term type of a column-valued term map or template-valued term map determines the kind of generated RDF term (IRIs, blank nodes or literals).

Note that it does not mention constant-valued term maps.
My interpretation is therefore that that rr:termType is not intended to alter the value of an rr:constant.

Obviously, the mapping can be simply written as

:om_0 a rr:ObjectMap;
    rr:constant <http://vocab.gtfs.org/terms#StopTime>.

I am raising this issue because we stated evaluation of another R(2R)ML system which complained about some of the mapping files for the described reason.

@dachafra
Copy link
Member

Thanks for using the benchmark and also pointing this!

Indeed, it's a bug during the translation from YARRRML to RML with YARRRML-parser. See this issue.

I took the gtfs-csv.yaml and translate it with our new translator https://github.com/oeg-upm/yatter. Can you take a look and see if it resolves your current problem? mapping.txt

@dachafra dachafra self-assigned this Feb 20, 2023
@dachafra
Copy link
Member

Assuming the issue has been solved... Let's change mappings to be translated with YATTER

@dachafra dachafra added the enhancement New feature or request label Feb 28, 2023
@dachafra dachafra changed the title Mixing rr:constant "string" with rr:termType rr:IRI seems to violate R2RML spec. Change YARRRML translator to yatter Feb 28, 2023
@Aklakan
Copy link
Author

Aklakan commented Mar 3, 2023

We just used a simple sparql update statement to fix it.
I just tested with your mapping.txt file and it looks fine. If with yatter in the future the mappings work out of the box then just the better :)

For reference, this was our quick fix:

# Uses jena's update 
update --data mapping.json.nt --dump "prefix rr: <http://www.w3.org/ns/r2rml#> DELETE {?s rr:constant ?c ; rr:termType rr:IRI} INSERT {?s rr:constant ?uri} WHERE {?s rr:constant ?c ; rr:termType rr:IRI filter(isliteral(?c)) BIND(URI(?c) AS ?uri) }" > fixed.ttl

@dachafra
Copy link
Member

dachafra commented Mar 4, 2023

Great! Thanks for using the benchmark :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants