BASE <https://w3id.org/itsdata/location/v1/>
PREFIX : <https://w3id.org/itsdata/location/v1/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
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 dcterms: <http://purl.org/dc/terms/>
PREFIX cdm1: <https://w3id.org/citydata/part1/v1/>
PREFIX its-core: <https://w3id.org/itsdata/core/v1/>
PREFIX its-sh: <https://w3id.org/itsdata/shacl/v1/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>

:LocationCoreSHACL
    a owl:Ontology ;
    dcterms:title "SHACL rules for ITS Location Referencing Core"@en ;
    skos:definition "SHACL shapes for core location domain abstractions (locations, representations, and collections)."@en ;
    its-core:draft "true" ;
    dcterms:created "Draft" ;
    dcterms:modified "2026-04-29"^^xsd:date ;
    owl:versionInfo "0.0.1" ;
    owl:versionIRI <LocationCoreSHACL/r0.1> ;
    owl:imports <https://w3id.org/itsdata/shacl/v1/> .

#################################################################
# Node shapes
#################################################################

:FeatureShape
    a sh:NodeShape ;
    sh:targetClass :Feature ;
    sh:property [
        sh:path cdm1:hasName ;
        sh:datatype rdf:langString ;
    ] ;
    sh:property [
        sh:path cdm1:hasDescription ;
        sh:node its-sh:MaxOneMultilingualShape ;
    ] .

:GeometryShape
    a sh:NodeShape ;
    sh:targetClass :Geometry ;
    sh:property [
        sh:path cdm1:hasDescription ;
        sh:node its-sh:MaxOneMultilingualShape ;
    ] .

:LocationShape
    a sh:NodeShape ;
    sh:targetClass :Location ;
    sh:and ( :FeatureShape ) ;
    sh:property [
        sh:path :hasPrimaryRepresentation ;
        sh:node its-sh:ExactlyOneShape ;
        sh:class :Geometry ;
        sh:message "A Location must have exactly one :hasPrimaryRepresentation value." ;
    ] ;
    sh:property [
        sh:path :hasAlternativeRepresentation ;
        sh:node its-sh:UnlimitedShape ;
        sh:class :Geometry ;
    ] .

:LocationGroupShape
    a sh:NodeShape ;
    sh:targetClass :LocationGroup ;
    sh:and ( :FeatureShape ) ;
    sh:property [
        sh:path :hasMember ;
        sh:minCount 2 ;
        sh:class :Location ;
        sh:message "A LocationGroup must contain at least two member Locations." ;
    ] .

:CoordinateGeometryShape
    a sh:NodeShape ;
    sh:targetClass :CoordinateGeometry ;
    sh:and ( :GeometryShape ) ;
    sh:property [
        sh:path :hasCRS ;
        sh:node its-sh:ExactlyOneShape ;
        sh:class :CoordinateReferenceSystem ;
    ] ;
    sh:property [
        sh:path :coordinateEpoch ;
        sh:node its-sh:MaxOneShape ;
        sh:datatype xsd:dateTime ;
    ] .
