Buyer address in case of multiple buyers
Rule Definition
In each procedure where the buyer address is not provided or it is not valid, it is inferred from the address of the first buyer informed in the procedure.
Additional Information
Rule elaboration
For the simplification of the Buyer address, the following steps must be performed:
- A Notice can be related to one or several epo:Buyers, so for simplification purposes, only the first one is selected.
- Use a SPARQL query to retrieve the epo:Buyer Organization address related properties:
- Path for thoroughfare: (epo:Notice) -> [announcesRole = epo:Buyer] -> epo:playedBy (org:Organization) -> epo:registeredAddress (locn:Address) -> locn:thoroughfare.
- Path for postName: (epo:Notice) -> [announcesRole = epo:Buyer] -> epo:playedBy (org:Organization) -> epo:registeredAddress (locn:Address) -> locn:postName.
- Path for postCode: (epo:Notice) -> [announcesRole = epo:Buyer] -> epo:playedBy (org:Organization) -> epo:registeredAddress (locn:Address) -> locn:postCode.
- Use a function to concat the 3 properties that we need to define the address simplification. (thoroughfare, postName, postCode).
- A construct query is used to add the triple that links the epo:Notice with this Buyer Organization address simplification.
Rule source
(Provide URL to legal source, if applicable)
Rule implementation
Implementation in PPDS SHACL shapes graph:
ppsh:fromBuyerRegistrationAddress
a sh:NodeShape ;
sh:targetClass epo:Procedure ;
sh:rule [
a sh:SPARQLRule ;
sh:prefixes epo: , epo-ppds-ap: ;
sh:construct """"""
PREFIX epo: <http://data.europa.eu/a4g/ontology#>
PREFIX epo-ppds-ap: <http://data.europa.eu/gx2/epo-ppds-ap#>
PREFIX org: <http://www.w3.org/ns/org#>
CONSTRUCT {
$this epo-ppds-ap:fromBuyerRegistrationAddress ?buyerAddress .
}
WHERE {
$this epo-ppds-ap:fromBuyer ?buyer
?buyer a epo:Buyer .
?buyer epo:playedBy ?org .
?org a org:Organization .
?address locn:thoroughfare ?thoroughfare .
?address locn:postName ?postName .
?address locn:postCode ?postCode .
BIND(CONCAT(?thoroughfare, "" "", ?postName, "" "", ?postCode) AS ?buyerAddress)
}
"""""" ;
] ."
Implementation note
(Provide additional implementation information if needed)
Related rules
Related generic rule
(If the rule is a specialisation of a generic rule registered in this Rulebook, include here URL of that generic rule)
History note
(If applicable, add here a note about a previous state of the rule, before the Rulebook)