@prefix sh:   <http://www.w3.org/ns/shacl#> .
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .
@prefix ocd:  <http://dati.camera.it/ocd/> .
@prefix m4s: <http://purl.org/map4scrutiny-core#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix dbo: <http://dbpedia.org/ontology/> .
@prefix qudt: <http://qudt.org/schema/qudt/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix schema: <https://schema.org/> .
@prefix bibo: <http://purl.org/ontology/bibo/> .
@prefix sem: <http://semanticweb.cs.vu.nl/2009/11/sem/> .
@prefix prov: <https://www.w3.org/ns/prov-o> .
@prefix time: <https://www.w3.org/2006/time> .
@prefix org: <http://www.w3.org/ns/org#> .
@prefix pe: <http://parliament.uk/ontologies/election/> .
@prefix polis-core: <http://purl.org/polis/ar/core#> .
@prefix polis-bio: <http://purl.org/polis/ar/biographic#> .
@prefix polis-ini: <http://purl.org/polis/ar/initiatives#> .
@prefix polis-mpact: <http://purl.org/polis/ar/mp-activity#> .

# ------------------ CORE ------------------

#################################################################
# Person
#################################################################

_:PersonShape a sh:NodeShape ;
    sh:targetClass foaf:Person ;
    sh:targetClass m4s:Parliamentarian ;
    sh:targetClass ocd:membroGoverno ;
    sh:targetClass polis-core:Guest ;

    sh:property [
        sh:path foaf:name ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "A Person must have at most one name and the name must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path foaf:birthday ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:message "A Person must at most one birthday and the birthday must be a xsd:date"@en
    ] ;

    sh:property [
        sh:path schema:gender ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "A Person must at most one gender and the gender must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path schema:jobTitle ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "A Person must at most one job title and the job title must be a xsd:string"@en
    ] .

#################################################################
# MP
#################################################################

_:ParliamentarianShape a sh:NodeShape;
    sh:targetClass m4s:Parliamentarian ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:datatype xsd:string ;
        sh:message "A parliamentarian must have one and only one identifier and the identifier must be xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislature ;
        sh:minCount 1 ;
        sh:class ocd:legislatura ;
        sh:message "A parliamentarian must belong to at least one legislature"@en
    ] ;

    sh:property [
        sh:path ocd:rif_mandatoCamera ;
        sh:minCount 1 ;
        sh:class ocd:mandatoCamera ;
        sh:message "A parliamentarian must have served in at least one mandate"@en
    ] ;
    
    sh:property [
        sh:path polis-bio:hasHabilitation ;
        sh:class polis-bio:Habilitation ;
        sh:message "A parliamentarian habilitation must be of the class polis-bio:Habilitation"@en
    ] ;

    sh:property [
        sh:path dbo:award ;
        sh:class dbo:Award ;
        sh:message "A parliamentarian award must be of the class dbo:Award"@en
    ] ;

    sh:property [
        sh:path polis-bio:hasTitle ;
        sh:class polis-bio:Title ;
        sh:message "A parliamentarian title must be of the class polis-bio:Title"@en
    ] ;
    
    sh:property [
        sh:path polis-bio:authorOf ;
        sh:class bibo:Document ;
        sh:message "A parliamentarian publications must be of the class bibo:Document"@en
    ] ;

    sh:property [
        sh:path polis-bio:hasRole ;
        sh:class polis-bio:Role ;
        sh:message "A parliamentarian role must be of the class polis-bio:Role"@en
    ] ;

    sh:property [
        sh:path polis-core:hasMembership ;
        sh:class polis-core:Membership ;
        sh:message "A parliamentarian membership must be of the class polis-core:Membership"@en
    ] ;

    sh:property [
        sh:path polis-mpact:didYouthParliamentActivity ;
        sh:class polis-mpact:YouthParliamentActivity ;
        sh:message "A parliamentarian youth parliament activity must be of the class polis-mpact:YouthParliamentActivity"@en
    ] ;

    sh:property [
        sh:path polis-mpact:didRequisition ;
        sh:or (
            [ sh:class ocd:richiestaParere ]
            [ sh:class polis-mpact:Request ]
            [ sh:class polis-mpact:Inquiry ]
        ) ;
        sh:message "A parliamentarian requisition must be of the class ocd:richiestaParere or polis-mpact:Request or polis-mpact:Inquiry"@en
    ] ;

    sh:property [
        sh:path polis-mpact:didCommissionActivity ;
        sh:class polis-mpact:CommissionActivity ;
        sh:message "A parliamentarian commission activity must be of the class polis-mpact:CommissionActivity"@en
    ] ;

    sh:property [
        sh:path polis-mpact:didParliamentaryActivity ;
        sh:class polis-mpact:ParliamentaryActivity ;
        sh:message "A parliamentarian parliamentary activity must be of the class polis-mpact:ParliamentaryActivity"@en
    ] .

#################################################################
# MG
#################################################################

_:MGShape a sh:NodeShape;
    sh:targetClass ocd:membroGoverno ;

    sh:propery [
        sh:path polis-core:duty ;
        sh:datatype xsd:string ;
        sh:message "A member of government duty must be of the type xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-core:holdsDuty ;
        sh:or (
            [ sh:class org:Post ]
            [ sh:class polis-core:PAR ]
            [ sh:class polis-core:VicePAR ]
            [ sh:class polis-core:Secretary ]
            [ sh:class polis-core:ViceSecretary ]
        ) ;
        sh:message "A member of government held duty must be of the class org:Post"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToGovernment ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:class ocd:governo ;
        sh:message "A member of government must belong to one and only one government"@en
    ] .

#################################################################
# Guest
#################################################################

_:GuestShape a sh:NodeShape;
    sh:targetClass polis-core:Guest ;

    sh:property [
        sh:path polis-core:honour ;
        sh:maxCount 1 ;
        sh:datatype xsd:boolean ;
        sh:message "A guest must at most one boolean declaration on whether it is a guest of honour"@en
    ] ;

    sh:property [
        sh:path dbo:country ;
        sh:maxCount 1 ;
        sh:class dbo:Country ;
        sh:message "A guest must at most one country of origin"@en
    ] ;

    sh:propery [
        sh:path polis-core:duty ;
        sh:datatype xsd:string ;
        sh:message "A guest duty must be of the type xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-core:holdsDuty ;
        sh:or (
            [ sh:class org:Post ]
            [ sh:class polis-core:PAR ]
            [ sh:class polis-core:VicePAR ]
            [ sh:class polis-core:Secretary ]
            [ sh:class polis-core:ViceSecretary ]
        ) ;
        sh:message "A guest held duty must be of the class org:Post"@en
    ] .

#################################################################
# Mandate
#################################################################

_:MandateShape a sh:NodeShape ;
    sh:targetClass ocd:mandatoCamera ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:maxCount 1 ;
        sh:datatype xsd:string ;
        sh:message "A mandate must have at most one identifier and the identifier must be xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-core:parliamentaryName ;
        sh:minCount 1 ;
        sh:datatype xsd:string ;
        sh:message "A mandate must have at least one parliamentary name and the parliamentary name must be xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislature ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:class ocd:legislatura ;
        sh:message "A mandate must belong to one and only one legislature"@en
    ] ;

    sh:property [
        sh:path polis-core:hasMembership ;
        sh:minCount 1 ;
        sh:class polis-core:Membership ;
        sh:message "A mandate must have at least one membership"@en
    ] ;

    sh:property [
        sh:path ocd:tipoProclamazione ;
        sh:minCount 1 ;
        sh:or (
            [ sh:class ocd:proclamazione ]
            [ sh:class polis-core:Withdrawal ]
            [ sh:class polis-core:Incumbent ]
            [ sh:class polis-core:PermanentIncumbent ]
            [ sh:class polis-core:TemporaryIncumbent ]
            [ sh:class polis-core:Deceased ]
            [ sh:class polis-core:Disqualified ]
            [ sh:class polis-core:LossOfMandate ]
            [ sh:class polis-core:Resigned ]
            [ sh:class polis-core:Alternate ]
            [ sh:class polis-core:Suspended ]
        ) ;
        sh:message "A mandate must be in at least one situation"@en
    ] ;

    sh:property [
        sh:path polis-core:inConstituency ;
        sh:maxCount 1 ;
        sh:class polis-core:Constituency ;
        sh:message "A mandate must have at most one constituency"@en
    ] ;

    sh:property [
        sh:path polis-core:holdsDuty ;
        sh:or (
            [ sh:class org:Post ]
            [ sh:class polis-core:PAR ]
            [ sh:class polis-core:VicePAR ]
            [ sh:class polis-core:Secretary ]
            [ sh:class polis-core:ViceSecretary ]
        ) ;
        sh:message "A mandate with a duty must be of the type org:Post"@en
    ] .

#################################################################
# Organo
#################################################################

_:OrganoShape a sh:NodeShape ;
    sh:targetClass ocd:organo ;
    sh:targetClass polis-core:Commission ;
    sh:targetClass polis-core:WorkingGroup ;
    sh:targetClass polis-core:ARWorkingGroup ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "An organo must have an identifier and the identifier must be xsd:string"@en
    ] ;

    sh:property [
        sh:path dct:description ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "An organo must have at most one description and the description must be xsd:string"@en
    ] ;

    sh:property [
        sh:path foaf:name ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "An organo must have at most one name and the name must be xsd:string"@en
    ] ;

    sh:property [
        sh:path qudt:acronym ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "An organo must have at most one acronym and the acronym must be xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislature ;
        sh:class ocd:legislatura ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "An organo must belong to one and only one legislature"@en
    ] .

#################################################################
# Commission
#################################################################

_:CommissionShape a sh:NodeShape ;
    sh:targetClass polis-core:Commission ;

    sh:property [
        sh:path dbo:number ;
        sh:datatype xsd:nonNegativeInteger ;
        sh:maxCount 1 ;
        sh:message "A commission must at most one number and the number must be xsd:nonNegativeInteger"@en
    ] ;

    sh:property [
        sh:path polis-ini:isPublishedInDAR ;
        sh:class polis-ini:DARPublication ;
        sh:message "A Commission publication in the DAR must be of the class polis-ini:DARPublication"@en
    ] ;
    
    sh:property [
        sh:path polis-core:isSubCommissionOf ;
        sh:class polis-core:Commission ;
        sh:message "A Commission must be a subcommission of a Commission"@en
    ] ;
    
    sh:property [
        sh:path polis-core:hasSubCommission ;
        sh:class polis-core:Commission ;
        sh:message "A Commission must have a subcommission of class polis-core:Commission"@en
    ] .

#################################################################
# Situation
#################################################################

_:SituationShape a sh:NodeShape ;
    sh:targetClass ocd:proclamazione ;
    sh:targetClass polis-core:Withdrawal ;
    sh:targetClass polis-core:Incumbent ;
    sh:targetClass polis-core:PermanentIncumbent ;
    sh:targetClass polis-core:TemporaryIncumbent ;
    sh:targetClass polis-core:Deceased ;
    sh:targetClass polis-core:Disqualified ;
    sh:targetClass polis-core:LossOfMandate ;
    sh:targetClass polis-core:Resigned ;
    sh:targetClass polis-core:Alternate ;
    sh:targetClass polis-core:Suspended ;
    
    sh:property [
        sh:path dct:date ;
        sh:maxCount 1 ;
        sh:message "A Situation must have at most one date"@en
    ] .

#################################################################
# Duty / Post
#################################################################~

_:DutyShape a sh:NodeShape ;
    sh:targetClass org:Post ;
    sh:targetClass polis-core:PAR ;
    sh:targetClass polis-core:VicePAR ;
    sh:targetClass polis-core:Secreatary ;
    sh:targetClass polis-core:ViceSecretary ;
    
    sh:property [
        sh:path dct:date ;
        sh:maxCount 1 ;
        sh:message "A Duty must have at most one date"@en
    ] .

#################################################################
# Membership
#################################################################

_:MembershipShape a sh:NodeShape ;
    sh:targetClass polis-core:Membership ;

    sh:property [
        sh:path dct:date ;
        sh:maxCount 1 ;
        sh:message "A Membership must have at most one date"@en
    ] ;

    sh:property [
        sh:path polis-core:isMemberOf ;
        sh:maxCount 1 ;
        # ehhh, não sei se esta será a melhor mensagem, mas fica a ideia.
        # sh:or foi removido porque Membership já não especifica range, para ser mais flexivel.
        sh:message "A Membership must have at most one isMemberOf property"@en
    ] ;

    sh:property [
        sh:path polis-core:hasRole ;
        sh:class polis-bio:Role ;
        sh:maxCount 1 ;
         sh:message "A Membership must have at most one Role and it must be of the type polis-bio:Role"@en
    ] .

#################################################################
# Legislature
#################################################################

_:LegislatureShape a sh:NodeShape ;
    sh:targetClass ocd:legislatura ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A legislatura must have one identifier and it must be of the type xsd:string"@en
    ] ;

    sh:property [
        sh:path dct:date ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A legislatura must have one date"@en
    ] ;

    sh:property [
        sh:path dbo:number ;
        sh:datatype xsd:nonNegativeInteger ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A legislatura must have one and only one number and the number must be xsd:nonNegativeInteger"@en
    ] .

#################################################################
# Legislative Session
#################################################################

_:LegislativeSessionShape a sh:NodeShape ;
    sh:targetClass ocd:sessioneLegislatura ;

    sh:property [
        sh:path dbo:number ;
        sh:datatype xsd:nonNegativeInteger ;
        sh:maxCount 1 ;
        sh:message "A sessioneLegislatura session must at most have one number and the number must be of the type xsd:nonNegativeInteger"
    ] ;
    
    sh:property [
        sh:path dct:date ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A sessioneLegislatura must have one and only one date"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislature ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:class ocd:legislatura ;
        sh:message "A sessioneLegislatura must belong to one and only one legislatura"@en
    ] .

#################################################################
# Party
#################################################################

_:PartyShape a sh:NodeShape ;
    sh:targetClass polis-core:Party ;

    sh:property [
        sh:path foaf:name ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A party must have at most one and only one name and the name must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path qudt:acronym ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A party must have one and only one acronym and the acronym must be xsd:string"@en
    ] .

#################################################################
# Parliamentary Group
#################################################################

_:ParliamentaryGroupShape a sh:NodeShape ;
    sh:targetClass polis-core:ParliamentaryGroup ;

    sh:property [
        sh:path dct:date ;
        sh:maxCount 1 ;
        sh:message "A parliamentary group must have at most one date"@en
    ] ;

    sh:property [
        sh:path polis-core:isOfParty ;
        sh:class polis-core:Party ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A parliamentary group must be of one and only one party"@en
    ] ; 
    
    sh:property [
        sh:path polis-core:belongsToLegislature ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:class ocd:legislatura ;
        sh:message "A parliamentary group must belong to one and only one legislature"@en
    ] .

#################################################################
# Government
#################################################################

_:GovernmentShape a sh:NodeShape ;
    sh:targetClass ocd:governo ;

    sh:property [
        sh:path dbo:number ;
        sh:datatype xsd:nonNegativeInteger ;
        sh:maxCount 1 ;
        sh:message "A governo must have at most one number and the number must be xsd:nonNegativeInteger"@en
    ] .

#################################################################
# Constituency
#################################################################

_:ConstituencyShape a sh:NodeShape ;
    sh:targetClass pe:ConstituencyArea ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:datatype xsd:string ;
        sh:message "A constituency must have one and only one identifier and the identifier must be xsd:string"@en
    ] ;

    sh:property [
        sh:path foaf:name ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A constituency must have exactly one name and the name must be a xsd:string"@en
    ] .

# ------------------ Initiative ------------------

#################################################################
# Initiative
#################################################################

_:InitiativeShape a sh:NodeShape ;
    sh:targetClass polis-ini:Initiative ;
    sh:targetClass polis-ini:ConstitutionalRevisionProject ;
    sh:targetClass polis-ini:DeliberationProject ;
    sh:targetClass polis-ini:LawProject ;
    sh:targetClass polis-ini:LawProposal ;
    sh:targetClass polis-ini:ParliamentaryAppreciation ;
    sh:targetClass polis-ini:ParliamentaryInquiry ;
    sh:targetClass polis-ini:PopularReferendumInitiative ;
    sh:targetClass polis-ini:Ratification ;
    sh:targetClass polis-ini:ResolutionProject ;
    sh:targetClass polis-ini:ResolutionProposal ;
    sh:targetClass polis-ini:RulesOfProcedureProject ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:datatype xsd:string ;
        sh:message "An initiative must have one and only one identifier and the identifier must be xsd:string"@en
    ] ;

    sh:property [
        sh:path dct:title ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:datatype xsd:string ;
        sh:message "An initiative must have one and exactly one title and the title must be xsd:string"@en
    ] ;
    
    sh:property [
        sh:path dbo:number ;
        sh:datatype xsd:nonNegativeInteger ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "An initiative must one and only one number and the number must be xsd:nonNegativeInteger"@en
    ] ;

    sh:property [
        sh:path polis-ini:textSubstitutionDetails ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "An initiative must have at most one text substitution detail and it must be xsd:string"@en
    ] ;
    
    sh:property [
        sh:path polis-core:belongsToLegislature ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:class ocd:legislatura ;
        sh:message "An initiative must belong to one and only one legislature"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislativeSession ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:class ocd:sessioneLegislatura ;
        sh:message "An initiative must belong to one and only one legislaturive session"@en
    ] ;

    sh:property [
        sh:path polis-ini:hasAuthor ;
        sh:class m4s:Parliamentarian ;
        sh:message "An initiative author must be of the class m4s:Parliamentarian"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:hasProponent ;
        sh:or (
            [ sh:class polis-core:ParliamentaryGroup ]
            [ sh:class m4s:Parliamentarian ]
            [ sh:class ocd:governo ]
            [ sh:class polis-core:Commission ]
            [ sh:class polis-ini:RegionalLegislativeAssembly ]
            [ sh:class polis-ini:CitizenGroup ]
        ) ;
        sh:message "An initiative proponent must be a polis-core:ParliamentaryGroup, m4s:Parliamentarian, ocd:governo, polis-core:Commission, polis-ini:RegionalLegislativeAssembly or polis-ini:CitizenGroup "@en
    ] ;
    
    sh:property [
        sh:path polis-ini:hasEvent ;
        sh:class polis-ini:Event ;
        sh:message "An initiative event must be of the class polis-ini:Event"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:hasAnnex ;
        sh:class bibo:Document ;
        sh:message "An initiative annex must be of the class bibo:Document"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:grewOutOf ;
        sh:or (
            [sh:class polis-ini:Initiative]
            [sh:class polis-ini:EuropeanInitiative]
            [ sh:class polis-ini:ConstitutionalRevisionProject ]
            [ sh:class polis-ini:DeliberationProject ]
            [ sh:class polis-ini:LawProject ]
            [ sh:class polis-ini:LawProposal ]
            [ sh:class polis-ini:ParliamentaryAppreciation ]
            [ sh:class polis-ini:ParliamentaryInquiry ]
            [ sh:class polis-ini:PopularReferendumInitiative ]
            [ sh:class polis-ini:Ratification ]
            [ sh:class polis-ini:ResolutionProject ]
            [ sh:class polis-ini:ResolutionProposal ]
            [ sh:class polis-ini:RulesOfProcedureProject ]
        ) ;
        sh:message "An initiative must grow out of a polis-ini:Initiative or a polis-ini:EuropeanInitiative"@en
    ] ;

    sh:property [
        sh:path polis-ini:ledTo ;
        sh:or (
            [ sh:class polis-ini:Initiative ]
            [ sh:class polis-ini:ConstitutionalRevisionProject ]
            [ sh:class polis-ini:DeliberationProject ]
            [ sh:class polis-ini:LawProject ]
            [ sh:class polis-ini:LawProposal ]
            [ sh:class polis-ini:ParliamentaryAppreciation ]
            [ sh:class polis-ini:ParliamentaryInquiry ]
            [ sh:class polis-ini:PopularReferendumInitiative ]
            [ sh:class polis-ini:Ratification ]
            [ sh:class polis-ini:ResolutionProject ]
            [ sh:class polis-ini:ResolutionProposal ]
            [ sh:class polis-ini:RulesOfProcedureProject ]
        ) ;
        sh:message "An initiative must lead to initiatives of the class polis-ini:Initiative"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:receivedChangeProposal ;
        sh:class polis-ini:ChangeProposal ;
        sh:message "An initiative received change proposal must be of the class polis-ini:ChangeProposal"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:hasRelatedPetition ;
        sh:class polis-ini:Petition ;
        sh:message "An initiative related petition must be of the class polis-ini:Petition"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:hasContent ;
        sh:class bibo:Document ;
        sh:maxCount 1 ;
        sh:message "An initiative must have at most one content document and the class of the document must be bibo:Document"@en
    ] .
    
#################################################################
# European Initiative
#################################################################

_:EuropeanInitiativeShape a sh:NodeShape ;
    sh:targetClass polis-ini:EuropeanInitiative ;

    sh:property [
        sh:path schema:url ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "An european initiative must have one and only one url and the type must be xsd:string"@en
    ] .

#################################################################
# Regional Legislative Assembly
#################################################################

_:RegionalLegislativeAssemblyShape a sh:NodeShape ;
    sh:targetClass polis-ini:RegionalLegislativeAssembly ;

    sh:property [
        sh:path sem:hasPlace ;
        sh:class sem:Place ;
        sh:maxCount 1 ;
        sh:message "A regional legislative assembly must have at most one place of the class sem:Place"@en
    ] .

#################################################################
# Change Proposal
#################################################################

_:ChangeProposalShape a sh:NodeShape ;
    sh:targetClass polis-ini:ChangeProposal ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:datatype xsd:string ;
        sh:message "A change proposal must have one and only one identifier and the identifier must be xsd:string"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:changeProposalType ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "A change proposal must have at most one change proposal type and it must be xsd:string"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:proponent ;
        sh:datatype xsd:string ;
        sh:message "A change proposal proponent must be of the type xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-ini:isPublishedInDAR ;
        sh:class polis-ini:DARPublication ;
        sh:message "A change proposal publication in the DAR must be of the class polis-ini:DARPublication"@en
    ] ;

    sh:property [
        sh:path polis-ini:isProposedBy ;
        sh:or (
            [sh:class m4s:Parliamentarian]
            [sh:class polis-core:ParliamentaryGroup]
        ) ;
        sh: "A change proposal can only be proposed by m4s:Parliamentarian or polis-core:ParliamentaryGroup"@en
    ] .

#################################################################
# DAR Publication
#################################################################

_:DARPublicationShape a sh:NodeShape ;
    sh:targetClass polis-ini:DARPublication ;
    sh:targetClass polis-ini:DARSeries1 ;
    sh:targetClass polis-ini:DARSeries2 ;
    sh:targetClass polis-ini:DARSeparata ;
    sh:targetClass polis-ini:DARSeries2A ;
    sh:targetClass polis-ini:DARSeries2B ;
    sh:targetClass polis-ini:DARSeries2C ;
    sh:targetClass polis-ini:DARSeries2D ;
    sh:targetClass polis-ini:DARSeries2E ;
    sh:targetClass polis-ini:DARSeries1A ;
    sh:targetClass polis-ini:DARSeries2CRC ;
    sh:targetClass polis-ini:DARSeries2CGOPOE ;
    sh:targetClass polis-ini:DARSeries2SCOE ;
    sh:targetClass polis-ini:DARSeries2CCEI ;
    sh:targetClass polis-ini:DARSeries2SOE ;

    sh:property [
        sh:path dbo:number ;
        sh:datatype xsd:nonNegativeInteger ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A DAR publication must one and only one number and the number must be xsd:nonNegativeInteger"@en
    ] ;

    sh:property [
        sh:path dbo:code ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A DAR publication must have one and only one code and the code must be xsd:string"@en
    ] ;
    
    sh:property [
        sh:path dct:date ;
        sh:datatype xsd:date ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A DAR publication must have one and only one date and it must be of the type xsd:date"@en
    ] ;
    
    sh:property [
        sh:path schema:pagination ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message  "A DAR publication must have one and only one pagination and it must be of the type xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-ini:pagesIdentifier ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A DAR publication must have one and only one pages' identifier and it must be of the type xsd:string"@en
    ] ;

    sh:property [
        sh:path schema:url ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A DAR publication must have one and only one url and it must be of the type xsd:string"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:publicationSupplement ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "A DAR publication must have at most one supplement and it must be of the type xsd:string"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:publicationSupplementFinalPage ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "A DAR publication must have at most one supplement final page and it must be of the type xsd:string"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:observation ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "A DAR publication must have at most one observation and it must be of the type xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislature ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:class ocd:legislatura ;
        sh:message "A DAR publication must belong to one and only one legislature"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislativeSession ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:class ocd:sessioneLegislatura ;
        sh:message "A DAR publication must belong to one and only one legislaturive session"@en
    ] .

#################################################################
# Document
#################################################################

_:DocumentShape a sh:NodeShape ;
    sh:targetClass bibo:Document ;

    sh:property [
        sh:path polis-ini:documentType ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "A document must have at most one document type and it must be of the type xsd:string"@en
    ] ;

    sh:property [
        sh:path dct:title ;
        sh:maxCount 1 ;
        sh:datatype xsd:string ;
        sh:message "A document must have at most one title and the title must be xsd:string"@en
    ] ;

    sh:property [
        sh:path dct:date ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:message "A document must have at most one date and it must be of the type xsd:date"@en
    ] ;

    sh:property [
        sh:path schema:url ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "A document must have at most one url and it must be of the type xsd:string"@en
    ] ;

    sh:property [
        sh:path bibo:content ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "A document must have at most one content and it must be of the type xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:maxCount 1 ;
        sh:datatype xsd:string ;
        sh:message "A document must have at most one identifier and the identifier must be xsd:string"@en
    ] .

#################################################################
# Legislation
#################################################################

_:LegislationShape a sh:NodeShape ;
    sh:targetClass bibo:Legislation ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:maxCount 1 ;
        sh:datatype xsd:string ;
        sh:message "A legislation must have at most one identifier and the identifier must be xsd:string"@en
    ] .

#################################################################
# Petition
#################################################################

_:PetitionShape a sh:NodeShape ;
    sh:targetClass polis-ini:Petition ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:datatype xsd:string ;
        sh:message "A petition must have one and only one identifier and the identifier must be xsd:string"@en
    ] ;
    
    sh:property [
        sh:path dbo:number ;
        sh:datatype xsd:nonNegativeInteger ;
        sh:maxCount 1 ;
        sh:message "A petition must at most one number and the number must be xsd:nonNegativeInteger"@en
    ] ;

    sh:property [
        sh:path dct:title ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:datatype xsd:string ;
        sh:message "An petition must have one and only one title and the title must be xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislature ;
        sh:class ocd:legislatura ;
        sh:message "An petition must belong a legislature of the type ocd:legislatura"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislativeSession ;
        sh:class ocd:sessioneLegislatura ;
        sh:message "An initiative must belong to a legislaturive session of the type ocd:sessioneLegislatura"@en
    ] .

#################################################################
# Event
#################################################################

_:EventShape a sh:NodeShape ;
    sh:targetClass polis-ini:Event ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:datatype xsd:string ;
        sh:message "An event must have one and only one identifier and the identifier must be xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-ini:typeId ;
        sh:datatype xsd:string ;
        sh:minCount 1;
        sh:maxCount 1;
        sh:message "An event must have one and only one typeId and it must be of the type xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-ini:eventType ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "An event must have one and exactly one event type and it must be of the type xsd:string"@en
    ] ;

    sh:property [
        sh:path dct:date ;
        sh:datatype xsd:date ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "An event must have one and only one date and it must be of the type xsd:date"@en
    ] ;

    sh:property [
        sh:path dbo:code ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "An event must have one and only one code and the code must be xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-ini:observation ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "An event must have at most one observation and it must be of the type xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-ini:approvesDiploma;
        sh:class bibo:Legislation ;
        sh:message "An event approved diploma must be of the class bibo:Legislation"@en
    ] ;

    sh:property [
        sh:path polis-ini:hasDiscussion ;
        sh:class ocd:discussione ;
        sh:maxCount 1 ;
        sh:message "An event must have at most one discussion and it must be of the class ocd:discussione"@en
    ] ;

    sh:property [
        sh:path polis-ini:happensJointlyWithInitiative ;
        sh:class polis-ini:Initiative ;
        sh:message "An event may happen jointly with initiatives and they must be of the type polis-ini:Initiative"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:discussedJointlyWith ;
        sh:class polis-ini:Petition ;
        sh:message "An event may be discussed jointly with petitions and they must be of the type polis-ini:Petition"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:hasAnnex ;
        sh:class bibo:Document ;
        sh:message "An event annex must be of the class bibo:Document"@en
    ] ;

    sh:property [
        sh:path polis-ini:hasVote ;
        sh:class ocd:votazione ;
        sh:message "An event vote must be of the class ocd:votazione"@en
    ] ;

    sh:property [
        sh:class polis-ini:receivedAppeal ;
        sh:or (
            [sh:class m4s:Parliamentarian]
            [sh:class polis-core:ParliamentaryGroup]
        ) ;
        sh:message "An event may only receive appeals from m4s:Parliamentarian or polis-core:ParliamentaryGroup"@en
    ] ;

    sh:property [
        sh:path polis-ini:isPublishedInDAR ;
        sh:class polis-ini:DARPublication ;
        sh:message "An event publication in the DAR must be of the class polis-ini:DARPublication"@en
    ] ;

    sh:property [
        sh:path polis-ini:hasActivity ;
        sh:class prov:Activity ;
        sh:message "An event activity must be of the class prov:Activity"@en
    ] .

#################################################################
# Vote
#################################################################

_:VoteShape a sh:NodeShape ;
    sh:targetClass ocd:votazione ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:datatype xsd:string ;
        sh:message "A vote must have one and only one identifier and the identifier must be xsd:string"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:result ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "A vote must have at most one result and the reslt must be xsd:string"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:unanimous ;
        sh:datatype xsd:boolean ;
        sh:maxCount 1 ;
        sh:message "A vote must have at most one unanimous boolean"@en
    ] ;

    sh:property [
        sh:path dct:description ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "A vote must have at most one description and it must be xsd:string"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:reunionNumber ;
        sh:datatype xsd:int ;
        sh:maxCount 1 ;
        sh:message "A vote must have at most one reunion number and it must be xsd:int"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:reunionType ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "A vote must have at most one reunion type and it must be xsd:string"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:hasVoteAgainstFrom ;
        sh:or (
            [sh:class m4s:Parliamentarian]
            [sh:class polis-core:ParliamentaryGroup]
        ) ;
        sh:message "A vote can only have votes against from m4s:Parliamentarian or polis-core:ParliamentaryGroup"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:hasVoteInFavourFrom ;
        sh:or (
            [sh:class m4s:Parliamentarian]
            [sh:class polis-core:ParliamentaryGroup]
        ) ;
        sh:message "A vote can only have votes in favour from m4s:Parliamentarian or polis-core:ParliamentaryGroup"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:hasAbstentionFrom ;
        sh:or (
            [sh:class m4s:Parliamentarian]
            [sh:class polis-core:ParliamentaryGroup]
        ) ;
        sh:message "A vote can only have abstentions from m4s:Parliamentarian or polis-core:ParliamentaryGroup"@en
    ] ;

    sh:property [
        sh:path polis-ini:hasAbsentee ;
        sh:class m4s:Parliamentarian ;
        sh:message "A vote may only have absentees from the class m4s:Parliamentarian"@en
    ] ;

    sh:property [
        sh:path polis-ini:isPublishedInDAR ;
        sh:class polis-ini:DARPublication ;
        sh:maxCount 1 ;
        sh:message "A vote must have at most one publication in the DAR must be of the class polis-ini:DARPublication"@en
    ] .

#################################################################
# Activity
#################################################################

_:ActivityShape a sh:NodeShape ;
    sh:targetClass prov:Activity ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:datatype xsd:string ;
        sh:message "An activity must have one and only one identifier and the identifier must be xsd:string"@en
    ] .

#################################################################
# Discussion
#################################################################

_:DiscussionShape a sh:NodeShape ;
    sh:targetClass ocd:discussione ;

    sh:property [
        sh:path dct:date ;
        sh:datatype xsd:date ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A discussione must have one and only one date and it must be of the type xsd:date"@en
    ] ;

    sh:property [
        sh:path dct:abstract ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "A discussione must have at most one abstract and it must be of the type xsd:string"@en
    ] ;
    
    sh:property [
        sh:path ocd:rif_intervento ;
        sh:class ocd:intervento ;
        sh:message "A discussione's intervention must be of the class ocd:intervento"@en
    ] .

#################################################################
# Intervention
#################################################################

_:InterventionShape a sh:NodeShape ;
    sh:targetClass ocd:intervento ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:datatype xsd:string ;
        sh:message "An intervento must have one and only one identifier and the identifier must be xsd:string"@en
    ] ;
    
    sh:property [
        sh:path schema:url ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "An intervento must have one and only one url and the type must be xsd:string"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:isPublishedInDAR ;
        sh:class polis-ini:DARPublication ;
        sh:maxCount 1 ;
        sh:message "An intervento must have at most one publication in the DAR must be of the class polis-ini:DARPublication"@en
    ] ;

    sh:property [
        sh:path polis-ini:hasSpeaker ;
        sh:class foaf:Person ;
        sh:maxCount 1 ;
        sh:message "An intervention must have at most one speaker and the speaker must be of the class foaf:Person"
    ] .

#################################################################
# Commission Event
#################################################################

_:CommissionEventShape a sh:NodeShape ;
    sh:targetClass polis-ini:CommissionEvent ;

    sh:property [
        sh:path polis-ini:observation ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "A commission event must have at most one observation and it must be of the type xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-ini:competent ;
        sh:datatype xsd:boolean ;
        sh:maxCount 1 ;
        sh:message "A commission event must have at most one competent boolean"@en
    ] ;

    sh:property [
        sh:path polis-ini:entryDate ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:message "A commission event must have at most one entry date and it must be of the type xsd:date"@en
    ] ;

    sh:property [
        sh:path polis-ini:distributionDate ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:message "A commission event must have at most one distribution date and it must be of the type xsd:date"@en
    ] ;

    sh:property [
        sh:path polis-ini:extended ;
        sh:datatype xsd:boolean ;
        sh:maxCount 1 ;
        sh:message "A commission event must have at most one extended boolean"@en
    ] ;

    sh:property [
        sh:path polis-ini:scheduledDiscussionDate ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:message "A commission event must have at most one scheduled discussion date and it must be of the type xsd:date"@en
    ] ;

    sh:property [
        sh:path polis-ini:requestSchedulePlenaryDate ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:message "A commission event must have at most one request schedule plenary date and it must be of the type xsd:date"@en
    ] ;

    sh:property [
        sh:path polis-ini:awaitsPlenarySchedule ;
        sh:datatype xsd:boolean ;
        sh:maxCount 1 ;
        sh:message "A commission event must have at most one awaits plenary schedule boolean"@en
    ] ;

    sh:property [
        sh:path polis-ini:publicAppreciationDate ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:message "A commission event must have at most one public appreciation date and it must be of the type xsd:date"@en
    ] ;

    sh:property [
        sh:path polis-ini:opinionRequested ;
        sh:datatype xsd:boolean ;
        sh:maxCount 1 ;
        sh:message "A commission event must have at most one opinion requested boolean"@en
    ] ;

    sh:property [
        sh:path polis-ini:opinionReceived ;
        sh:datatype xsd:boolean ;
        sh:maxCount 1 ;
        sh:message "A commission event must have at most one opinion received boolean"@en
    ] ;

    sh:property [
        sh:path polis-ini:subCommissionDistributionDate ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:message "A commission event must have at most one sub commission distribution date and it must be of the type xsd:date"@en
    ] ;

    sh:property [
        sh:path polis-ini:negativeOpinionReason ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:message "A commission event must have at most one negative opinion reason and it must be of the type xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-ini:negativeOpinionReasonDate ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:message "A commission event must have at most one negative opinion reason date and it must be of the type xsd:date"@en
    ] ;

    sh:property [
        sh:path polis-ini:attributedToCommission ;
        sh:class polis-core:Commission ;
        sh:minCount 1 ;
        sh:message "A commission event must have at least one attributed commission and it must be of the class polis-core:Commission"@en
    ] ;

    sh:property [
        sh:path polis-ini:hasAudition ;
        sh:class polis-mpact:Audition ;
        sh:maxCount 1 ;
        sh:message "A commission event must have at most one audition and it must be of the class polis-mpact:Audition"@en
    ] ;

    sh:property [
        sh:path polis-ini:hasHearing ;
        sh:class polis-mpact:Hearing ;
        sh:maxCount 1 ;
        sh:message "A commission event must have at most one hearing and it must be of the class polis-mpact:Hearing"@en
    ] ;

    sh:property [
        sh:path polis-ini:isPublishedInDAR ;
        sh:class polis-ini:DARPublication ;
        sh:message "A commission event publication in the DAR must be of the class polis-ini:DARPublication"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:hasVote ;
        sh:class ocd:votazione ;
        sh:message "A commission event vote must be of the class ocd:votazione"@en
    ] ;

    sh:property [
        sh:path polis-ini:hasTransmission ;
        sh:class polis-ini:Transmission ;
        sh:message "A commission event transmission must be of the class polis-ini:Transmission"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:hasRapporteur ;
        sh:class m4s:Parliamentarian ;
        sh:message "A commission event rapporteur must be of the class m4s:Parliamentarian"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:hasPublishedReport ;
        sh:class polis-ini:DARPublication ;
        sh:message "A commission event published report must be of the class polis-ini:DARPublication"@en
    ] ;

    sh:property [
        sh:path polis-ini:createsDocument ;
        sh:class bibo:Document ;
        sh:message "A commission event created documents must be of the class bibo:Documents"@en
    ] ;
    
    sh:property [
        sh:path polis-ini:hasSubComission ;
        sh:class polis-core:Commission ;
        sh:message "A commission event's subcommissions must be of the class polis-core:Commission"@en
    ] .

#################################################################
# Transmission
#################################################################

_:TransmissionShape a sh:NodeShape ;
    sh:targetClass polis-ini:Transmission ;

    sh:property [
        sh:path polis-ini:transmissionType ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A transmission must have one and only one transmission type of the type xsd:string"@en
    ] ;
    
    sh:property [
        sh:path dct:date ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:message "A transmission must at most one date and it must be of the type xsd:date"@en
    ] ;
    
    sh:property [
        sh:path dct:created ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:message "A transmission must have at most one creation date and it must be of the type xsd:date"@en
    ] .

# ------------------ BIO ------------------

#################################################################
# Award
#################################################################

_:AwardShape a sh:NodeShape ;
    sh:targetClass dbo:Award ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "An Award must have exactly one identifier and the identifier must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path foaf:name ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "An Award must have exactly one name and the name must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path dbo:number ;
        sh:datatype xsd:nonNegativeInteger ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "An Award must have exactly one number and the number must be a xsd:nonNegativeInteger"@en
    ] .

#################################################################
# Published Work
#################################################################

_:PublishedWorkShape a sh:NodeShape ;
    sh:targetClass polis-bio:PublishedWork ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Published Work must have exactly one identifier and the identifier must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path foaf:name ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Published Work must have exactly one title and the title must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path dbo:number ;
        sh:datatype xsd:nonNegativeInteger ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Published Work must have exactly one number and the number must be a xsd:nonNegativeInteger"@en
    ] .

#################################################################
# Habilitation
#################################################################

_:HabilitationShape a sh:NodeShape ;
    sh:targetClass polis-bio:Habilitation ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Habilitation must have exactly one identifier and the identifier must be a xsd:string"@en
    ] ;

        sh:property [
        sh:path foaf:name ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Habilitation must have exactly one name and the name must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-bio:isHabilitationLevel ;
        sh:or (
            [ sh:class polis-bio:PrimarySchool ]
            [ sh:class polis-bio:MiddleSchool ]
            [ sh:class polis-bio:EarlyHighSchool ]
            [ sh:class polis-bio:HighSchool ]
            [ sh:class polis-bio:HigherEducation ]
            [ sh:class polis-bio:Bachelor ]
            [ sh:class polis-bio:Master ]
            [ sh:class polis-bio:Postgrad ]
        ) ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Habilitation must have exactly one level and the level must be a subclass of polis-bio:HabilitationLevel"@en
    ] ;

    sh:property [
        sh:path polis-bio:isHabilitationStatus ;
        sh:or (
            [ sh:class polis-bio:C ]
            [ sh:class polis-bio:F ]
        ) ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Habilitation must have exactly one status and the status must be a polis-bio:HabilitationStatus"@en
    ] .

_:HabilitationLevelShape a sh:NodeShape ;
    sh:targetClass polis-bio:HabilitationLevel ;

    sh:property [
        sh:path dbo:number ;
        sh:datatype xsd:nonNegativeInteger ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Habilitation Level must have exactly one number and the number must be a xsd:nonNegativeInteger"@en
    ] .

#################################################################
# Role
#################################################################

_:RoleShape a sh:NodeShape ;
    sh:targetClass polis-bio:Role ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Role must have exactly one identifier and the identifier must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path foaf:name ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Role must have exactly one name and the name must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path dbo:number ;
        sh:datatype xsd:nonNegativeInteger ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Role must have exactly one number and the number must be a xsd:nonNegativeInteger"@en
    ] ;

    sh:property [
        sh:path polis-bio:doneBefore ;
        sh:datatype xsd:boolean ;
        sh:minCount 0 ;
        sh:maxCount 1 ;
        sh:message "A Role must have a maximum of one doneBefore and the doneBefore must be a xsd:boolean"@en
    ] .

#################################################################
# Title
#################################################################

_:TitleShape a sh:NodeShape ;
    sh:targetClass polis-bio:Title ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Title must have exactly one identifier and the identifier must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path foaf:name ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Title must have exactly one name and the name must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path dbo:number ;
        sh:datatype xsd:nonNegativeInteger ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Title must have exactly one number and the number must be a xsd:nonNegativeInteger"@en
    ] .

# ------------------ MPACT ------------------

#################################################################
# Requisition
#################################################################

_:RequisitionShape a sh:NodeShape ;
    sh:targetClass ocd:richiestaParere ;
    sh:targetClass polis-mpact:Request ;
    sh:targetClass polis-mpact:Inquiry ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Requisition must have exactly one identifier and the identifier must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path dbo:number ;
        sh:datatype xsd:nonNegativeInteger ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Requisition must have exactly one number and the number must be a xsd:nonNegativeInteger"@en
    ] ;

    sh:property [
        sh:path dct:subject ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Requisition must have exactly one subject and the subject must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path dct:date ;
        sh:datatype xsd:date ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Requisition must have exactly one date and the date must be a xsd:date"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislature ;
        sh:class ocd:legislatura ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Requisition must have exactly one belongsToLegislature and the legislature must be a ocd:legislatura"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislativeSession ;
        sh:class ocd:sessioneLegislatura ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Requisition must have exactly one belongsToLegislativeSession and the legislative session must be a ocd:sessioneLegislatura"@en
    ] ;

    sh:property [
        sh:path polis-mpact:toPublicEntityType ;
        sh:in (
            polis-mpact:AC 
            polis-mpact:AL 
            polis-mpact:AR 
            polis-mpact:EI 
            polis-mpact:RA  
        ) ;
        sh:minCount 0 ;
        sh:maxCount 1 ;
        sh:message "A Requisition must have at most one toPublicEntityType and the public entity type must be a mpact:PublicEntityType"@en
    ] .

#################################################################
# Parliamentary Activity
#################################################################

_:ParliamentaryActivityShape a sh:NodeShape ;
    sh:targetClass polis-mpact:ParliamentaryActivity ;
    sh:targetClass polis-mpact:AGP ;
    sh:targetClass polis-mpact:CER ;
    sh:targetClass polis-mpact:DEB ;
    sh:targetClass polis-mpact:DES ;
    sh:targetClass polis-mpact:DPO ;
    sh:targetClass polis-mpact:DPR ;
    sh:targetClass polis-mpact:EGP ;
    sh:targetClass polis-mpact:EVN ;
    sh:targetClass polis-mpact:GOD ; 
    sh:targetClass polis-mpact:IMU ;
    sh:targetClass polis-mpact:INI ;
    sh:targetClass polis-mpact:ITG ;
    sh:targetClass polis-mpact:MOC ;
    sh:targetClass polis-mpact:OEX ;
    sh:targetClass polis-mpact:PEC ;
    sh:targetClass polis-mpact:PEG ;
    sh:targetClass polis-mpact:PET ;
    sh:targetClass polis-mpact:PII ;
    sh:targetClass polis-mpact:POR ;
    sh:targetClass polis-mpact:PRC ;
    sh:targetClass polis-mpact:PRG ;
    sh:targetClass polis-mpact:PUE ;
    sh:targetClass polis-mpact:REP ;
    sh:targetClass polis-mpact:RSI ;
    sh:targetClass polis-mpact:SES ;
    sh:targetClass polis-mpact:VOT ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Parliamentary Activity must have exactly one identifier and the identifier must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path dbo:number ;
        sh:datatype xsd:nonNegativeInteger ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Parliamentary Activity must have exactly one number and the number must be a xsd:nonNegativeInteger"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislature ;
        sh:class ocd:legislatura ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Parliamentary Activity must have exactly one belongsToLegislature and the legislature must be a ocd:legislatura"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislativeSession ;
        sh:class ocd:sessioneLegislatura ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Parliamentary Activity must have exactly one belongsToLegislativeSession and the legislative session must be a ocd:sessioneLegislatura"@en
    ] ;

    sh:property [
        sh:path dct:date ;
        sh:datatype xsd:date ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Parliamentary Activity must have exactly one date and the date must be a xsd:date"@en
    ] ;

    sh:property [
        sh:path polis-mpact:debateDate ;
        sh:datatype xsd:date ;
        sh:minCount 0 ;
        sh:maxCount 1 ;
        sh:message "A Parliamentary Activity must have at most one debate date and the date must be a xsd:date"@en
    ] ;

    sh:property [
        sh:path dct:subject ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Parliamentary Activity must have exactly one subject and the subject must be a xsd:string"@en
    ] .

#################################################################
# Friendship Parliamentary Group
#################################################################

_:FriendshipParliamentaryGroupShape a sh:NodeShape ;
    sh:targetClass polis-mpact:FriendshipParliamentaryGroup ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Friendship Parliamentary Group must have exactly one identifier and the identifier must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path foaf:name ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Friendship Parliamentary Group must have exactly one name and the name must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislature ;
        sh:class ocd:legislatura ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Friendship Parliamentary Group must have exactly one belongsToLegislature and the legislature must be a ocd:legislatura"@en
    ] .

#################################################################
# Public Accounts
#################################################################

_:PublicAccountsShape a sh:NodeShape ;
    sh:targetClass polis-mpact:PublicAccounts ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Public Accounts must have exactly one identifier and the identifier must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-mpact:civilYear ;
        sh:datatype xsd:gYear ;
        sh:minCount 0 ;
        sh:maxCount 1 ;
        sh:message "A Public Accounts must have exactly one civil year and the civil year must be a xsd:gYear"@en
    ] ; 

    sh:property [
        sh:path dct:date ;
        sh:datatype xsd:date ;
        sh:minCount 0 ;
        sh:maxCount 1 ;
        sh:message "A Public Accounts must have exactly one date and the date must be a xsd:date"@en
    ] ;

    sh:property [
        sh:path dct:subject ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Public Accounts must have exactly one subject and the subject must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislature ;
        sh:class ocd:legislatura ;
        sh:minCount 0 ;
        sh:maxCount 1 ;
        sh:message "A Public Accounts must have exactly one belongsToLegislature and the legislature must be a ocd:legislatura"@en
    ] .

#################################################################
# Delegation
#################################################################

_:DelegationShape a sh:NodeShape ;
    sh:targetClass polis-mpact:Delegation ;
    sh:targetClass polis-mpact:PermanentDelegation ;
    sh:targetClass polis-mpact:TemporaryDelegation ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Delegation must have exactly one identifier and the identifier must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path foaf:name ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Delegation must have exactly one name and the name must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislature ;
        sh:class ocd:legislatura ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Delegation must have exactly one belongsToLegislature and the legislature must be a ocd:legislatura"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislativeSession ;
        sh:class ocd:sessioneLegislatura ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Delegation must have exactly one belongsToLegislativeSession and the legislative session must be a ocd:sessioneLegislatura"@en
    ] .

_:PermanentDelegationShape a sh:NodeShape ;
    sh:targetClass polis-mpact:PermanentDelegation ;

    sh:property [
        sh:path polis-mpact:hasPermanentDelegationMeeting ;
        sh:class polis-mpact:PermanentDelegationMeeting ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Permanent Delegation must have exactly one permanent delegation meeting and the meeting must be a polis-mpact:PermanentDelegationMeeting"@en
    ] .

_:TemporaryDelegationShape a sh:NodeShape ;
    sh:targetClass polis-mpact:TemporaryDelegation ;

    sh:property [
        sh:path dct:date ;
        sh:datatype xsd:date ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Temporary Delegation must have exactly one date and the date must be a xsd:date"@en
    ] ;

    sh:property [
        sh:path sem:hasPlace ;
        sh:class sem:Place ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Temporary Delegation must have exactly one place and the place must be a sem:Place"@en
    ] ;

    sh:property [
        sh:path polis-mpact:hasDelegationScope ;
        sh:in (
            polis-mpact:NationalDelegation
            polis-mpact:InternationalDelegation 
        ) ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Temporary Delegation must have exactly one delegation scope and the delegation scope must be a polis-mpact:DelegationScope"@en
    ] .

_:PermanentDelegationMeetingShape a sh:NodeShape ;
    sh:targetClass polis-mpact:PermanentDelegationMeeting ;

    sh:property [
        sh:path foaf:name ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Permanent Delegation Meeting must have exactly one name and the name must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path dct:date ;
        sh:datatype xsd:date ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Permanent Delegation Meeting must have exactly one date and the date must be a xsd:date"@en
    ] ;

    sh:property [
        sh:path sem:hasPlace ;
        sh:class sem:Place ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Permanent Delegation Meeting must have exactly one place and the place must be a sem:Place"@en
    ] .

#################################################################
# Youth Parliament Activity
#################################################################

_:YouthParliamentActivityShape a sh:NodeShape ;
    sh:targetClass polis-mpact:YouthParliamentActivity ;

    sh:property [
        sh:path dct:date ;
        sh:datatype xsd:date ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Youth Parliament Activity must have exactly one date and the date must be a xsd:date"@en
    ] ;

    sh:property [
        sh:path polis-mpact:meetingType ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Youth Parliament Activity must have exactly one meetingType and the type must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-mpact:heldAt ;
        sh:class dbo:School ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Youth Parliament Activity must have exactly one location and the location must be a dbo:School"@en
    ] ;

    sh:property [
        sh:path polis-core:inConstituency ;
        sh:class pe:ConstituencyArea ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Youth Parliament Activity must have exactly one constituency and the constituency must be a pe:ConstituencyArea"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislature ;
        sh:class ocd:legislatura ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Youth Parliament Activity must have exactly one legislature and the legislature must be a ocd:legislatura"@en
    ] .

_:SchoolShape a sh:NodeShape ;
    sh:targetClass dbo:School ;

    sh:property [
        sh:path polis-mpact:isSchoolType ;
        sh:or (
            [ sh:class polis-mpact:Basic]
            [ sh:class polis-mpact:Secondary ]
        ) ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A School must have exactly one school type and the type must be a subclass of polis-mpact:SchoolType"@en
    ] .

#################################################################
# Commission Activity
#################################################################

_:CommissionActivityShape a sh:NodeShape ;
    sh:targetClass polis-mpact:CommissionActivity ;
    sh:targetClass polis-mpact:Audition ;
    sh:targetClass polis-mpact:Event ;
    sh:targetClass polis-mpact:Debate ;
    sh:targetClass polis-mpact:Cerimony ;
    sh:targetClass polis-mpact:Conference ;
    sh:targetClass polis-mpact:Others ;
    sh:targetClass polis-mpact:Visit ;
    sh:targetClass polis-mpact:Hearing ;

    sh:property [
        sh:path polis-core:identifier ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Commission Activity must have exactly one identifier and the identifier must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path dct:subject ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Commission Activity must have exactly one subject and the subject must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path dct:date ;
        sh:datatype xsd:date ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Commission Activity must have exactly one date and the date must be a xsd:date"@en
    ] ;

    sh:property [
        sh:path schema:location ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Commission Activity must have exactly one location and the location must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path polis-core:belongsToLegislature ;
        sh:class ocd:legislatura ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Commission Activity must have exactly one belongsToLegislature and the legislature must be a ocd:legislatura"@en
    ] ;

    sh:property [
        sh:path polis-mpact:relatedCommission ;
        sh:class polis-core:Commission ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Commission Activity must have exactly one related commission and the related commission must be a polis-core:Commission"@en
    ] .

_:AuditionHearingShape a sh:NodeShape ;
    sh:targetClass polis-mpact:Audition ;
    sh:targetClass polis-mpact:Hearing ;

    sh:property [
        sh:path polis-mpact:commissionIdentifier ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Commission must have exactly one name and the name must be a xsd:string"@en
    ] ;

    sh:property [
        sh:path prov:wasAssociatedWith ;
        sh:class polis-mpact:ThirdPartyEntity ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Commission must have exactly one belongsToLegislature and the legislature must be a ocd:legislatura"@en
    ] .

_:ThirdPartyEntityShape a sh:NodeShape ;
    sh:targetClass polis-mpact:ThirdPartyEntity ;

    sh:property [
        sh:path foaf:name ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:message "A Third Party Entity must have exactly one name and the name must be a xsd:string"@en
    ] .