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

Package inconsistency between versions. Error: 'str' object has no attribute 'get' in yatter 1.1.4 #83

Closed TheRazorace closed 1 month ago

TheRazorace commented 1 month ago

The following YARRRML excerpt does work with Yatter v1.1.0 (Python 3.9), but does not work with Yatter v1.1.4 (tested with Python 3.9 and Python 3.12), even though the syntax is the same and seems correct, according to documentation.

Error: The YARRRML mapping has not been translated. 'str' object has no attribute 'get'

prefixes:
    mlso: http://w3id.org/mlso/
    mls: http://www.w3.org/ns/mls#
    rdfs: http://www.w3.org/2000/01/rdf-schema#

sources:
  evaluations_meta: ['/evaluations_meta.json~jsonpath', '$.*']

mappings:
    evaluationMeasureDatatype:
      sources:
        - evaluations_meta
      s: http://w3id.org/rexpek-kg/thermal_uc_v1/evaluationMeasure/$(name)/characteristic/datatype
      po:
        - [a, mlso:EvaluationMeasureCharacteristic]
        - [rdfs:label, Datatype, rdfs:Literal]
        - [mls:hasValue, $(datatype), rdfs:Literal]
dachafra commented 1 month ago

Hi @TheRazorace, I think I found the problem and fixed it in dev branch, could you test it?

TheRazorace commented 1 month ago

Thanks for the reply @dachafra! I can confirm that the problem is solved using the fix in the dev branch :)