@prefix sh:            <http://www.w3.org/ns/shacl#> .
@prefix xsd:           <http://www.w3.org/2001/XMLSchema#> .
@prefix sh_sec:        <https://secorolab.github.io/metamodels/website/> .
@prefix research-area: <https://secorolab.github.io/metamodels/website/research-area#> .

sh_sec:ResearchAreaShape
    a sh:NodeShape ;
    sh:targetClass research-area:ResearchArea ;
    sh:closed false ;

    sh:property [
        sh:path     research-area:name ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:minLength 3 ;
        sh:severity sh:Violation ;
        sh:message  "Research area must have exactly one name." ;
    ] ;

    sh:property [
        sh:path     research-area:description ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:severity sh:Warning ;
        sh:message  "Research area should have a description." ;
    ] ;

    sh:property [
        sh:path     research-area:term-code ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
        sh:pattern  "^[a-z0-9]+(-[a-z0-9]+)*$" ;
        sh:severity sh:Warning ;
        sh:message  "term-code should be a lowercase hyphenated slug." ;
    ] ;
.
