Skip to content

Commit 3f2f8aa

Browse files
committed
Refactor languageMaps for RML issue, CN
Extract languageMaps into their own TriplesMaps as RML is "underspecified" for multi-valued properties, leading to odd behaviour in beyond-basic use cases (in this case language code transformation via CSV lookup function). Effectively fixes gh-66 but implements an unintuitive mapping approach (predicate at its own iterator). See also RMLio/rmlmapper-java#235. Affects: - ChangeInformation - ContactPoint - Lot - LotGroup - Organization - Procedure - BT-75-Lot versioned, with fix for version range and dupe conflict - BT-772-Lot versioned ChangeInformation tested with 673305-2023.xml. Many of the Lot fields could not be tested due to unavailability of data (not easily searchable or requirements expressible through currently available means). The change for BT-75-Lot fixes the situation where there was a redundant 1.4+ mapping in the common Lot RML file, and a mistaken version annotation for 1.3-1.3 (being marked as min 1.4). Because later versions are less restrictive, this cannot easily be caught, but was otherwise wrong (the common would override). Additionally, remove some conflicting dupe references in Procedure: - BT-01(d)-Procedure - BT-1351-Procedure This may or may not have led to undefined behaviour in the mapping (there were no change in outputs so hopefully this had no impact).
1 parent 48c5d92 commit 3f2f8aa

File tree

64 files changed

+24118
-10371
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+24118
-10371
lines changed

mappings/package_cn_v1.10/transformation/mappings/ChangeInformation.rml.ttl

Lines changed: 124 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,31 @@ tedm:MG-ChangeInformation_ND-ChangeReason a rr:TriplesMap ;
5353
] ;
5454
] ;
5555
] ;
56-
rr:predicateObjectMap
57-
[
58-
rdfs:label "BT-762-notice";
59-
rdfs:comment "Change Reason Description of MG-ChangeInformation under ND-ChangeReason";
60-
rr:predicate epo:hasChangeReasonDescription ;
61-
rr:objectMap
62-
[
63-
tedm:minSDKVersion "1.4" ;
64-
rdfs:label "BT-762-notice-Language";
65-
rdfs:comment "Language of Change Reason Description of MG-ChangeInformation under ND-ChangeReason";
66-
rml:reference "efbc:ReasonDescription";
67-
rml:languageMap [
68-
fnml:functionValue [
69-
rr:predicateObjectMap [
70-
rr:predicate idlab-fn:str ;
71-
rr:objectMap [ rml:reference "efbc:ReasonDescription/@languageID" ]
72-
] ,
73-
tedm:idlab-fn_executes_lookup ,
74-
tedm:idlab-fn_inputFile_language ,
75-
tedm:idlab-fn_fromColumn_code ,
76-
tedm:idlab-fn_toColumn_code
77-
]
78-
] ;
79-
] ;
80-
] ;
56+
# rr:predicateObjectMap
57+
# [
58+
# rdfs:label "BT-762-notice";
59+
# rdfs:comment "Change Reason Description of MG-ChangeInformation under ND-ChangeReason";
60+
# rr:predicate epo:hasChangeReasonDescription ;
61+
# rr:objectMap
62+
# [
63+
# tedm:minSDKVersion "1.4" ;
64+
# rdfs:label "BT-762-notice-Language";
65+
# rdfs:comment "Language of Change Reason Description of MG-ChangeInformation under ND-ChangeReason";
66+
# rml:reference "efbc:ReasonDescription";
67+
# rml:languageMap [
68+
# fnml:functionValue [
69+
# rr:predicateObjectMap [
70+
# rr:predicate idlab-fn:str ;
71+
# rr:objectMap [ rml:reference "efbc:ReasonDescription/@languageID" ]
72+
# ] ,
73+
# tedm:idlab-fn_executes_lookup ,
74+
# tedm:idlab-fn_inputFile_language ,
75+
# tedm:idlab-fn_fromColumn_code ,
76+
# tedm:idlab-fn_toColumn_code
77+
# ]
78+
# ] ;
79+
# ] ;
80+
# ] ;
8181
rr:predicateObjectMap
8282
[
8383
rdfs:label "BT-758-notice";
@@ -108,30 +108,30 @@ tedm:MG-ChangeInformation_ND-Change a rr:TriplesMap ;
108108
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_ChangeInformation_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path(..)) || '?response_type=raw')}" ;
109109
rr:class epo:ChangeInformation
110110
] ;
111-
rr:predicateObjectMap
112-
[
113-
rdfs:label "BT-141(a)-notice";
114-
rdfs:comment "Change Description of MG-ChangeInformation under ND-Change";
115-
rr:predicate epo:hasChangeDescription ;
116-
rr:objectMap
117-
[
118-
rdfs:label "BT-141(a)-notice-Language";
119-
rdfs:comment "Language of Change Description of MG-ChangeInformation under ND-Change";
120-
rml:reference "efbc:ChangeDescription";
121-
rml:languageMap [
122-
fnml:functionValue [
123-
rr:predicateObjectMap [
124-
rr:predicate idlab-fn:str ;
125-
rr:objectMap [ rml:reference "efbc:ChangeDescription/@languageID" ]
126-
] ,
127-
tedm:idlab-fn_executes_lookup ,
128-
tedm:idlab-fn_inputFile_language ,
129-
tedm:idlab-fn_fromColumn_code ,
130-
tedm:idlab-fn_toColumn_code
131-
]
132-
] ;
133-
] ;
134-
] ;
111+
# rr:predicateObjectMap
112+
# [
113+
# rdfs:label "BT-141(a)-notice";
114+
# rdfs:comment "Change Description of MG-ChangeInformation under ND-Change";
115+
# rr:predicate epo:hasChangeDescription ;
116+
# rr:objectMap
117+
# [
118+
# rdfs:label "BT-141(a)-notice-Language";
119+
# rdfs:comment "Language of Change Description of MG-ChangeInformation under ND-Change";
120+
# rml:reference "efbc:ChangeDescription";
121+
# rml:languageMap [
122+
# fnml:functionValue [
123+
# rr:predicateObjectMap [
124+
# rr:predicate idlab-fn:str ;
125+
# rr:objectMap [ rml:reference "efbc:ChangeDescription/@languageID" ]
126+
# ] ,
127+
# tedm:idlab-fn_executes_lookup ,
128+
# tedm:idlab-fn_inputFile_language ,
129+
# tedm:idlab-fn_fromColumn_code ,
130+
# tedm:idlab-fn_toColumn_code
131+
# ]
132+
# ] ;
133+
# ] ;
134+
# ] ;
135135
rr:predicateObjectMap
136136
[
137137
rdfs:label "BT-718-notice";
@@ -236,3 +236,78 @@ tedm:MG-Identifier-relatesToEFormSectionIdentifier-ChangeInformation_ND-ChangedS
236236
# subject template and predicate mappings are in versioned files (ChangeInformation_v1.3-16|v1.7+)
237237
rdfs:label "MG-Identifier";
238238
.
239+
240+
tedm:MG-langString-hasChangeDescription-ChangeInformation_ND-Change a rr:TriplesMap ;
241+
rr:subjectMap [
242+
rr:class epo-not:ChangeInformation ;
243+
rdfs:label "ND-Change" ;
244+
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_ChangeInformation_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path(../..)) || '?response_type=raw')}" ;
245+
] ;
246+
rr:predicateObjectMap [
247+
rr:predicate epo-not:hasChangeDescription ;
248+
rr:objectMap [
249+
rml:reference "." ;
250+
rml:languageMap [
251+
fnml:functionValue [
252+
rr:predicateObjectMap [
253+
rr:predicate idlab-fn:str ;
254+
rr:objectMap [
255+
rml:reference "@languageID" ;
256+
] ;
257+
] ;
258+
rr:predicateObjectMap tedm:idlab-fn_executes_lookup ;
259+
rr:predicateObjectMap tedm:idlab-fn_fromColumn_code ;
260+
rr:predicateObjectMap tedm:idlab-fn_inputFile_language ;
261+
rr:predicateObjectMap tedm:idlab-fn_toColumn_code ;
262+
] ;
263+
] ;
264+
rdfs:comment "Language of Change Description of MG-ChangeInformation under ND-Change" ;
265+
rdfs:label "BT-141(a)-notice-Language" ;
266+
] ;
267+
rdfs:comment "Change Description of MG-ChangeInformation under ND-Change" ;
268+
rdfs:label "BT-141(a)-notice" ;
269+
] ;
270+
rdfs:label "MG-ChangeInformation" ;
271+
rml:logicalSource [
272+
rml:source "data/source.xml" ;
273+
rml:iterator "/*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:Changes/efac:Change/efbc:ChangeDescription" ;
274+
rml:referenceFormulation ql:XPath ;
275+
] .
276+
277+
tedm:MG-langString-hasChangeReasonDescription-ChangeInformation_ND-ChangeReason a rr:TriplesMap ;
278+
rr:subjectMap [
279+
rr:class epo-not:ChangeInformation ;
280+
rdfs:label "ND-ChangeReason" ;
281+
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_ChangeInformation_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path(../..)) || '?response_type=raw')}" ;
282+
] ;
283+
rr:predicateObjectMap [
284+
rr:predicate epo-not:hasChangeReasonDescription ;
285+
rr:objectMap [
286+
tedm:minSDKVersion "1.4" ;
287+
rml:reference "." ;
288+
rml:languageMap [
289+
fnml:functionValue [
290+
rr:predicateObjectMap [
291+
rr:predicate idlab-fn:str ;
292+
rr:objectMap [
293+
rml:reference "@languageID" ;
294+
] ;
295+
] ;
296+
rr:predicateObjectMap tedm:idlab-fn_executes_lookup ;
297+
rr:predicateObjectMap tedm:idlab-fn_fromColumn_code ;
298+
rr:predicateObjectMap tedm:idlab-fn_inputFile_language ;
299+
rr:predicateObjectMap tedm:idlab-fn_toColumn_code ;
300+
] ;
301+
] ;
302+
rdfs:comment "Language of Change Reason Description of MG-ChangeInformation under ND-ChangeReason" ;
303+
rdfs:label "BT-762-notice-Language" ;
304+
] ;
305+
rdfs:comment "Change Reason Description of MG-ChangeInformation under ND-ChangeReason" ;
306+
rdfs:label "BT-762-notice" ;
307+
] ;
308+
rdfs:label "MG-ChangeInformation" ;
309+
rml:logicalSource [
310+
rml:source "data/source.xml" ;
311+
rml:iterator "/*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:Changes/efac:ChangeReason/efbc:ReasonDescription" ;
312+
rml:referenceFormulation ql:XPath ;
313+
] .

mappings/package_cn_v1.10/transformation/mappings/ContactPoint.rml.ttl

Lines changed: 62 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -67,30 +67,30 @@ tedm:MG-ContactPoint_ND-Touchpoint a rr:TriplesMap ;
6767
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_TouchPoint_{cac:PartyIdentification/cbc:ID}" ;
6868
rr:class cpov:ContactPoint
6969
] ;
70-
rr:predicateObjectMap
71-
[
72-
rdfs:label "BT-500-Organization-TouchPoint" ;
73-
rdfs:comment "Name of MG-ContactPoint of under ND-Touchpoint" ;
74-
rr:predicate dct:description ;
75-
rr:objectMap
76-
[
77-
rdfs:label "BT-500-Organization-TouchPoint-Language" ;
78-
rdfs:comment "Language of Name of MG-ContactPoint of under ND-Touchpoint" ;
79-
rml:reference "cac:PartyName/cbc:Name" ;
80-
rml:languageMap [
81-
fnml:functionValue [
82-
rr:predicateObjectMap [
83-
rr:predicate idlab-fn:str ;
84-
rr:objectMap [ rml:reference "cac:PartyName/cbc:Name/@languageID" ]
85-
] ,
86-
tedm:idlab-fn_executes_lookup ,
87-
tedm:idlab-fn_inputFile_language ,
88-
tedm:idlab-fn_fromColumn_code ,
89-
tedm:idlab-fn_toColumn_code
90-
]
91-
] ;
92-
] ;
93-
] ;
70+
# rr:predicateObjectMap
71+
# [
72+
# rdfs:label "BT-500-Organization-TouchPoint" ;
73+
# rdfs:comment "Name of MG-ContactPoint of under ND-Touchpoint" ;
74+
# rr:predicate dct:description ;
75+
# rr:objectMap
76+
# [
77+
# rdfs:label "BT-500-Organization-TouchPoint-Language" ;
78+
# rdfs:comment "Language of Name of MG-ContactPoint of under ND-Touchpoint" ;
79+
# rml:reference "cac:PartyName/cbc:Name" ;
80+
# rml:languageMap [
81+
# fnml:functionValue [
82+
# rr:predicateObjectMap [
83+
# rr:predicate idlab-fn:str ;
84+
# rr:objectMap [ rml:reference "cac:PartyName/cbc:Name/@languageID" ]
85+
# ] ,
86+
# tedm:idlab-fn_executes_lookup ,
87+
# tedm:idlab-fn_inputFile_language ,
88+
# tedm:idlab-fn_fromColumn_code ,
89+
# tedm:idlab-fn_toColumn_code
90+
# ]
91+
# ] ;
92+
# ] ;
93+
# ] ;
9494
rr:predicateObjectMap
9595
[
9696
rr:predicate locn:address ;
@@ -248,3 +248,41 @@ tedm:MG-ContactPoint_ND-TouchpointContact a rr:TriplesMap ;
248248
] ;
249249
] ;
250250
.
251+
252+
tedm:MG-langString-description-ContactPoint_ND-Touchpoint a rr:TriplesMap ;
253+
rml:logicalSource [
254+
rml:source "data/source.xml" ;
255+
rml:iterator "/*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:Organizations/efac:Organization/efac:TouchPoint/cac:PartyName/cbc:Name" ;
256+
rml:referenceFormulation ql:XPath ;
257+
] ;
258+
rr:subjectMap [
259+
rr:class cccev:ContactPoint ;
260+
rdfs:comment "Primary type declaration for MG-ContactPoint under ND-Touchpoint" ;
261+
rdfs:label "ND-Touchpoint" ;
262+
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_TouchPoint_{../../cac:PartyIdentification/cbc:ID}" ;
263+
] ;
264+
rr:predicateObjectMap [
265+
rr:predicate dct:description ;
266+
rr:objectMap [
267+
rml:reference "." ;
268+
rml:languageMap [
269+
fnml:functionValue [
270+
rr:predicateObjectMap [
271+
rr:predicate idlab-fn:str ;
272+
rr:objectMap [
273+
rml:reference "@languageID" ;
274+
] ;
275+
] ;
276+
rr:predicateObjectMap tedm:idlab-fn_executes_lookup ;
277+
rr:predicateObjectMap tedm:idlab-fn_fromColumn_code ;
278+
rr:predicateObjectMap tedm:idlab-fn_inputFile_language ;
279+
rr:predicateObjectMap tedm:idlab-fn_toColumn_code ;
280+
] ;
281+
] ;
282+
rdfs:comment "Language of Name of MG-ContactPoint of under ND-Touchpoint" ;
283+
rdfs:label "BT-500-Organization-TouchPoint-Language" ;
284+
] ;
285+
rdfs:comment "Name of MG-ContactPoint of under ND-Touchpoint" ;
286+
rdfs:label "BT-500-Organization-TouchPoint" ;
287+
] ;
288+
rdfs:label "MG-ContactPoint" .

0 commit comments

Comments
 (0)