RMLio / yarrrml-parser

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

~iri is not applied to an object with value as template reference #185

Closed Melchyore closed 1 year ago

Melchyore commented 1 year ago

Issue type: :bug: Bug

Description

Hi, I want to add the IRI type to an object's value (which is only a reference template), but it's always parsed as string. It works on Matey but not on Yarrrml-Parser.

Steps

Yarrrml:

prefixes:
    odrl: http://www.w3.org/ns/odrl/2/
    xsd: http://www.w3.org/2001/XMLSchema#
    rdfs: http://www.w3.org/2000/01/rdf-schema#
    rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
    this: https://example.com/

mappings:
  policy:
    sources:
      - [input~csv]
    s: $(uid)
    po:
      - [a, $(type)~iri]
      - [odrl:profile, $(profile)~iri]

Data:

type,uid,profile
http://www.w3.org/ns/odrl/2/Agreement,https://example.com/agreement_01,http://w3id.com/occe

Expected result:

<https://example.com/agreement_01> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/odrl/2/Agreement> .
<https://example.com/agreement_01> <http://www.w3.org/ns/odrl/2/profile> <http://w3id.com/occe> .

Actual result:

<https://example.com/agreement_01> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/odrl/2/Agreement> .
<https://example.com/agreement_01> <http://www.w3.org/ns/odrl/2/profile> "http://w3id.com/occe" .

Environment

Windows 10 Yarrrml-parser latest version

Thank you!

Melchyore commented 1 year ago

Ok, seems like the bug comes from RocketRML (I think they're using an old version of this package).