Given the following kind of input XML with relationships between Organization and Address, where the second of three Organizations does not have a StreetName in its Address:
and the following kind of RML mapping involving a null-default conditional reference on the subjectMap of a joined parentTriplesMap, in order to avoid creating the relatedAddress instance if certain elements (e.g. StreetName) are absent:
14:49:50.108 [main] ERROR be.ugent.rml.cli.Main .run(420) - Cannot invoke "java.util.Collection.toArray()" because "c" is null
14:49:50.110 [main] ERROR be.ugent.rml.cli.Main .run(457) - Cannot invoke "java.util.Collection.toArray()" because "c" is null
java.lang.NullPointerException: Cannot invoke "java.util.Collection.toArray()" because "c" is null
at java.base/java.util.ArrayList.addAll(ArrayList.java:670)
at be.ugent.rml.Executor.getIRIsWithTrueCondition(Executor.java:464)
at be.ugent.rml.Executor.getIRIsWithConditions(Executor.java:424)
at be.ugent.rml.Executor.generatePredicateObjectGraphs(Executor.java:363)
at be.ugent.rml.Executor.executeWithFunction(Executor.java:178)
at be.ugent.rml.Executor.execute(Executor.java:132)
at be.ugent.rml.cli.Main.run(Main.java:416)
at be.ugent.rml.cli.Main.main(Main.java:49)
Expected
Should result in an output with just twoAddress instances related by the rightOrganization instances (and not the third one which fails the condition and therefore would have a nullsubjectMap leading to no instantiation):
ex:Address_d0e33 a org:Address;
org:streetName "99 Maine St" .
ex:Address_d0e9 a org:Address;
org:streetName "ABC FastCo Lane" .
ex:Organization_123 a org:Organization;
org:address ex:Address_d0e9;
org:name "ABC FastCo" .
ex:Organization_456 a org:Organization;
org:name "XYZ Inc." . # no address relation, correct
ex:Organization_789 a org:Organization;
org:address ex:Address_d0e33;
org:name "MNO Ltd" .
Environment
rmlmapper v.6.3.0, v6.5.1 Linux/WSL2 Java 11, 17
Namespaces
Problem
Given the following kind of input XML with relationships between
Organization
andAddress
, where the second of threeOrganization
s does not have aStreetName
in itsAddress
:and the following kind of RML mapping involving a null-default conditional reference on the
subjectMap
of a joinedparentTriplesMap
, in order to avoid creating the relatedAddress
instance if certain elements (e.g.StreetName
) are absent:Actual
Results in an unexpected null error:
Expected
Should result in an output with just two
Address
instances related by the rightOrganization
instances (and not the third one which fails the condition and therefore would have a nullsubjectMap
leading to no instantiation):Wrong
If one removes the
joinCondition
:the transformation works, but of course results in erroneous output as the child instances are all related by all parents:
Workaround
None. Use v6.2.2 or below to get the right result.
MWE
rml-mwe-conditional-error.zip