Skip to content

Commit 89aace0

Browse files
valexandeschivmeister
authored andcommitted
feat: commit 2/3 for Monetary Value dangling entities
1 parent f9f0b92 commit 89aace0

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/mappings-can/root-can.rml.ttl

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,9 @@ tedm:MG-MonetaryValue-hasTotalAwardedValue-NoticeAwardInformation_ND-ResultNotic
282282
rr:subjectMap
283283
[
284284
rdfs:label "ND-NoticeResult" ;
285-
rml:reference "if (exists(cbc:TotalAmount)) then 'http://data.europa.eu/a4g/resource/' || /*/cbc:ID[@schemeName='notice-id'] || '-' || /*/cbc:VersionID || '/MonetaryValueNoticeAwardInformation$' || replace(replace(replace(path(), 'Q\\{[^}]+\\}', ''), '\\[([0-9]+)\\]', '$1'), '/', '_') else null" ;
285+
# Avoid type-only epo:MonetaryValue:
286+
# Only instantiate when at least one mapped value will exist (amount and/or currency).
287+
rml:reference "if (exists(cbc:TotalAmount) and (not(exists(efac:FieldsPrivacy[efbc:FieldIdentifierCode/text()='not-val']) and cbc:TotalAmount/text() = '-1') or (exists(cbc:TotalAmount/@currencyID) and cbc:TotalAmount/@currencyID != 'unpublished'))) then 'http://data.europa.eu/a4g/resource/' || /*/cbc:ID[@schemeName='notice-id'] || '-' || /*/cbc:VersionID || '/MonetaryValueNoticeAwardInformation$' || replace(replace(replace(path(), 'Q\\{[^}]+\\}', ''), '\\[([0-9]+)\\]', '$1'), '/', '_') else null" ;
286288
rr:class epo:MonetaryValue
287289
] ;
288290
rr:predicateObjectMap
@@ -324,7 +326,9 @@ tedm:MG-NoticeAwardInformation_ND-NoticeResult a rr:TriplesMap ;
324326
rr:subjectMap
325327
[
326328
rdfs:label "ND-NoticeResult" ;
327-
rml:reference "if(exists(cbc:TotalAmount) or exists(efbc:OverallMaximumFrameworkContractsAmount) or exists(efbc:OverallApproximateFrameworkContractsAmount)) then 'http://data.europa.eu/a4g/resource/' || /*/cbc:ID[@schemeName='notice-id'] || '-' || /*/cbc:VersionID || '/NoticeAwardInformation$' || replace(replace(replace(path(), 'Q\\{[^}]+\\}', ''), '\\[([0-9]+)\\]', '$1'), '/', '_') else null" ;
329+
# Avoid type-only epo:NoticeAwardInformation:
330+
# Only instantiate when at least one of the monetary values it links to will be created.
331+
rml:reference "if ((exists(cbc:TotalAmount) and (not(exists(efac:FieldsPrivacy[efbc:FieldIdentifierCode/text()='not-val']) and cbc:TotalAmount/text() = '-1') or (exists(cbc:TotalAmount/@currencyID) and cbc:TotalAmount/@currencyID != 'unpublished'))) or (exists(efbc:OverallMaximumFrameworkContractsAmount) and (not(exists(efac:FieldsPrivacy[efbc:FieldIdentifierCode/text()='not-max-val']) and efbc:OverallMaximumFrameworkContractsAmount/text() = '-1') or (exists(efbc:OverallMaximumFrameworkContractsAmount/@currencyID) and efbc:OverallMaximumFrameworkContractsAmount/@currencyID != 'unpublished'))) or (exists(efbc:OverallApproximateFrameworkContractsAmount) and (not(exists(efac:FieldsPrivacy[efbc:FieldIdentifierCode/text()='not-app-val']) and efbc:OverallApproximateFrameworkContractsAmount/text() = '-1') or (exists(efbc:OverallApproximateFrameworkContractsAmount/@currencyID) and efbc:OverallApproximateFrameworkContractsAmount/@currencyID != 'unpublished')))) then 'http://data.europa.eu/a4g/resource/' || /*/cbc:ID[@schemeName='notice-id'] || '-' || /*/cbc:VersionID || '/NoticeAwardInformation$' || replace(replace(replace(path(), 'Q\\{[^}]+\\}', ''), '\\[([0-9]+)\\]', '$1'), '/', '_') else null" ;
328332
rr:class epo:NoticeAwardInformation
329333
] ;
330334
rr:predicateObjectMap
@@ -382,7 +386,9 @@ tedm:MG-MonetaryValue-hasMaximumFrameworkAgreementAwardedValue-NoticeAwardInform
382386
rr:subjectMap
383387
[
384388
rdfs:label "ND-NoticeResult" ;
385-
rml:reference "if (exists(efbc:OverallMaximumFrameworkContractsAmount)) then 'http://data.europa.eu/a4g/resource/' || /*/cbc:ID[@schemeName='notice-id'] || '-' || /*/cbc:VersionID || '/MaximumFrameworkAgreementAwardedMonetaryValueLot$' || replace(replace(replace(path(), 'Q\\{[^}]+\\}', ''), '\\[([0-9]+)\\]', '$1'), '/', '_') else null" ;
389+
# Avoid type-only epo:MonetaryValue:
390+
# Only instantiate when at least one mapped value will exist (amount and/or currency).
391+
rml:reference "if (exists(efbc:OverallMaximumFrameworkContractsAmount) and (not(exists(efac:FieldsPrivacy[efbc:FieldIdentifierCode/text()='not-max-val']) and efbc:OverallMaximumFrameworkContractsAmount/text() = '-1') or (exists(efbc:OverallMaximumFrameworkContractsAmount/@currencyID) and efbc:OverallMaximumFrameworkContractsAmount/@currencyID != 'unpublished'))) then 'http://data.europa.eu/a4g/resource/' || /*/cbc:ID[@schemeName='notice-id'] || '-' || /*/cbc:VersionID || '/MaximumFrameworkAgreementAwardedMonetaryValueLot$' || replace(replace(replace(path(), 'Q\\{[^}]+\\}', ''), '\\[([0-9]+)\\]', '$1'), '/', '_') else null" ;
386392
rr:class epo:MonetaryValue
387393
] ;
388394
rr:predicateObjectMap
@@ -424,7 +430,9 @@ tedm:MG-MonetaryValue-hasApproximateFrameworkAgreementValue-NoticeAwardInformati
424430
rr:subjectMap
425431
[
426432
rdfs:label "ND-NoticeResult" ;
427-
rml:reference "if (exists(efbc:OverallApproximateFrameworkContractsAmount)) then 'http://data.europa.eu/a4g/resource/' || /*/cbc:ID[@schemeName='notice-id'] || '-' || /*/cbc:VersionID || '/ApproximateFrameworkAgreementMonetaryValueLot$' || replace(replace(replace(path(), 'Q\\{[^}]+\\}', ''), '\\[([0-9]+)\\]', '$1'), '/', '_') else null" ;
433+
# Avoid type-only epo:MonetaryValue:
434+
# Only instantiate when at least one mapped value will exist (amount and/or currency).
435+
rml:reference "if (exists(efbc:OverallApproximateFrameworkContractsAmount) and (not(exists(efac:FieldsPrivacy[efbc:FieldIdentifierCode/text()='not-app-val']) and efbc:OverallApproximateFrameworkContractsAmount/text() = '-1') or (exists(efbc:OverallApproximateFrameworkContractsAmount/@currencyID) and efbc:OverallApproximateFrameworkContractsAmount/@currencyID != 'unpublished'))) then 'http://data.europa.eu/a4g/resource/' || /*/cbc:ID[@schemeName='notice-id'] || '-' || /*/cbc:VersionID || '/ApproximateFrameworkAgreementMonetaryValueLot$' || replace(replace(replace(path(), 'Q\\{[^}]+\\}', ''), '\\[([0-9]+)\\]', '$1'), '/', '_') else null" ;
428436
rr:class epo:MonetaryValue
429437
] ;
430438
rr:predicateObjectMap

src/output-can.ttl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,9 @@
207207
epo:contextualisedBy <http://data.europa.eu/a4g/resource/00e85dc8-53c7-4463-9427-275781d82d1b-01/Lot/LOT-0001>;
208208
epo:playedBy <http://data.europa.eu/a4g/resource/00e85dc8-53c7-4463-9427-275781d82d1b-01/Organization/ORG-0002> .
209209

210-
<http://data.europa.eu/a4g/resource/00e85dc8-53c7-4463-9427-275781d82d1b-01/MonetaryValueNoticeAwardInformation$_ContractAwardNotice1_UBLExtensions1_UBLExtension1_ExtensionContent1_EformsExtension1_NoticeResult1>
211-
a epo:MonetaryValue .
212-
213210
<http://data.europa.eu/a4g/resource/00e85dc8-53c7-4463-9427-275781d82d1b-01/Notice>
214211
a epo:Notice, epo:Notice30, epo:ResultNotice;
215212
epo:announcesAwardDecision <http://data.europa.eu/a4g/resource/00e85dc8-53c7-4463-9427-275781d82d1b-01/AwardDecision/CON-0001>;
216-
epo:announcesNoticeAwardInformation <http://data.europa.eu/a4g/resource/00e85dc8-53c7-4463-9427-275781d82d1b-01/NoticeAwardInformation$_ContractAwardNotice1_UBLExtensions1_UBLExtension1_ExtensionContent1_EformsExtension1_NoticeResult1>;
217213
epo:announcesRole <http://data.europa.eu/a4g/resource/00e85dc8-53c7-4463-9427-275781d82d1b-01/Tenderer/TPA-0001>;
218214
epo:hasESenderDispatchDate "2024-01-02T10:31:59.537+02:00"^^xsd:dateTime;
219215
epo:hasFormType <http://publications.europa.eu/resource/authority/form-type/result>;
@@ -237,10 +233,6 @@
237233
epo:hasScheme "notice-id";
238234
skos:notation "00e85dc8-53c7-4463-9427-275781d82d1b" .
239235

240-
<http://data.europa.eu/a4g/resource/00e85dc8-53c7-4463-9427-275781d82d1b-01/NoticeAwardInformation$_ContractAwardNotice1_UBLExtensions1_UBLExtension1_ExtensionContent1_EformsExtension1_NoticeResult1>
241-
a epo:NoticeAwardInformation;
242-
epo:hasTotalAwardedValue <http://data.europa.eu/a4g/resource/00e85dc8-53c7-4463-9427-275781d82d1b-01/MonetaryValueNoticeAwardInformation$_ContractAwardNotice1_UBLExtensions1_UBLExtension1_ExtensionContent1_EformsExtension1_NoticeResult1> .
243-
244236
<http://data.europa.eu/a4g/resource/00e85dc8-53c7-4463-9427-275781d82d1b-01/Organization/Identifier$_ContractAwardNotice1_UBLExtensions1_UBLExtension1_ExtensionContent1_EformsExtension1_Organizations1_Organization1_Company1_PartyLegalEntity1>
245237
a adms:Identifier;
246238
skos:notation "11184032" .

0 commit comments

Comments
 (0)