RMLio / yarrrml-parser

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

Object type 'iri' discarded as of second source in a mapping that has multiple sources #137

Closed mvanbrab closed 3 years ago

mvanbrab commented 3 years ago

Issue type: :bug: Bug

Description

When defining a mapping that contains a type specification ~iri for the object, that type specification is discarded as of the second source.

Example input (see also file fx.yarrrml.yml in attached zip):

prefixes:
  ex: "http://example.com/ex/"

mappings:
  m1:
    sources:
      - ['f1.csv~csv']
      - ['f2.csv~csv']
    s: ex:$(Id)
    po:
      - [ex:myProperty, ex:myObject~iri]

Example yarrrml-parser output (partial copy from file fx.rml.ttl in attached zip) - the last rr:Literal should have been rr:IRI:

(...)
:om_000 a rr:ObjectMap;
    rr:constant "http://example.com/ex/myObject";
    rr:termType rr:IRI.
(...)
:om_001 a rr:ObjectMap;
    rr:constant "http://example.com/ex/myObject";
    rr:termType rr:Literal.

Example rmlmapper output (for reference only): see file fx.generated.ttl in attached zip.

Steps

Expand attached zip.

Run the commands a shown in file fx.sh. This file assumes an installed yarrrml-parser and rml-mapper at the locations shown in the variable declarations on top of that file. File fx.log shows the console output of my run.

Environment

Platform: Distributor ID: Ubuntu Description: Ubuntu 18.04.5 LTS Release: 18.04 Codename: bionic

Java: openjdk version "14.0.2" 2020-07-14 OpenJDK Runtime Environment Zulu14.29+23-CA (build 14.0.2+12) OpenJDK 64-Bit Server VM Zulu14.29+23-CA (build 14.0.2+12, mixed mode, sharing)

Node: v14.16.1

yarrrml-parser: 1.3.1

rml-mapper: rmlmapper-4.12.0.jar

Attachments

attachment.zip