From e5bffc4e3fcf18be239029addefd5dac5da12df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Henninger?= Date: Fri, 7 Jun 2024 16:50:22 +0200 Subject: [PATCH] New pairwise link group (from new DDI modelisation) is ignored --- .../src/main/java/fr/insee/kraftwerk/core/Constants.java | 1 + .../java/fr/insee/kraftwerk/core/metadata/DDIReader.java | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/kraftwerk-core/src/main/java/fr/insee/kraftwerk/core/Constants.java b/kraftwerk-core/src/main/java/fr/insee/kraftwerk/core/Constants.java index e50b2233..78ea0e2b 100644 --- a/kraftwerk-core/src/main/java/fr/insee/kraftwerk/core/Constants.java +++ b/kraftwerk-core/src/main/java/fr/insee/kraftwerk/core/Constants.java @@ -122,6 +122,7 @@ private Constants() {} public static final String BOUCLE_PRENOMS = "BOUCLE_PRENOMS"; public static final String LIEN = "LIEN_"; public static final String LIENS = "LIENS"; + public static final String PAIRWISE_GROUP_NAME = "LIENS"; public static final String SAME_AXIS_VALUE = "0"; public static final String NO_PAIRWISE_VALUE = "99"; diff --git a/kraftwerk-core/src/main/java/fr/insee/kraftwerk/core/metadata/DDIReader.java b/kraftwerk-core/src/main/java/fr/insee/kraftwerk/core/metadata/DDIReader.java index 9173d767..83c84fdb 100644 --- a/kraftwerk-core/src/main/java/fr/insee/kraftwerk/core/metadata/DDIReader.java +++ b/kraftwerk-core/src/main/java/fr/insee/kraftwerk/core/metadata/DDIReader.java @@ -114,6 +114,13 @@ private static MetadataModel readVariables(Path variablesFilePath) String groupName = groupElement.getAttribute("name"); String parentGroupName = groupElement.getAttribute("parent"); + // To be normalized later : we don't want to create a group of variables for pairwise links. + // Pairwise links scope are the individuals + if (groupName.equals(Constants.PAIRWISE_GROUP_NAME)){ + // Instead we assign temporarily the variables inside pairwise links group to the root group + getVariablesInGroup(metadataModel.getVariables(), groupNode, metadataModel.getRootGroup(), metadataModel.getSequences()); + continue; + } // Store the group Group group;