diff --git a/Aggregation/MajorRailways/DF7_10_Railway_Aggregations.halex b/Aggregation/MajorRailways/DF7_10_Railway_Aggregations.halex
new file mode 100644
index 0000000..042a35b
--- /dev/null
+++ b/Aggregation/MajorRailways/DF7_10_Railway_Aggregations.halex
@@ -0,0 +1,58 @@
+
+
+ UBA END DF7_10 Railway Aggregation
+ Anna Tamm (wetransform GmbH)
+ 2023-12-01T14:09:27.647+01:00
+ 2024-05-15T14:27:37.312+02:00
+
+ UTF-8
+ false
+ eu.esdihumboldt.hale.io.project.hale25.xml
+ file:/C:/Users/AnnaTamm/gitRepos/uba-end-transformations/Aggregation/MajorRailways/DF7_10_Railway_Aggregations.halex
+
+
+ UTF-8
+ 41ef5bbc-5518-4005-bc74-59debebb6a1f
+ ../../Schemas/DF7_10_Railway.hsd.json
+ eu.esdihumboldt.hale.common.schema.hsd.json
+
+
+ UTF-8
+ 28cb9868-cfde-43d3-93b2-31d712ff6f44
+ ../../Schemas/DF7_10_Railway.hsd.json
+ eu.esdihumboldt.hale.common.schema.hsd.json
+
+
+ end_Checks
+ UTF-8
+ e6e71ce1-03e3-4088-9f89-da9dc9d5cc34
+ ../../Snippets/end.Checks.groovy
+ eu.esdihumboldt.hale.io.groovy
+ true
+
+
+
+ UTF-8
+
+ true
+ NoiseActionPlanMajorRail,NAP_MajorRail,NAP_MajorRailCompetentAuthority,NAP_MajorRailLimitValues,NAP_RailMappingResultDetail,NAP_RailReductionMeasure,NAP_RailReductionHealthImpact_1,NAP_RailReductionHealthImpact_2,NAP_RailReductionHealthImpact_3,ESTATUnitReference,DatasetDefaultProperties,CodelistProperties
+ eu.esdihumboldt.hale.io.xls.xlsx
+ true
+
+
+
+
+ {http://www.opengis.net/gml/3.2}boundedBy
+ {http://www.opengis.net/gml/3.2}Envelope
+ 2
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Aggregation/MajorRailways/DF7_10_Railway_Aggregations.halex.alignment.xml b/Aggregation/MajorRailways/DF7_10_Railway_Aggregations.halex.alignment.xml
new file mode 100644
index 0000000..e23d553
--- /dev/null
+++ b/Aggregation/MajorRailways/DF7_10_Railway_Aggregations.halex.alignment.xml
@@ -0,0 +1,523 @@
+
+
+
+
+
+
+
+
+
+
+def codelistProperty(table, property, cl) {
+ _target {
+ tableName(table)
+ propertyName(property)
+ codelist(cl)
+ }
+}
+
+codelistProperty('NoiseActionPlanMajorRail', 'legalContext_actionPlanDocument_citationLevel', 'http://inspire.ec.europa.eu/codelist/LegislationLevelValue')
+codelistProperty('NoiseActionPlanMajorRail', 'legalContext_actionPlanDocument_citationType', 'https://dd.eionet.europa.eu/vocabulary/inspire/CitationTypeValue')
+codelistProperty('NoiseActionPlanMajorRail', 'publicConsultation_consultationMeans', 'https://dd.eionet.europa.eu/vocabulary/noise/ConsultationMeansValue')
+codelistProperty('NoiseActionPlanMajorRail', 'publicConsultation_stakeholdersType', 'https://dd.eionet.europa.eu/vocabulary/noise/StakeholdersTypeValue')
+codelistProperty('NoiseActionPlanMajorRail', 'resultsEvaluationMechanismDescription', 'https://dd.eionet.europa.eu/vocabulary/noise/EvaluationMechanismValue')
+codelistProperty('NAP_RailMappingResultDetail', 'situationForImprovementPrioritisationCriteria', 'https://dd.eionet.europa.eu/vocabulary/noise/PrioritisationCriteriaValue')
+codelistProperty('NAP_RailReductionMeasure', 'existingMeasure', 'http://dd.eionet.europa.eu/vocabulary/noise/RailMeasureValue/')
+codelistProperty('NAP_RaildReductionMeasure', 'plannedMeasureDetail_plannedMeasure', 'http://dd.eionet.europa.eu/vocabulary/noise/RailMeasureValue/')
+codelistProperty('NAP_RailReductionMeasure', 'plannedMeasureDetail_measuresInCost', 'http://dd.eionet.europa.eu/vocabulary/noise/RailMeasureValue/')
+
+
+
+ |
+
+
+
+
+
+
+
+
+// Check if any tables were present that are mandatory
+def expectedTypes = [
+ 'NAP_MajorRail':'TB53',
+ 'NAP_MajorRailCompetentAuthority':'TB59',
+ 'NAP_MajorRailLimitValues':'TB135',
+ 'NAP_RailMappingResultDetail':'TB65',
+ 'NAP_RailReductionMeasure':'TB80',
+ 'NoiseActionPlanMajorRail':'TB1'
+]
+def presentTypes
+
+withTransformationContext {
+ def c = _.context.collector(it)
+ if (c['typesFound'].values()) {
+ _log.info("typesFound is ${c['typesFound'].values()}")
+ presentTypes = c['typesFound'].values()[0];
+ _log.info("presentTypes is ${presentTypes}")
+ }
+}
+
+expectedTypes.each { expectedType, errorCode ->
+ _log.info("expectedType = ${expectedType}")
+ if (!(presentTypes?.contains(expectedType))) {
+ def message = "Mandatory table ${expectedType} has no records"
+ _log.error("${errorCode}: ${message}")
+ }
+}
+
+_target {
+ attribute( 'href' )
+ defaultValue( 'http://dd.eionet.europa.eu/vocabulary/inspire/IdentifierScheme/EUENDCode' )
+ propertyName( 'actionPlanId_identifierScheme' )
+ tableName( 'NoiseActionPlanMajorRail' )
+}
+
+
+ |
+
+
+
+
+
+
+
+
+_target {
+ ESTATLAUReferenceLink( 'https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units/lau' )
+ ESTATLAUReferenceTitle( 'Local Administrative Units (LAU) 2022; Source: Eurostat' )
+
+ ESTATNUTSReferenceLink( 'https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units/nuts' )
+ ESTATNUTSReferenceTitle( 'NUTS 2021, Version date: 2020-01-20, Scale: 1:1M, Source: Eurostat' )
+}
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+def SHEET = 'NAP_MajorRail'
+
+_snippets.end_Checks {
+ registerType(SHEET)
+
+ uniqueCheck('TU96', SHEET, ['actionPlanId_identifier', 'railIdIdentifier', 'allInLAUCode', 'allInNUTSCode', 'allInCountry'])
+ freetextCheck('LEN', 'FC98', SHEET, 'actionPlanId_identifier')
+
+ codelistCheck('END_RT23', null, SHEET, 'allInLAUCode', CODELIST_LauIdValue(), true)
+ codelistCheck('END_RT24', null, SHEET, 'allInNUTSCode', CODELIST_NutsIdValue(), true)
+
+ xorCheck('END_RC13', SHEET, ['allInCountry','allInLAUCode','allInNUTSCode','railIdIdentifier'], 'Only one reference level is expected to be provided for each actionPlan: railIdIdentifier, allInLAUCode, allInNUTSCode or allInCountry', exists())
+}
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+def SHEET = 'NAP_MajorRailCompetentAuthority'
+
+_snippets.end_Checks {
+ registerType(SHEET)
+
+ uniqueCheck('TU97', SHEET, ['actionPlanId_identifier', 'competentAuthorityIdIdentifier'])
+ freetextCheck('LEN', 'FC101', SHEET, 'actionPlanId_identifier')
+ freetextCheck('LEN', 'FC64', SHEET, 'competentAuthorityIdIdentifier')
+}
+
+
+ |
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+def SHEET = 'NAP_MajorRailLimitValues'
+
+_snippets.end_Checks {
+ registerType(SHEET)
+
+ uniqueCheck('TU104', SHEET, 'actionPlanId_identifier')
+ freetextCheck('LEN', 'FC105', SHEET, 'actionPlanId_identifier')
+
+ conditionalCheck('END_CT41', SHEET, 'limitValues_otherCriteriaLimitDetail', 'limitValues_otherCriteriaDescription')
+ conditionalCheck('END_CT43', SHEET, 'limitValues_otherCriteriaDescription', 'limitValues_otherCriteriaLimitDetail')
+
+ conditionalCheck('END_CT37', SHEET, 'limitValues_noiseLimitReportIdIdentifier', 'limitValues_otherCriteriaLimitDetail', "If limitValues_noiseLimitReportIdIdentifier is not reported, limitValues_otherCriteriaLimitDetail has to be provided", isEmpty(), exists())
+ conditionalCheck('END_CT39', SHEET, 'limitValues_otherCriteriaLimitDetail', 'limitValues_noiseLimitReportIdIdentifier', "If limitValues_otherCriteriaLimitDetail is not reported, limitValues_noiseLimitReportIdIdentifier has to be provided", isEmpty(), exists())
+}
+
+
+ |
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+def SHEET = 'NAP_RailMappingResultDetail'
+
+_snippets.end_Checks {
+ registerType(SHEET)
+
+ integerCheck('FT72', 'FC73', SHEET, 'exposedLden55')
+ customCheck('END_DV49', null, SHEET, 'exposedLden55', 'must be greater than or equal to 0', isGreaterThanOrEqual0())
+
+ integerCheck('FT74', 'FC75', SHEET, 'exposedLnight50')
+ customCheck('END_DV50', null, SHEET, 'exposedLnight50', 'must be greater than or equal to 0', isGreaterThanOrEqual0())
+
+ codelistCheck('TC93', null, SHEET, 'situationForImprovementPrioritisationCriteria', CODELIST_PrioritisationCriteriaValue(), true)
+ freetextCheck('LEN', 'FC87', SHEET, 'situationForImprovementExplanation')
+
+ uniqueCheck('TU111', SHEET, ['actionPlanId_identifier', 'railIdIdentifier'])
+ freetextCheck('LEN', 'FC108', SHEET, 'actionPlanId_identifier')
+}
+
+
+ |
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+def SHEET = 'NAP_RailReductionHealthImpact_1'
+
+_snippets.end_Checks {
+ registerType(SHEET)
+
+ integerCheck('FT105', 'FC127', SHEET, 'nrOfPeople')
+ freetextCheck('LEN', 'FC116', SHEET, 'actionPlanId_identifier')
+
+ freetextCheck('LEN', 'FC126', SHEET, 'explanationMethod')
+
+ customCheck('END_DV52', null, SHEET, 'nrOfPeople', 'must be greater than or equal to 0', isGreaterThanOrEqual0())
+
+}
+
+// END_RC29
+// When not providing numberExperiencingReduction by actionPlanId_identifier (in table NAP_RailReductionHealthImpact_1),
+// at least one of the following attributes must be provided: numberHAReduction, mumberHSDReduction, mumberHDReduction
+
+withTransformationContext {
+ def c = _.context.collector(it)
+
+ def nrOfPeople = _source.p.nrOfPeople.value()
+ def actionPlanId = _source.p.actionPlanId_identifier.value()
+
+ if (!nrOfPeople && !c.numberHAReduction[actionPlanId].value() && !c.numberHSDReduction[actionPlanId].value() && !c.numberIHDReduction[actionPlanId].value()) {
+ _log.error("END_RC29: When not providing nrOfPeople by actionPlanId_identifier " +
+ "in table NAP_RailReductionHealthImpact_1, at least one of the following attributes must " +
+ "be provided in table NAP_RailReductionHealthImpact_2: numberHAReduction, numberHSDReduction, numberIHDReduction")
+ }
+}
+
+
+ |
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+withTransformationContext{
+ def c = _.context.collector(it)
+ def actionPlanId = _source.p.actionPlanId_identifier.value()
+
+ c.numberHAReduction[actionPlanId] << _source.p.numberHAReduction.value()
+ c.numberHSDReduction[actionPlanId] << _source.p.numberHSDReduction.value()
+ c.numberIHDReduction[actionPlanId] << _source.p.numberIHDReduction.value()
+}
+
+
+ |
+
+
+
+
+
+
+
+
+
+def SHEET = 'NAP_RaildReductionHealthImpact_3'
+
+_snippets.end_Checks {
+
+ uniqueCheck('TU125', SHEET, ['actionPlanId_identifier', 'railIdIdentifier'])
+ freetextCheck('LEN', 'FC123', SHEET, 'actionPlanId_identifier')
+}
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+def SHEET = 'NAP_RailReductionMeasure'
+
+_snippets.end_Checks {
+ registerType(SHEET) //FT80
+
+ costCheck('FT93', null, SHEET, 'plannedMeasureDetail_cost')
+ customCheck('END_DV51', null, SHEET, 'plannedMeasureDetail_cost', 'must be greater than or equal to 0', isGreaterThanOrEqual0())
+
+ codelistCheck('FT95', null, SHEET, 'plannedMeasureDetail_allMeasuresInCost', CODELIST_Boolean())
+ codelistCheck('TC94', 'FC98', SHEET, 'existingMeasure', CODELIST_RailMeasureValue(), true)
+ codelistCheck('TC95', 'FC103', SHEET, 'plannedMeasureDetail_plannedMeasure', CODELIST_RailMeasureValue(), true)
+ codelistCheck('TC96', null, SHEET, 'plannedMeasureDetail_measuresInCost', CODELIST_RailMeasureValue(), true)
+ freetextCheck('LEN', 'FC89', SHEET, 'plannedMeasureDetail_expectedBenefits')
+ freetextCheck('LEN', 'FC112', SHEET, 'actionPlanId_identifier')
+
+ conditionalCheck('END_CT63', SHEET, 'plannedMeasureDetail_cost', 'plannedMeasureDetail_costCurrency')
+ conditionalCheck('END_CT63', SHEET, 'plannedMeasureDetail_cost', 'plannedMeasureDetail_allMeasuresInCost')
+
+ conditionalCheck('END_CT70', SHEET, 'plannedMeasureDetail_allMeasuresInCost', 'plannedMeasureDetail_measuresInCost', ['No'])
+ customCheck('END_DV21', null, SHEET, 'existingMeasure', 'is invalid: When \"noMeasure\" value is selected, no more values are expected in the field', isOnlyValueIfPresent('noMeasure'))
+ customCheck('END_DV22', null, SHEET, 'plannedMeasureDetail_plannedMeasure', 'is invalid: When \"noMeasure\" value is selected, no more values are expected in the field', isOnlyValueIfPresent('noMeasure'))
+ customCheck('END_DV23', null, SHEET, 'plannedMeasureDetail_measuresInCost', 'is invalid: When \"noMeasure\" value is selected, no more values are expected in the field', isOnlyValueIfPresent('noMeasure'))
+
+ uniqueCheck('TU109', SHEET, ['actionPlanId_identifier', 'railIdIdentifier'])
+
+ nandCheck('END_TO13', SHEET, ['existingMeasure', 'plannedMeasureDetail_plannedMeasure'], 'The fields existingMeasure and plannedMeasureDetail_plannedMeasure must not both contain the value noMeasure', isEqualTo('noMeasure'), true)
+ conditionalCheck('END_TO25', SHEET, 'plannedMeasureDetail_allMeasuresInCost', 'plannedMeasureDetail_measuresInCost', 'The field measuresInCost must not contain the value noMeasure when allMeasuresInCost is No for that action plan', isEqualTo('No'), isNotEqualTo('noMeasure'))
+
+}
+
+
+ |
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+def SHEET = 'NoiseActionPlanMajorRail'
+
+_snippets.end_Checks {
+ registerType(SHEET)
+
+ existsCheck('FC3', SHEET, 'actionPlanId_identifier')
+ dateCheck('FT4', 'FC5', SHEET, 'legalContext_actionPlanStartDate', 'yyyy-MM-dd')
+ dateCheck('FT6', null, SHEET, 'legalContext_actionPlanEndDate', 'yyyy-MM-dd')
+ dateCheck('FT7', null, SHEET, 'legalContext_actionPlanDocument_citationDate', 'yyyy-MM-dd')
+ urlCheck('FT8', null, SHEET, 'legalContext_actionPlanDocument_citationLink')
+
+ dateCheck('FT19', 'FC18', SHEET, 'publicConsultation_consultationStartDate', 'yyyy-MM-dd')
+ dateCheck('FT21', 'FC20', SHEET, 'publicConsultation_consultationEndDate', 'yyyy-MM-dd')
+ integerCheck('FT26', null, SHEET, 'publicConsultation_numberOfParticipants')
+ codelistCheck('FT30', 'FC29', SHEET, 'publicConsultation_commentsReceived', CODELIST_Boolean())
+ codelistCheck('FT32', 'FC31', SHEET, 'publicConsultation_commentsIncludedInNAP', CODELIST_Boolean())
+ codelistCheck('FT35', 'FC34', SHEET, 'publicConsultation_NAPReviewed', CODELIST_Boolean())
+
+ codelistCheck('FT38', null, SHEET, 'longTermStrategy', CODELIST_Boolean())
+ costCheck('FT40', null, SHEET, 'estimatedOverallCost')
+ codelistCheck('FT44', 'FC43', SHEET, 'quietAreas', CODELIST_Boolean())
+ codelistCheck('FT47', 'FC46', SHEET, 'implementationMechanism', CODELIST_Boolean())
+ codelistCheck('FT51', 'FC50', SHEET, 'resultsEvaluationMechanism', CODELIST_Boolean())
+
+ codelistCheck('TC73', null, SHEET, 'legalContext_actionPlanDocument_citationLevel', CODELIST_CitationLevelValue())
+ codelistCheck('TC74', null, SHEET, 'legalContext_actionPlanDocument_citationType', CODELIST_CitationTypeValue())
+ codelistCheck('TC90', null, SHEET, 'resultsEvaluationMechanismDescription', CODELIST_EvaluationMechanismValue())
+ codelistCheck('TC91', null, SHEET, 'publicConsultation_consultationMeans', CODELIST_ConsultationMeansValue(), true)
+ codelistCheck('TC92', null, SHEET, 'publicConsultation_stakeholdersType', CODELIST_StakeholderValue(), true)
+ freetextCheck('LEN', 'FC82', SHEET, 'publicConsultation_reviewExplanation')
+
+ customCheck('END_DV47', null, SHEET, 'publicConsultation_numberOfParticipants', 'must be greater than or equal to 0', isGreaterThanOrEqual0())
+ customCheck('END_DV48', null, SHEET, 'estimatedOverallCost', 'must be greater than or equal to 0', isGreaterThanOrEqual0())
+
+ conditionalCheck('END_CT57', SHEET, 'estimatedOverallCost', 'costCurrency')
+ conditionalCheck('END_CT58', SHEET, 'costCurrency', 'estimatedOverallCost')
+
+ uniqueCheck('TU95', SHEET, 'actionPlanId_identifier')
+
+ }
+
+
+ |
+
+
+
+
+
+
+
+
+
+ |
+
diff --git a/Aggregation/MajorRailways/DF7_10_Railway_Aggregations.halex.styles.sld b/Aggregation/MajorRailways/DF7_10_Railway_Aggregations.halex.styles.sld
new file mode 100644
index 0000000..ad34f54
--- /dev/null
+++ b/Aggregation/MajorRailways/DF7_10_Railway_Aggregations.halex.styles.sld
@@ -0,0 +1,3 @@
+
+ Default Styler
+