Code development platform for open source projects from the European Union institutions 🔵 EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content

CPV is consistent with the contract nature type

Rule Definition

For every procedure, at least 1 classification code (CPV code, main or additional) is consistent with the contract nature type.


Additional Information

Rule elaboration

Consistency Business Rule with ID CON008 as defined in deliverable D06.06 – Data Quality Action Plan.

Ontology property involved:

http://data.europa.eu/a4g/ontology#hasContractNatureType

http://data.europa.eu/a4g/ontology#hasMainClassification

Rule source

https://code.europa.eu/eproc/ppds/documentation/-/blob/main/documents/d0606_data_quality_action_plan.md#23-consistency-business-rules

Rule implementation

ppsh:ContractTerm-hasContractNatureTypeQuery

Implementation note

Implementation in PPDS SHACL shapes graph:

ppsh:ContractTerm-hasContractNatureTypeQuery a sh:SPARQLConstraint ;
    sh:description "At least 1 main classification (CPV code) must be aligned with the contract nature type." ;
    sh:severity sh:Warning ;
    sh:message "CON008" ;
    sh:name "Contract term nature type" ;
    sh:prefixes epo: ;
    sh:select """
            PREFIX epo: <http://data.europa.eu/a4g/ontology#>
            PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
            SELECT DISTINCT $this ((epo:hasMainClassification) AS ?path) (?resultBind as  ?value)
            WHERE{
                $this a epo:Notice .
                $this epo:refersToProcedure ?procedure .
                ?procedure epo:foreseesContractSpecificTerm/epo:hasContractNatureType ?nature .
                ?procedure epo:hasPurpose/epo:hasMainClassification ?classification .
                BIND(xsd:integer(SUBSTR(?classification , 31, 2)) AS ?numClassification)
                BIND(IF(((?numClassification >= 0 && ?numClassification <= 44) || (?numClassification = 48)) && ?nature = 'Goods',True,
                        IF(((?numClassification >= 0 && ?numClassification <= 44) || (?numClassification = 48)) && ?nature = 'Goods',True,
                            IF(?numClassification = 45 && ?nature = 'Works',True,
                                IF(?numClassification >= 46 && ?nature = 'Services',True,False)))) AS ?resultBind)
            }
    """ .

https://sdlc.webcloud.ec.europa.eu/ppds/docker/ppds-shacl-shapes/-/blob/featured/revision_0.3.3/ppds-shapes.ttl?ref_type=heads

Related rules

#18

#19

#53

#54

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)

Edited by Alba Colomer