@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 publication: <https://secorolab.github.io/metamodels/website/publication#> .

sh_sec:PublicationShape
    a sh:NodeShape ;
    sh:targetClass publication:Publication ;
    sh:closed false ;

    sh:property [
        sh:path     publication:name ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:minLength 5 ;
        sh:severity sh:Violation ;
        sh:message  "Publication must have a title." ;
    ] ;

    sh:property [
        sh:path     publication:author ;
        sh:nodeKind sh:BlankNodeOrIRI ;
        sh:minCount 1 ;
        sh:severity sh:Violation ;
        sh:message  "Publication must have at least one author." ;
    ] ;

    sh:property [
        sh:path     publication:date-published ;
        sh:datatype xsd:date ;
        sh:maxCount 1 ;
        sh:severity sh:Warning ;
        sh:message  "date-published should be a valid xsd:date." ;
    ] ;

    sh:property [
        sh:path     publication:url ;
        sh:nodeKind sh:IRI ;
        sh:maxCount 1 ;
    ] ;

    sh:property [
        sh:path     publication:doi ;
        sh:nodeKind sh:IRI ;
        sh:maxCount 1 ;
    ] ;

    sh:property [
        sh:path     publication:bib-id ;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
    ] ;

    sh:property [
        sh:path     publication:website ;
        sh:nodeKind sh:IRI ;
        sh:maxCount 1 ;
    ] ;

    sh:property [
        sh:path     publication:published-in ;
        sh:nodeKind sh:BlankNodeOrIRI ;
        sh:maxCount 1 ;
        sh:severity sh:Warning ;
        sh:message  "Publication should reference where it was published via published-in." ;
    ] ;

    sh:property [
        sh:path     publication:preprint ;
        sh:nodeKind sh:BlankNodeOrIRI ;
        sh:maxCount 1 ;
    ] ;

    sh:property [
        sh:path     publication:related-tools ;
        sh:nodeKind sh:IRI ;
    ] ;

    sh:property [
        sh:path     publication:about ;
        sh:nodeKind sh:IRI ;
    ] ;
.

sh_sec:PublicationVenueShape
    a sh:NodeShape ;
    sh:targetClass publication:PublicationVenue ;
    sh:closed false ;

    sh:property [
        sh:path     publication:name ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:severity sh:Violation ;
        sh:message  "PublicationVenue must have a name." ;
    ] ;

    sh:property [
        sh:path     publication:url ;
        sh:nodeKind sh:IRI ;
        sh:maxCount 1 ;
    ] ;
.

sh_sec:PreprintShape
    a sh:NodeShape ;
    sh:targetClass publication:Preprint ;
    sh:closed false ;

    sh:property [
        sh:path     publication:preprint-where ;
        sh:datatype xsd:string ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:severity sh:Violation ;
        sh:message  "Preprint must name where it is hosted." ;
    ] ;

    sh:property [
        sh:path     publication:url ;
        sh:nodeKind sh:IRI ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:severity sh:Violation ;
        sh:message  "Preprint must have a URL." ;
    ] ;
.

