Skip to content

Commit 9b95875

Browse files
committed
Fix announces vs. refersTo, empty NoticeAwardInformation in CAN
For ContractModificationNotice and CompletionNotice, the correct relationship to link the NoticeAwardInformation is `epo:refersToNoticeAwardInformation` instead of `epo:announcesNoticeAwardInformation`. The announces one is to be used for ResultNotice and DirectAwardPrenotificationNotice. - refactor the main TMap from ResultNotice to Notice - optimize the NoticeAwardInformation TMap to represent a root MG - update all referenced TMaps according to the refactoring/optimization - add a guard against instantiation of empty NoticeAwardInformation [1] [1] As it has more than one child that can be absent. This can additionally be seen in 6493-2025. Fixes TEDSWS-317, TEDSWS-299.
1 parent fdc3c63 commit 9b95875

16 files changed

Lines changed: 923 additions & 449 deletions

File tree

mappings/package_eforms_sdk1.10_epo4.0/transformation/mappings/root-can.rml.ttl

Lines changed: 53 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ tedm:MG-AgentInRole-refersToRole-Notice_ND-Root_CAN a rr:TriplesMap ;
204204
] ;
205205
.
206206

207-
tedm:MG-ResultNotice_ND-NoticeResult a rr:TriplesMap ;
208-
rdfs:label "MG-ResultNotice";
207+
tedm:MG-Notice_ND-NoticeResult a rr:TriplesMap ;
208+
rdfs:label "MG-Notice";
209209
rml:logicalSource
210210
[
211211
rml:source "data/source.xml" ;
@@ -216,20 +216,33 @@ tedm:MG-ResultNotice_ND-NoticeResult a rr:TriplesMap ;
216216
[
217217
rdfs:label "NoticeResult" ;
218218
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_Notice" ;
219-
# these properties are shared among other CAN types such as DAP and cont-modif
219+
# these properties are shared among other CAN types such as DAP, cont-modif and compl based on certain conditions
220220
rr:class epo:Notice
221221
] ;
222222
rr:predicateObjectMap
223223
[
224-
rdfs:label "BT-161-NoticeResult, BT-1118-NoticeResult and BT-118-NoticeResult" ;
225-
rr:predicate epo-not:announcesNoticeAwardInformation ;
224+
rdfs:label "BT-161-NoticeResult, BT-1118-NoticeResult and BT-118-NoticeResult (announcesNoticeAwardInformation [result and DAP])" ;
225+
rr:predicate epo:announcesNoticeAwardInformation ;
226226
rr:objectMap
227227
[
228-
rr:parentTriplesMap tedm:MG-NoticeAwardInformation-announcesNoticeAwardInformation-ResultNotice;
229-
rr:joinCondition [
230-
rr:child "path(.)";
231-
rr:parent "path(.)";
232-
] ;
228+
rr:parentTriplesMap tedm:MG-NoticeAwardInformation_ND-NoticeResult ;
229+
rr:joinCondition [
230+
rr:child "if(/*/cbc:NoticeTypeCode/@listName='result' or /*/cbc:NoticeTypeCode/@listName='dir-awa-pre' or (/*/cbc:NoticeTypeCode/@listName='change' and exists(/*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:NoticeSubType/cbc:SubTypeCode[contains('29 30 31 32 33 34 35 36 37 T02 25 26 27 28', text())]))) then path(.) else null" ;
231+
rr:parent "path(.)" ;
232+
] ;
233+
] ;
234+
] ;
235+
rr:predicateObjectMap
236+
[
237+
rdfs:label "BT-161-NoticeResult, BT-1118-NoticeResult and BT-118-NoticeResult (refersToNoticeAwardInformation [compl and cont-modif])" ;
238+
rr:predicate epo:refersToNoticeAwardInformation ;
239+
rr:objectMap
240+
[
241+
rr:parentTriplesMap tedm:MG-NoticeAwardInformation_ND-NoticeResult ;
242+
rr:joinCondition [
243+
rr:child "if(/*/cbc:NoticeTypeCode/@listName='completion' or /*/cbc:NoticeTypeCode/@listName='cont-modif' or (/*/cbc:NoticeTypeCode/@listName='change' and exists(/*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:NoticeSubType/cbc:SubTypeCode[contains('38 39 40', text())]))) then path(.) else null" ;
244+
rr:parent "path(.)" ;
245+
] ;
233246
] ;
234247
] ;
235248
rr:predicateObjectMap
@@ -248,7 +261,7 @@ tedm:MG-ResultNotice_ND-NoticeResult a rr:TriplesMap ;
248261
] ;
249262
.
250263

251-
tedm:MG-MonetaryValue-hasTotalAwardedValue-NoticeAwardInformation-announcesNoticeAwardInformation-ResultNotice a rr:TriplesMap ;
264+
tedm:MG-MonetaryValue-hasTotalAwardedValue-NoticeAwardInformation_ND-ResultNotice a rr:TriplesMap ;
252265
rdfs:label "MG-MonetaryValue";
253266
rml:logicalSource
254267
[
@@ -290,7 +303,7 @@ tedm:MG-MonetaryValue-hasTotalAwardedValue-NoticeAwardInformation-announcesNotic
290303
] ;
291304
.
292305

293-
tedm:MG-NoticeAwardInformation-announcesNoticeAwardInformation-ResultNotice a rr:TriplesMap ;
306+
tedm:MG-NoticeAwardInformation_ND-NoticeResult a rr:TriplesMap ;
294307
rdfs:label "MG-NoticeAwardInformation";
295308
rml:logicalSource
296309
[
@@ -301,54 +314,54 @@ tedm:MG-NoticeAwardInformation-announcesNoticeAwardInformation-ResultNotice a rr
301314
rr:subjectMap
302315
[
303316
rdfs:label "ND-NoticeResult" ;
304-
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_NoticeAwardInformation_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw')}" ;
317+
rml:reference "if(exists(cbc:TotalAmount) or exists(efbc:OverallMaximumFrameworkContractsAmount) or exists(efbc:OverallApproximateFrameworkContractsAmount)) then 'http://data.europa.eu/a4g/resource/id_' || replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-') || '_NoticeAwardInformation_' || unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw') else null" ;
305318
rr:class epo:NoticeAwardInformation
306319
] ;
307320
rr:predicateObjectMap
308321
[
309322
rdfs:label "BT-161-NoticeResult" ;
310-
rdfs:comment "NoticeValue of NoticeAwardInformation under ND-NoticeResult" ;
311-
rr:predicate epo:hasTotalAwardedValue ;
323+
rdfs:comment "Notice Value of NoticeAwardInformation under ND-NoticeResult" ;
324+
rr:predicate epo:hasTotalAwardedValue ;
312325
rr:objectMap
313326
[
314-
rr:parentTriplesMap tedm:MG-MonetaryValue-hasTotalAwardedValue-NoticeAwardInformation-announcesNoticeAwardInformation-ResultNotice;
327+
rr:parentTriplesMap tedm:MG-MonetaryValue-hasTotalAwardedValue-NoticeAwardInformation_ND-ResultNotice ;
315328
rr:joinCondition [
316-
rr:child "path(.)";
317-
rr:parent "path(.)";
318-
] ;
319-
] ;
329+
rr:child "path(.)" ;
330+
rr:parent "path(.)" ;
331+
] ;
332+
] ;
320333
] ;
321334
rr:predicateObjectMap
322335
[
323336
rdfs:label "BT-118-NoticeResult" ;
324-
rdfs:comment "NoticeValue of NoticeAwardInformation under ND-NoticeResult" ;
325-
rr:predicate epo:hasMaximumFrameworkAgreementAwardedValue ;
337+
rdfs:comment "Notice Framework Maximum Value of NoticeAwardInformation under ND-NoticeResult" ;
338+
rr:predicate epo:hasMaximumFrameworkAgreementAwardedValue ;
326339
rr:objectMap
327340
[
328-
rr:parentTriplesMap tedm:MG-MonetaryValue-hasMaximumFrameworkAgreementAwardedValue-NoticeAwardInformation-announcesNoticeAwardInformation-ResultNotice;
341+
rr:parentTriplesMap tedm:MG-MonetaryValue-hasMaximumFrameworkAgreementAwardedValue-NoticeAwardInformation_ND-ResultNotice ;
329342
rr:joinCondition [
330-
rr:child "path(.)";
331-
rr:parent "path(.)";
343+
rr:child "path(.)" ;
344+
rr:parent "path(.)" ;
332345
] ;
333-
] ;
346+
] ;
334347
] ;
335348
rr:predicateObjectMap
336349
[
337350
rdfs:label "BT-1118-NoticeResult" ;
338351
rdfs:comment "NoticeFrameworkApproximateValue of NoticeAwardInformation under ND-NoticeResult" ;
339-
rr:predicate epo:hasApproximateFrameworkAgreementValue ;
352+
rr:predicate epo:hasApproximateFrameworkAgreementValue ;
340353
rr:objectMap
341354
[
342-
rr:parentTriplesMap tedm:MG-MonetaryValue-hasApproximateFrameworkAgreementValue-NoticeAwardInformation-announcesNoticeAwardInformation-ResultNotice;
355+
rr:parentTriplesMap tedm:MG-MonetaryValue-hasApproximateFrameworkAgreementValue-NoticeAwardInformation_ND-ResultNotice ;
343356
rr:joinCondition [
344-
rr:child "path(.)";
345-
rr:parent "path(.)";
346-
] ;
347-
] ;
357+
rr:child "path(.)" ;
358+
rr:parent "path(.)" ;
359+
] ;
360+
] ;
348361
] ;
349362
.
350363

351-
tedm:MG-MonetaryValue-hasMaximumFrameworkAgreementAwardedValue-NoticeAwardInformation-announcesNoticeAwardInformation-ResultNotice a rr:TriplesMap ;
364+
tedm:MG-MonetaryValue-hasMaximumFrameworkAgreementAwardedValue-NoticeAwardInformation_ND-ResultNotice a rr:TriplesMap ;
352365
rdfs:label "MG-MonetaryValue";
353366
rml:logicalSource
354367
[
@@ -365,18 +378,18 @@ tedm:MG-MonetaryValue-hasMaximumFrameworkAgreementAwardedValue-NoticeAwardInform
365378
rr:predicateObjectMap
366379
[
367380
rdfs:label "BT-118-NoticeResult" ;
368-
rdfs:comment "Notice Framework Maximum Value of MonetaryValue under ND-NoticeResult" ;
369-
rr:predicate epo:hasAmountValue ;
381+
rdfs:comment "Notice Framework Maximum Value (v1.6+), Notice Framework Value (up to v1.5) of MonetaryValue under ND-NoticeResult" ;
382+
rr:predicate epo:hasAmountValue ;
370383
rr:objectMap
371384
[
372-
rml:reference "if(not(exists(efac:FieldsPrivacy[efbc:FieldIdentifierCode/text()='not-max-val']) and efbc:OverallMaximumFrameworkContractsAmount/text() = '-1' )) then efbc:OverallMaximumFrameworkContractsAmount else null";
373-
rr:datatype xsd:decimal;
385+
rml:reference "if(not(exists(efac:FieldsPrivacy[efbc:FieldIdentifierCode/text()='not-max-val']) and efbc:OverallMaximumFrameworkContractsAmount/text() = '-1' )) then efbc:OverallMaximumFrameworkContractsAmount else null" ;
386+
rr:datatype xsd:decimal ;
374387
] ;
375388
] ;
376389
rr:predicateObjectMap
377390
[
378-
rdfs:label "BT-118-NoticeResult-Currency";
379-
rdfs:comment "Currency of Notice Framework Maximum Value of MonetaryValue under ND-NoticeResult";
391+
rdfs:label "BT-118-NoticeResult-Currency" ;
392+
rdfs:comment "Currency of Notice Framework Maximum Value (v1.6+), Notice Framework Value (up to v1.5) of MonetaryValue under ND-NoticeResult" ;
380393
rr:predicate epo:hasCurrency ;
381394
rr:objectMap
382395
[
@@ -390,7 +403,7 @@ tedm:MG-MonetaryValue-hasMaximumFrameworkAgreementAwardedValue-NoticeAwardInform
390403
] ;
391404
.
392405

393-
tedm:MG-MonetaryValue-hasApproximateFrameworkAgreementValue-NoticeAwardInformation-announcesNoticeAwardInformation-ResultNotice a rr:TriplesMap ;
406+
tedm:MG-MonetaryValue-hasApproximateFrameworkAgreementValue-NoticeAwardInformation_ND-ResultNotice a rr:TriplesMap ;
394407
rdfs:label "MG-MonetaryValue";
395408
rml:logicalSource
396409
[

0 commit comments

Comments
 (0)