Notice is from Country
Rule Definition
The notice is from a country of such a buyer that is linked to a notice with relationship from Buyer.
Additional Information
Rule elaboration
As a context, the path from the notice to the country is long and requires several steps. The following code snippet illustrates the retrieval of the country code for a particular notice:
?notice epo:announcesRole ?buyer .
?buyer a epo:Buyer .
?buyer epo:playedBy ?buyerOrganisation .
?buyerOrganisation epo:registeredAddress ?orgAddress .
?orgAddress epo:hasCountryCode ?buyerCountry .
The objective of this rule is to simplify the relation between the notice and the country to which this notice belongs.
Rule source
(Provide URL to legal source, if applicable)
Rule implementation
Something like this:
epo-ppds-ap:notice-from-country
a sh:SPARQLRule ;
prov:wasDerivedFrom <https://code.europa.eu/eproc/ppds/public-procurement-rulebook/-/issues/2> ;
sh:construct """
CONSTRUCT {
$this epo-ppds-ap:fromCountry ?buyerCountry
}
WHERE {
$this epo:announcesRole ?buyer .
?buyer a epo:Buyer .
?buyer epo:playedBy ?buyerOrganisation .
?buyerOrganisation epo:registeredAddress ?orgAddress .
?orgAddress epo:hasCountryCode ?buyerCountry .
{
SELECT $this (COUNT(DISTINCT ?buyer) AS ?NoB)
WHERE {
$this epo:announcesRole ?buyer .
?buyer a epo:Buyer .
}
GROUP BY $this
}
FILTER(?NoB = 1)
}
""" ;
.
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)