@prefix : <https://w3id.org/citydata/part2/v1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix cdm1: <https://w3id.org/citydata/part1/v1/> .
@base <https://w3id.org/citydata/part2/v1/> .

<https://w3id.org/citydata/part2/v1/PersonSHACL> rdf:type owl:Ontology ;
                                                  owl:imports :CoreSHACL ,
                                                              :PersonPattern ;
                                                  dcterms:title "City Data Model Part 2 - Person Pattern - SHACL constraints" ;
                                                  vann:preferredNamespacePrefix "cdm2" ;
                                                  vann:preferredNamespaceUri "https://w3id.org/citydata/part2/v1/" ;
                                                  skos:definition "SHACL validation shapes for the Person Pattern pattern module." .

#################################################################
#    Shapes
#################################################################

###  https://w3id.org/citydata/part2/v1/CitizenshipShape
:CitizenshipShape rdf:type sh:NodeShape ;
                  sh:property [ sh:class time:ProperInterval ;
                                sh:node :MaxOneShape ;
                                sh:path :validityPeriod
                              ] ,
                              [ sh:class :Country ;
                                sh:node :MaxOneShape ;
                                sh:path :forCountry
                              ] ;
                  sh:targetClass :Citizenship .


###  https://w3id.org/citydata/part2/v1/EducationShape
:EducationShape rdf:type sh:NodeShape ;
                sh:property [ sh:class :Code ;
                              sh:path :hasCode
                            ] ;
                sh:targetClass :Education .


###  https://w3id.org/citydata/part2/v1/GenderShape
:GenderShape rdf:type sh:NodeShape ;
             sh:property [ sh:class :Code ;
                           sh:path :hasCode
                         ] ;
             sh:targetClass :Gender .


###  https://w3id.org/citydata/part2/v1/IDTypeShape
:IDTypeShape rdf:type sh:NodeShape ;
             sh:property [ sh:class :Code ;
                           sh:path :hasCode
                         ] ;
             sh:targetClass :IDType .


###  https://w3id.org/citydata/part2/v1/NameShape
:NameShape rdf:type sh:NodeShape ;
           sh:property [ sh:datatype xsd:string ;
                         sh:path cdm1:hasName
                       ] ;
           sh:targetClass :Name .


###  https://w3id.org/citydata/part2/v1/PersonIdShape
:PersonIdShape rdf:type sh:NodeShape ;
               sh:property [ sh:class :IDType ;
                             sh:path :hasIDType
                           ] ,
                           [ sh:datatype xsd:boolean ;
                             sh:node :MaxOneShape ;
                             sh:path :photoID
                           ] ,
                           [ sh:class time:Interval ;
                             sh:node :MaxOneShape ;
                             sh:path :validityPeriod
                           ] ,
                           [ sh:datatype xsd:string ;
                             sh:node :ExactlyOneShape ;
                             sh:path cdm1:hasIdentifier
                           ] ,
                           [ sh:class cdm1:Agent ;
                             sh:node :MaxOneShape ;
                             sh:path :issuedBy
                           ] ;
               sh:targetClass :PersonId .


###  https://w3id.org/citydata/part2/v1/PersonNameShape
:PersonNameShape rdf:type sh:NodeShape ;
                 sh:property [ sh:datatype xsd:string ;
                               sh:node :MaxOneShape ;
                               sh:path :familyName
                             ] ,
                             [ sh:datatype xsd:string ;
                               sh:path :additionalName
                             ] ,
                             [ sh:datatype xsd:string ;
                               sh:path :givenName
                             ] ;
                 sh:targetClass :PersonName .


###  https://w3id.org/citydata/part2/v1/PersonShape
:PersonShape rdf:type sh:NodeShape ;
             sh:property [ sh:class time:Instant ;
                           sh:node :MaxOneShape ;
                           sh:path :birthDate
                         ] ,
                         [ sh:class :Person ;
                           sh:path :parent
                         ] ,
                         [ sh:class :Person ;
                           sh:path :children
                         ] ,
                         [ sh:class :PersonName ;
                           sh:node :MaxOneShape ;
                           sh:path :name
                         ] ,
                         [ sh:class cdm1:MonetaryValue ;
                           sh:path :income
                         ] ,
                         [ sh:class :Address ;
                           sh:path :hasAddress
                         ] ,
                         [ sh:class :PersonName ;
                           sh:path :alias
                         ] ,
                         [ sh:class :Skill ;
                           sh:path :hasSkill
                         ] ,
                         [ sh:class :Person ;
                           sh:path :spouse
                         ] ,
                         [ sh:class :EmailAddress ;
                           sh:path :hasEmail
                         ] ,
                         [ sh:class time:Instant ;
                           sh:node :MaxOneShape ;
                           sh:path :deathDate
                         ] ,
                         [ sh:class :Gender ;
                           sh:path :hasGenderIdentity
                         ] ,
                         [ sh:class :Address ;
                           sh:node :MaxOneShape ;
                           sh:path :birthplace
                         ] ,
                         [ sh:class :PhoneNumber ;
                           sh:path :hasTelephone
                         ] ,
                         [ sh:class :Sex ;
                           sh:node :MaxOneShape ;
                           sh:path :sex
                         ] ,
                         [ sh:class :PersonId ;
                           sh:path :hasPersonID
                         ] ,
                         [ sh:class :Education ;
                           sh:path :hasEducation
                         ] ,
                         [ sh:class :Address ;
                           sh:node :MaxOneShape ;
                           sh:path :deathPlace
                         ] ,
                         [ sh:class :Citizenship ;
                           sh:path :citizenOf
                         ] ;
             sh:targetClass :Person .


###  https://w3id.org/citydata/part2/v1/SexShape
:SexShape rdf:type sh:NodeShape ;
          sh:property [ sh:class :Code ;
                        sh:path :hasCode
                      ] ;
          sh:targetClass :Sex .


###  https://w3id.org/citydata/part2/v1/SkillShape
:SkillShape rdf:type sh:NodeShape ;
            sh:property [ sh:class :Code ;
                          sh:path :hasCode
                        ] ;
            sh:targetClass :Skill .
