@prefix dash: <http://datashapes.org/dash#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix pper: <https://data.gov.sk/def/ontology/physical-person/>

pper:PhysicalPersonShape
    a sh:NodeShape ;
    sh:targetClass pper:PhysicalPerson ;
    sh:property [
        sh:path pper:alternativeName ;
        sh:datatype xsd:string ;
        sh:minLength 1 ;
        sh:maxLength 255 ;
    ] ;
    sh:property [
        sh:path pper:dateOfBirth ;
        sh:or ( [ sh:datatype xsd:dateTime ] [ sh:datatype xsd:date ] ) ;
		sh:lessThan pper:dateOfDeath ;
    ] ;
	sh:property [
        sh:path pper:dateOfDeath ;
        sh:or ( [ sh:datatype xsd:dateTime ] [ sh:datatype xsd:date ] ) ;
		sh:lessThan pper:dateOfBirth ;
    ] ;
	sh:property [
        sh:path pper:familyName ;
        sh:datatype xsd:string ;
        sh:minLength 1 ;
        sh:maxLength 255 ;
    ] ;
	sh:property [
        sh:path pper:formattedName ;
        sh:datatype xsd:string ;
        sh:minLength 1 ;
        sh:maxLength 1023 ;
    ] ;
	sh:property [
        sh:path pper:givenName ;
        sh:datatype xsd:string ;
        sh:minLength 1 ;
        sh:maxLength 255 ;
    ] ;
	sh:property [
        sh:path pper:legalName ;
        sh:datatype xsd:string ;
        sh:minLength 1 ;
        sh:maxLength 1023 ;
    ] ;
	sh:property [
        sh:path pper:otherName ;
        sh:datatype xsd:string ;
        sh:minLength 1 ;
        sh:maxLength 255 ;
    ] ;
	sh:property [
        sh:path pper:prefferedGivenName ;
        sh:datatype xsd:string ;
        sh:minLength 1 ;
        sh:maxLength 255 ;
    ] ;
	sh:property [
        sh:path pper:name ;
        sh:datatype xsd:string ;
        sh:minLength 1 ;
        sh:maxLength 255 ;
    ] ;
	sh:property [
        sh:path pper:occupationName ;
        sh:datatype xsd:string ;
        sh:minLength 1 ;
        sh:maxLength 255 ;
    ] .

 
pper:TravelDocumentShape
    a sh:NodeShape ;
    sh:targetClass pper:TravelDocument ;
	sh:property [
        sh:path pper:travelDocumentCode ;
        sh:datatype xsd:string ;
        sh:minLength 1 ;
        sh:maxLength 20 ;
    ] .
 
 
pper:BirthNumberShape
    a sh:NodeShape ;
    sh:targetClass pper:BirthNumber ;
	sh:property [
        sh:path pper:birthNumberCode ;
        sh:datatype xsd:string ;
        sh:minLength 1 ;
        sh:maxLength 11 ;
		sh:pattern "[0-9]{6}/[0-9]{4}"
    ] .
 
pper:IDCardShape
    a sh:NodeShape ;
    sh:targetClass pper:IDCard ;
	sh:property [
        sh:path pper:idCardCode ;
        sh:datatype xsd:string ;
        sh:minLength 1 ;
        sh:maxLength 20 ;
    ] .


pper:BirthShape
    a sh:NodeShape ;
    sh:targetClass pper:Birth ;
	sh:property [
        sh:path pper:givenFamilyName ;
        sh:datatype xsd:string ;
        sh:minLength 1 ;
        sh:maxLength 255 ;
    ] ;
    sh:property [
        sh:path pper:yearOfBirth ;
        sh:datatype xsd:gYear ;
        sh:minInclusive 1850 ;
        sh:maxInclusive 2100 ;
    ] ;
	sh:property [
        sh:path pper:yearOfDeath ;
        sh:datatype xsd:gYear ;
        sh:minInclusive 1850 ;
        sh:maxInclusive 2100 ;
		sh:lessThan pper:yearOfBirth ;
    ] ;
	sh:property [
        sh:path pper:yearMonthOfBirth ;
        sh:datatype xsd:gYearMonth ;
        sh:minInclusive 1 ;
        sh:maxInclusive 12 ;
    ] ;
	sh:property [
        sh:path pper:yearMonthOfDeath ;
        sh:datatype xsd:gYearMonth ;
        sh:minInclusive 1 ;
        sh:maxInclusive 12 ;
		sh:lessThan pper:yearMonthOfBirth ;
    ] .