anuzzolese / pyrml

pyRML is a Python based engine for processing RML files. The RDF Mapping Language (RML) is a mapping language defined to express customized mapping rules from heterogeneous data structures and serializations to the RDF data model. RML is defined as a superset of the W3C-standardized mapping language R2RML, aiming to extend its applicability and broaden its scope, adding support for data in other structured formats.
Apache License 2.0
33 stars 12 forks source link

Foreign key resolution with CSV #1

Open Martijn-Y-ai opened 3 years ago

Martijn-Y-ai commented 3 years ago

I noticed an issue with mapping CSVs, where if different CSV files use the same column name as primary key, then the foreign key resolution fails.

To reproduce, simply rename the CODE column in the artist example to ID, in both the CSV and artist-map.ttl.

The output becomes:

ns1:rna29 a ns1:Person ;
    ns1:birth_date "1929-12-06" ;
    ns1:birth_place ns1:rna29 ;
    ns1:fullName "Ronald Anderson" .

ns1:rtm19 a ns1:Person ;
    ns1:birth_date "1919-12-23" ;
    ns1:birth_place ns1:rtm19 ;
    ns1:fullName "Robert Theodore McCall" .

As you can see, the birth_place objects are incorrect, as they refer to the artists themselves, instead of the places.