Skip to content

Commit 5e33073

Browse files
committed
Guard against empty AccessTerm instance in PIN
Add conditions on existence of certain child elements, which are already used in referenced parents. Avoids runts appearing in certain notices, such as 6291-2025 (SDK v1.12), where those child elements are absent. Additionally, fix the join condition for refersToPlannedPart which would otherwise instantiate links to all parts, not just the one related to the AccessTerm. Fixes TEDSWS-325.
1 parent 3ccf319 commit 5e33073

12 files changed

Lines changed: 33 additions & 36 deletions

File tree

mappings/package_eforms_sdk1.10_epo4.0/transformation/mappings/AccessTerm-pin.rml.ttl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
108108
[
109109
rdfs:label "ND-PartTenderingTerms" ;
110110
rr:class epo:AccessTerm ;
111-
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_AccessTerm_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw')}" ;
111+
rml:reference "if(exists(cac:AdditionalInformationParty/cac:PartyIdentification/cbc:ID) or exists(cac:DocumentProviderParty/cac:PartyIdentification/cbc:ID)) then 'http://data.europa.eu/a4g/resource/id_' || replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-') || '_AccessTerm_' || unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw') else null" ;
112112
] ;
113113
rr:predicateObjectMap
114114
[
@@ -117,8 +117,8 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
117117
[
118118
rr:parentTriplesMap tedm:MG-PlannedProcurementPart-refersToPlannedPart-AccessTerm_ND-PartTenderingTerms ;
119119
rr:joinCondition [
120-
rr:child "path(../..)" ;
121-
rr:parent "path(../..)" ;
120+
rr:child "path(.)" ;
121+
rr:parent "path(.)" ;
122122
] ;
123123
] ;
124124
] ;

mappings/package_eforms_sdk1.11_epo4.0/transformation/mappings/AccessTerm-pin.rml.ttl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
108108
[
109109
rdfs:label "ND-PartTenderingTerms" ;
110110
rr:class epo:AccessTerm ;
111-
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_AccessTerm_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw')}" ;
111+
rml:reference "if(exists(cac:AdditionalInformationParty/cac:PartyIdentification/cbc:ID) or exists(cac:DocumentProviderParty/cac:PartyIdentification/cbc:ID)) then 'http://data.europa.eu/a4g/resource/id_' || replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-') || '_AccessTerm_' || unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw') else null" ;
112112
] ;
113113
rr:predicateObjectMap
114114
[
@@ -117,8 +117,8 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
117117
[
118118
rr:parentTriplesMap tedm:MG-PlannedProcurementPart-refersToPlannedPart-AccessTerm_ND-PartTenderingTerms ;
119119
rr:joinCondition [
120-
rr:child "path(../..)" ;
121-
rr:parent "path(../..)" ;
120+
rr:child "path(.)" ;
121+
rr:parent "path(.)" ;
122122
] ;
123123
] ;
124124
] ;

mappings/package_eforms_sdk1.12_epo4.0/transformation/mappings/AccessTerm-pin.rml.ttl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
108108
[
109109
rdfs:label "ND-PartTenderingTerms" ;
110110
rr:class epo:AccessTerm ;
111-
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_AccessTerm_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw')}" ;
111+
rml:reference "if(exists(cac:AdditionalInformationParty/cac:PartyIdentification/cbc:ID) or exists(cac:DocumentProviderParty/cac:PartyIdentification/cbc:ID)) then 'http://data.europa.eu/a4g/resource/id_' || replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-') || '_AccessTerm_' || unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw') else null" ;
112112
] ;
113113
rr:predicateObjectMap
114114
[
@@ -117,8 +117,8 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
117117
[
118118
rr:parentTriplesMap tedm:MG-PlannedProcurementPart-refersToPlannedPart-AccessTerm_ND-PartTenderingTerms ;
119119
rr:joinCondition [
120-
rr:child "path(../..)" ;
121-
rr:parent "path(../..)" ;
120+
rr:child "path(.)" ;
121+
rr:parent "path(.)" ;
122122
] ;
123123
] ;
124124
] ;

mappings/package_eforms_sdk1.13_epo4.0/transformation/mappings/AccessTerm-pin.rml.ttl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
108108
[
109109
rdfs:label "ND-PartTenderingTerms" ;
110110
rr:class epo:AccessTerm ;
111-
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_AccessTerm_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw')}" ;
111+
rml:reference "if(exists(cac:AdditionalInformationParty/cac:PartyIdentification/cbc:ID) or exists(cac:DocumentProviderParty/cac:PartyIdentification/cbc:ID)) then 'http://data.europa.eu/a4g/resource/id_' || replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-') || '_AccessTerm_' || unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw') else null" ;
112112
] ;
113113
rr:predicateObjectMap
114114
[
@@ -117,8 +117,8 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
117117
[
118118
rr:parentTriplesMap tedm:MG-PlannedProcurementPart-refersToPlannedPart-AccessTerm_ND-PartTenderingTerms ;
119119
rr:joinCondition [
120-
rr:child "path(../..)" ;
121-
rr:parent "path(../..)" ;
120+
rr:child "path(.)" ;
121+
rr:parent "path(.)" ;
122122
] ;
123123
] ;
124124
] ;

mappings/package_eforms_sdk1.3_epo4.0/transformation/mappings/AccessTerm-pin.rml.ttl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
108108
[
109109
rdfs:label "ND-PartTenderingTerms" ;
110110
rr:class epo:AccessTerm ;
111-
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_AccessTerm_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw')}" ;
111+
rml:reference "if(exists(cac:AdditionalInformationParty/cac:PartyIdentification/cbc:ID) or exists(cac:DocumentProviderParty/cac:PartyIdentification/cbc:ID)) then 'http://data.europa.eu/a4g/resource/id_' || replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-') || '_AccessTerm_' || unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw') else null" ;
112112
] ;
113113
rr:predicateObjectMap
114114
[
@@ -117,8 +117,8 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
117117
[
118118
rr:parentTriplesMap tedm:MG-PlannedProcurementPart-refersToPlannedPart-AccessTerm_ND-PartTenderingTerms ;
119119
rr:joinCondition [
120-
rr:child "path(../..)" ;
121-
rr:parent "path(../..)" ;
120+
rr:child "path(.)" ;
121+
rr:parent "path(.)" ;
122122
] ;
123123
] ;
124124
] ;

mappings/package_eforms_sdk1.5_epo4.0/transformation/mappings/AccessTerm-pin.rml.ttl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
108108
[
109109
rdfs:label "ND-PartTenderingTerms" ;
110110
rr:class epo:AccessTerm ;
111-
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_AccessTerm_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw')}" ;
111+
rml:reference "if(exists(cac:AdditionalInformationParty/cac:PartyIdentification/cbc:ID) or exists(cac:DocumentProviderParty/cac:PartyIdentification/cbc:ID)) then 'http://data.europa.eu/a4g/resource/id_' || replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-') || '_AccessTerm_' || unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw') else null" ;
112112
] ;
113113
rr:predicateObjectMap
114114
[
@@ -117,8 +117,8 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
117117
[
118118
rr:parentTriplesMap tedm:MG-PlannedProcurementPart-refersToPlannedPart-AccessTerm_ND-PartTenderingTerms ;
119119
rr:joinCondition [
120-
rr:child "path(../..)" ;
121-
rr:parent "path(../..)" ;
120+
rr:child "path(.)" ;
121+
rr:parent "path(.)" ;
122122
] ;
123123
] ;
124124
] ;

mappings/package_eforms_sdk1.6_epo4.0/transformation/mappings/AccessTerm-pin.rml.ttl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
108108
[
109109
rdfs:label "ND-PartTenderingTerms" ;
110110
rr:class epo:AccessTerm ;
111-
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_AccessTerm_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw')}" ;
111+
rml:reference "if(exists(cac:AdditionalInformationParty/cac:PartyIdentification/cbc:ID) or exists(cac:DocumentProviderParty/cac:PartyIdentification/cbc:ID)) then 'http://data.europa.eu/a4g/resource/id_' || replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-') || '_AccessTerm_' || unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw') else null" ;
112112
] ;
113113
rr:predicateObjectMap
114114
[
@@ -117,8 +117,8 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
117117
[
118118
rr:parentTriplesMap tedm:MG-PlannedProcurementPart-refersToPlannedPart-AccessTerm_ND-PartTenderingTerms ;
119119
rr:joinCondition [
120-
rr:child "path(../..)" ;
121-
rr:parent "path(../..)" ;
120+
rr:child "path(.)" ;
121+
rr:parent "path(.)" ;
122122
] ;
123123
] ;
124124
] ;

mappings/package_eforms_sdk1.7_epo4.0/transformation/mappings/AccessTerm-pin.rml.ttl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
108108
[
109109
rdfs:label "ND-PartTenderingTerms" ;
110110
rr:class epo:AccessTerm ;
111-
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_AccessTerm_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw')}" ;
111+
rml:reference "if(exists(cac:AdditionalInformationParty/cac:PartyIdentification/cbc:ID) or exists(cac:DocumentProviderParty/cac:PartyIdentification/cbc:ID)) then 'http://data.europa.eu/a4g/resource/id_' || replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-') || '_AccessTerm_' || unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw') else null" ;
112112
] ;
113113
rr:predicateObjectMap
114114
[
@@ -117,8 +117,8 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
117117
[
118118
rr:parentTriplesMap tedm:MG-PlannedProcurementPart-refersToPlannedPart-AccessTerm_ND-PartTenderingTerms ;
119119
rr:joinCondition [
120-
rr:child "path(../..)" ;
121-
rr:parent "path(../..)" ;
120+
rr:child "path(.)" ;
121+
rr:parent "path(.)" ;
122122
] ;
123123
] ;
124124
] ;

mappings/package_eforms_sdk1.8_epo4.0/transformation/mappings/AccessTerm-pin.rml.ttl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
108108
[
109109
rdfs:label "ND-PartTenderingTerms" ;
110110
rr:class epo:AccessTerm ;
111-
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_AccessTerm_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw')}" ;
111+
rml:reference "if(exists(cac:AdditionalInformationParty/cac:PartyIdentification/cbc:ID) or exists(cac:DocumentProviderParty/cac:PartyIdentification/cbc:ID)) then 'http://data.europa.eu/a4g/resource/id_' || replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-') || '_AccessTerm_' || unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw') else null" ;
112112
] ;
113113
rr:predicateObjectMap
114114
[
@@ -117,8 +117,8 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
117117
[
118118
rr:parentTriplesMap tedm:MG-PlannedProcurementPart-refersToPlannedPart-AccessTerm_ND-PartTenderingTerms ;
119119
rr:joinCondition [
120-
rr:child "path(../..)" ;
121-
rr:parent "path(../..)" ;
120+
rr:child "path(.)" ;
121+
rr:parent "path(.)" ;
122122
] ;
123123
] ;
124124
] ;

mappings/package_eforms_sdk1.9_epo4.0/transformation/mappings/AccessTerm-pin.rml.ttl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
108108
[
109109
rdfs:label "ND-PartTenderingTerms" ;
110110
rr:class epo:AccessTerm ;
111-
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_AccessTerm_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw')}" ;
111+
rml:reference "if(exists(cac:AdditionalInformationParty/cac:PartyIdentification/cbc:ID) or exists(cac:DocumentProviderParty/cac:PartyIdentification/cbc:ID)) then 'http://data.europa.eu/a4g/resource/id_' || replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-') || '_AccessTerm_' || unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw') else null" ;
112112
] ;
113113
rr:predicateObjectMap
114114
[
@@ -117,8 +117,8 @@ tedm:AccessTerm_ND-PartTenderingTerms a rr:TriplesMap ;
117117
[
118118
rr:parentTriplesMap tedm:MG-PlannedProcurementPart-refersToPlannedPart-AccessTerm_ND-PartTenderingTerms ;
119119
rr:joinCondition [
120-
rr:child "path(../..)" ;
121-
rr:parent "path(../..)" ;
120+
rr:child "path(.)" ;
121+
rr:parent "path(.)" ;
122122
] ;
123123
] ;
124124
] ;

0 commit comments

Comments
 (0)