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

Datatype for constant value triggers error (yatter v1.1.2) #75

Closed TijnDeWever closed 8 months ago

TijnDeWever commented 8 months ago

Describe the bug Version 1.1.2 of yatter can't translate the following code (version 1.1.0 had no problem with it):

prefixes:
 ex: "http://www.semanticweb.org/tijnd/"
 schema: "https://schema.org/"
 rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 rdfs: "http://www.w3.org/2000/01/rdf-schema#"
 xsd: "http://www.w3.org/2001/XMLSchema#"

sources:
  imdb:
   access: imdb_video_game_rating_modified.csv
   referenceFormulation: csv

mappings:
  Rating:
    sources:
      - imdb
    s: ex:$(title)
    po:
      - [a, schema:Rating]
      - [schema:author, ImDB, rdfs:Literal] 

Error:

2023-12-20 16:19:57,157 | INFO: Translating YARRRML mapping to [R2]RML
2023-12-20 16:19:57,158 | INFO: RML content is created!
2023-12-20 16:19:57,163 | ERROR: ERROR: There is a syntactic error in the generated mapping
2023-12-20 16:19:57,163 | ERROR: at line 49 of <>:
Bad syntax (']' expected) at ^ in:
"...b';\n\t\t];\n\t\trr:objectMap [\n\t\t\ta rr:ObjectMap;\n\t\t\trr:constant ""'^b'ImDB"";\n\t\t\trr:datatype rdfs:Literal\n\t\t];\n\t].\n\n\n'"

When the datatype is removed (like this - [schema:author, ImDB]) the code can be translated successfully by yatter (v.1.1.2). The same YARRRML document (including the datatype) can be translated with Matey.

dachafra commented 8 months ago

I'll look into it! Thanks for the issue :-)

dachafra commented 8 months ago

I think it's solved, we are having some problems with the publication in PyPI so if you want to use it, you'll need to install the engine from the source code.

cd src
python3 setup.py install
TijnDeWever commented 8 months ago

Yes, it works. Thanks (for the quick response)!