Closed cmutel closed 6 months ago
This behaviour is on main
as well.
After finding a match and breaking out of the rules loop, the code does not stop processing the current source flow. It continues to compare this source flow with the remaining target flows. This is why we are getting more than one match for a single source flow.
Should we not allow 1:N mappings at all? I need to keep the for loop as is because we don't know the order of the target flows, but I can remove mappings at the end and keep only the mapping produced by the match rule with higher priority.
This is fixed on main
and randonneur-transformations
.
Should we not allow 1:N mappings at all?
You always get to the heart of the matter... this is a tough question, and my answer is based on my experience on how I have personally and seen others use these mappings. In those cases, a single match is desired.
In the future we could use the randonneur
verb disaggregate
, if needed.
https://github.com/GreenDelta/olca-app/issues/102 has some useful tidbits for this discussion as well.
Note: Using branch "randonneur-transformations"
Using the attached fixtures, and running:
Leads to the following mapping file:
However,
a.json
only had one input record. This should be matched only to the first strategy which produced a match.The synonym match is based on a data error, "sulfate" is not a real synonym for "barite".
a.json b.json