Repeated XML `NUTS` elements not creating mapping from JSON vocabulary
schivmeister opened this issue · 3 comments
Environment
rmlmapper v6.2.2 (reproducible also as far back as v6.1.3 and even older)
Linux/WSL2
Java 11
Problem
Given the following kind of input XML:
<OBJECT>
<NUTS CODE="DE"/>
<NUTS CODE="DE8"/>
<NUTS CODE="DE80"/>
<NUTS CODE="DE803"/>
</OBJECT>
and the following kind of subject mapping:
tedm:nuts a rr:TriplesMap ;
rml:logicalSource
[
rml:source "resources/nuts.json" ;
rml:iterator "$.results.bindings[*]" ;
rml:referenceFormulation ql:JSONPath
] ;
rr:subjectMap
[
rml:reference
"conceptURI.value" ;
] .
and the following kind of predicate-object mapping:
rr:predicateObjectMap
[
rr:predicate epo:hasNutsCode ;
rr:objectMap
[
rr:parentTriplesMap tedm:nuts;
rr:joinCondition [
rr:child "*:NUTS/@CODE";
rr:parent "code.value";
];
] ;
] ;
with the following kind of value mapping vocabulary in JSON
format:
{
"code": {
"type": "literal",
"value": "DE803"
},
"conceptURI": {
"type": "uri",
"value": "http://data.europa.eu/nuts/code/DE803"
}
},
Actual
Results in no mapping created for epo:hasNutsCode
.
Expected
Should result in as many instances of epo:hasNutsCode
with values as there are NUTS
elements with CODE
values, matching terms in the given vocabulary nuts.json
.
epo:hasNutsCode <http://data.europa.eu/nuts/code/DE> ,
<http://data.europa.eu/nuts/code/DE8> ,
<http://data.europa.eu/nuts/code/DE80> ,
<http://data.europa.eu/nuts/code/DE803> .
Workaround
Removing all but one NUTS
element results in a successful mapping of epo:hasNutsCode
.
Input:
<OBJECT>
<NUTS CODE="DE803"/>
</OBJECT>
Output:
epo:hasNutsCode <http://data.europa.eu/nuts/code/DE803> .
MWE
Context
This was discovered while troubleshooting #226, a result reproducibility issue pertaining to the mapping of OP TED XML notices to generate RDF.
P.S: The issue described in #226 for reproduction actually is about a partial, incomplete original result, i.e. multiple values created only one mapping, which is no longer reproducible (as in turn evidenced in this ticket).
Did anyone manage to reproduce this? What could be the cause for this behavior?
Can someone confirm that this is a bug (perhaps a regression)?
Dear developers,
Is there any chance that you can look at this problem in the near future? We would like to know if this is indeed a bug, and if yes, is it going to be fixed or not.
Thank you!