Skip to content

Commit

Permalink
Fix gh-52 missing hasLegalBasis for certain non-EF16 CN notices
Browse files Browse the repository at this point in the history
The predicate mapping was in the wrong TriplesMap (TMap) that has an
incompatible iterator (a toplevel `TenderingProcess`, which is not
guaranteed to exist), and an absolute XPath reference. It should've been
in the root TMap which has the right iterator (simply the root of the
XML document `/*`, which also allows a relative XPath in the mapping).

Affects EF14, EF15 and EF19 as reported. Tested with EF14 notice
152054-2024.xml.

The following cases have data (from Official Journal publications)
included for testing:

- EF14 for SDK version 1.8 (00152054-2024)
- EF15 for SDK version 1.7 (00140913-2024)
- EF19 for SDK version 1.10 (00128154-2024)

As downloaded from URLs of the form
https://ted.europa.eu/en/notice/152054-2024/xml (first example).

Closes gh-52.
  • Loading branch information
schivmeister committed Sep 20, 2024
1 parent 833f579 commit 33f9605
Show file tree
Hide file tree
Showing 11 changed files with 1,646 additions and 128 deletions.

Large diffs are not rendered by default.

31 changes: 15 additions & 16 deletions mappings/package_cn_v1.10/transformation/mappings/Procedure.rml.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ tedm:MG-Procedure_ND-Root a rr:TriplesMap ;
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_Procedure_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw')}" ;
rr:class epo:Procedure
] ;
rr:predicateObjectMap
[
rdfs:label "BT-01-notice" ;
rdfs:comment "Procedure Legal Basis of MG-Procedure under ND-Root" ;
rr:predicate epo:hasLegalBasis ;
rr:objectMap
[
rdfs:label "at-voc:legal-basis" ;
rr:parentTriplesMap tedm:legal-basis ;
rr:joinCondition [
rr:child "cbc:RegulatoryDomain" ;
rr:parent "code.value" ;
] ;
] ;
] ;
rr:predicateObjectMap
[
rdfs:label "BT-04-notice (object)" ;
Expand Down Expand Up @@ -783,22 +798,6 @@ tedm:MG-Procedure_ND-ProcedureTenderingProcess a rr:TriplesMap ;
] ;
] ;
] ;
# TODO bring this into another TMap to align w/ MG+Node?
rr:predicateObjectMap
[
rdfs:label "BT-01-notice" ;
rdfs:comment "Procedure Legal Basis of MG-Procedure under ND-Root" ;
rr:predicate epo:hasLegalBasis ;
rr:objectMap
[
rdfs:label "at-voc:legal-basis" ;
rr:parentTriplesMap tedm:legal-basis ;
rr:joinCondition [
rr:child "/*/cbc:RegulatoryDomain" ;
rr:parent "code.value" ;
] ;
] ;
] ;
rr:predicateObjectMap
[
rdfs:label "ProcedureTerm";
Expand Down
31 changes: 15 additions & 16 deletions mappings/package_cn_v1.3/transformation/mappings/Procedure.rml.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ tedm:MG-Procedure_ND-Root a rr:TriplesMap ;
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_Procedure_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw')}" ;
rr:class epo:Procedure
] ;
rr:predicateObjectMap
[
rdfs:label "BT-01-notice" ;
rdfs:comment "Procedure Legal Basis of MG-Procedure under ND-Root" ;
rr:predicate epo:hasLegalBasis ;
rr:objectMap
[
rdfs:label "at-voc:legal-basis" ;
rr:parentTriplesMap tedm:legal-basis ;
rr:joinCondition [
rr:child "cbc:RegulatoryDomain" ;
rr:parent "code.value" ;
] ;
] ;
] ;
rr:predicateObjectMap
[
rdfs:label "BT-04-notice (object)" ;
Expand Down Expand Up @@ -783,22 +798,6 @@ tedm:MG-Procedure_ND-ProcedureTenderingProcess a rr:TriplesMap ;
] ;
] ;
] ;
# TODO bring this into another TMap to align w/ MG+Node?
rr:predicateObjectMap
[
rdfs:label "BT-01-notice" ;
rdfs:comment "Procedure Legal Basis of MG-Procedure under ND-Root" ;
rr:predicate epo:hasLegalBasis ;
rr:objectMap
[
rdfs:label "at-voc:legal-basis" ;
rr:parentTriplesMap tedm:legal-basis ;
rr:joinCondition [
rr:child "/*/cbc:RegulatoryDomain" ;
rr:parent "code.value" ;
] ;
] ;
] ;
rr:predicateObjectMap
[
rdfs:label "ProcedureTerm";
Expand Down
31 changes: 15 additions & 16 deletions mappings/package_cn_v1.4/transformation/mappings/Procedure.rml.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ tedm:MG-Procedure_ND-Root a rr:TriplesMap ;
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_Procedure_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw')}" ;
rr:class epo:Procedure
] ;
rr:predicateObjectMap
[
rdfs:label "BT-01-notice" ;
rdfs:comment "Procedure Legal Basis of MG-Procedure under ND-Root" ;
rr:predicate epo:hasLegalBasis ;
rr:objectMap
[
rdfs:label "at-voc:legal-basis" ;
rr:parentTriplesMap tedm:legal-basis ;
rr:joinCondition [
rr:child "cbc:RegulatoryDomain" ;
rr:parent "code.value" ;
] ;
] ;
] ;
rr:predicateObjectMap
[
rdfs:label "BT-04-notice (object)" ;
Expand Down Expand Up @@ -783,22 +798,6 @@ tedm:MG-Procedure_ND-ProcedureTenderingProcess a rr:TriplesMap ;
] ;
] ;
] ;
# TODO bring this into another TMap to align w/ MG+Node?
rr:predicateObjectMap
[
rdfs:label "BT-01-notice" ;
rdfs:comment "Procedure Legal Basis of MG-Procedure under ND-Root" ;
rr:predicate epo:hasLegalBasis ;
rr:objectMap
[
rdfs:label "at-voc:legal-basis" ;
rr:parentTriplesMap tedm:legal-basis ;
rr:joinCondition [
rr:child "/*/cbc:RegulatoryDomain" ;
rr:parent "code.value" ;
] ;
] ;
] ;
rr:predicateObjectMap
[
rdfs:label "ProcedureTerm";
Expand Down
31 changes: 15 additions & 16 deletions mappings/package_cn_v1.5/transformation/mappings/Procedure.rml.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ tedm:MG-Procedure_ND-Root a rr:TriplesMap ;
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_Procedure_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw')}" ;
rr:class epo:Procedure
] ;
rr:predicateObjectMap
[
rdfs:label "BT-01-notice" ;
rdfs:comment "Procedure Legal Basis of MG-Procedure under ND-Root" ;
rr:predicate epo:hasLegalBasis ;
rr:objectMap
[
rdfs:label "at-voc:legal-basis" ;
rr:parentTriplesMap tedm:legal-basis ;
rr:joinCondition [
rr:child "cbc:RegulatoryDomain" ;
rr:parent "code.value" ;
] ;
] ;
] ;
rr:predicateObjectMap
[
rdfs:label "BT-04-notice (object)" ;
Expand Down Expand Up @@ -783,22 +798,6 @@ tedm:MG-Procedure_ND-ProcedureTenderingProcess a rr:TriplesMap ;
] ;
] ;
] ;
# TODO bring this into another TMap to align w/ MG+Node?
rr:predicateObjectMap
[
rdfs:label "BT-01-notice" ;
rdfs:comment "Procedure Legal Basis of MG-Procedure under ND-Root" ;
rr:predicate epo:hasLegalBasis ;
rr:objectMap
[
rdfs:label "at-voc:legal-basis" ;
rr:parentTriplesMap tedm:legal-basis ;
rr:joinCondition [
rr:child "/*/cbc:RegulatoryDomain" ;
rr:parent "code.value" ;
] ;
] ;
] ;
rr:predicateObjectMap
[
rdfs:label "ProcedureTerm";
Expand Down
31 changes: 15 additions & 16 deletions mappings/package_cn_v1.6/transformation/mappings/Procedure.rml.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ tedm:MG-Procedure_ND-Root a rr:TriplesMap ;
rr:template "http://data.europa.eu/a4g/resource/id_{replace(replace(/*/cbc:ID[@schemeName='notice-id'], ' ', '-' ), '/' , '-')}_Procedure_{unparsed-text('https://digest-api.ted-data.eu/api/v1/hashing/fn/uuid/' || encode-for-uri(path()) || '?response_type=raw')}" ;
rr:class epo:Procedure
] ;
rr:predicateObjectMap
[
rdfs:label "BT-01-notice" ;
rdfs:comment "Procedure Legal Basis of MG-Procedure under ND-Root" ;
rr:predicate epo:hasLegalBasis ;
rr:objectMap
[
rdfs:label "at-voc:legal-basis" ;
rr:parentTriplesMap tedm:legal-basis ;
rr:joinCondition [
rr:child "cbc:RegulatoryDomain" ;
rr:parent "code.value" ;
] ;
] ;
] ;
rr:predicateObjectMap
[
rdfs:label "BT-04-notice (object)" ;
Expand Down Expand Up @@ -783,22 +798,6 @@ tedm:MG-Procedure_ND-ProcedureTenderingProcess a rr:TriplesMap ;
] ;
] ;
] ;
# TODO bring this into another TMap to align w/ MG+Node?
rr:predicateObjectMap
[
rdfs:label "BT-01-notice" ;
rdfs:comment "Procedure Legal Basis of MG-Procedure under ND-Root" ;
rr:predicate epo:hasLegalBasis ;
rr:objectMap
[
rdfs:label "at-voc:legal-basis" ;
rr:parentTriplesMap tedm:legal-basis ;
rr:joinCondition [
rr:child "/*/cbc:RegulatoryDomain" ;
rr:parent "code.value" ;
] ;
] ;
] ;
rr:predicateObjectMap
[
rdfs:label "ProcedureTerm";
Expand Down
Loading

0 comments on commit 33f9605

Please # to comment.