Skip to content

Commit

Permalink
Merge branch 'sdmx-ruleset-error' of https://github.com/InseeFr/Trevas
Browse files Browse the repository at this point in the history
…into sdmx-ruleset-error
  • Loading branch information
NicoLaval committed Jan 18, 2025
2 parents 0fc9bb7 + 630498d commit abb6b32
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions vtl-sdmx/src/main/java/fr/insee/vtl/sdmx/TrevasSDMXUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import io.sdmx.utils.core.io.ReadableDataLocationTmp;

import java.io.InputStream;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Collector;
Expand Down Expand Up @@ -117,12 +118,13 @@ public static Structured.DataStructure buildStructureFromSDMX3(SdmxBeans beans,
}

public static Map<String, DataStructureBean> dataflows(SdmxBeans sdmxBeans) {
return sdmxBeans.getDataflows().stream().collect(Collectors.toMap(
INamedBean::getId,
dataflowBean -> sdmxBeans.getDataStructures(dataflowBean.getDataStructureRef())
.stream()
.collect(toSingleton())
));
return sdmxBeans.getDataflows().stream()
.map(df -> sdmxBeans.getDataStructures(df.getDataStructureRef()))
.flatMap(Collection::stream)
.collect(Collectors.toMap(
dataStructureBean -> dataStructureBean.getId(),
dataStructureBean -> dataStructureBean
));
}

public static Map<String, DataStructureBean> vtlMapping(SdmxBeans sdmxBeans) {
Expand Down

0 comments on commit abb6b32

Please sign in to comment.