RMLio / yarrrml-parser

A YARRRML parser library and CLI in Javascript
MIT License
41 stars 17 forks source link

Language tag not working when followed by a condition function #142

Closed ritamargherita closed 2 years ago

ritamargherita commented 2 years ago

Issue type: :bug: Bug

Description

Following what advised in issue #141, I am not able to add the language tag when there is a condition function after.

The following works and adds correctly the language tag:

mappings:
  cbs:
    sources:
      - ['data.xml~xpath', '/Dataontwerpversies/Versie/Dataontwerp']
    s: cbs:$(Id)
    po:
      - [a, disco:LogicalDataSet]
      - [cbs:dataDesignGroupPath, $(Dataontwerpgroeppad), nl~lang]
      - [cbs:description, $(Beschrijving), nl~lang]
      - [cbs:abbreviatedNameData, $(VerkorteSchrijfwijzeNaamDataontwerp), nl~lang]
      - [cbs:descriptionOfThePopulation, $(BeschrijvingVanDePopulatie), nl~lang]
      - predicates: cbs:methodology
        objects:
            value: $(GebruikteMethodologie)
            language: nl

but when adding a condition function, like below, then it doesn't.

mappings:
  cbs:
    sources:
      - ['data.xml~xpath', '/Dataontwerpversies/Versie/Dataontwerp']
    s: cbs:$(Id)
    po:
      - [a, disco:LogicalDataSet]
      - [cbs:dataDesignGroupPath, $(Dataontwerpgroeppad), nl~lang]
      - [cbs:description, $(Beschrijving), nl~lang]
      - [cbs:abbreviatedNameData, $(VerkorteSchrijfwijzeNaamDataontwerp), nl~lang]
      - [cbs:descriptionOfThePopulation, $(BeschrijvingVanDePopulatie), nl~lang]
      - predicates: cbs:methodology
        objects:
            value: $(GebruikteMethodologie)
            language: nl
        condition:
          function: idlab-fn:notEqual
          parameters:
            - [grel:valueParameter, $(GebruikteMethodologie)]
            - [grel:valueParameter2, ""]

Any thoughts about this behaviour? Or am I adding the language not correctly?

bjdmeest commented 2 years ago

It seems very much correct, but I see that in the RML mappings, the language tag isn't added, so this seems to be a bug in the YARRRML parser, thanks for finding it! PR #143 is pending to fix this issue! :)

mvanbrab commented 2 years ago

Shouldn't this issue be closed (+ related issue #141), given release notes of v1.3.3?