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 skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX vann: <http://purl.org/vocab/vann/>

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

#################################################################
# 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-core:MaxOneMultilingualShape ;
    ] .

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

:CodedGeometryShape
    a sh:NodeShape ;
    sh:targetClass :CodedGeometry ;
    sh:and ( :GeometryShape ) ;
    sh:property [
        sh:path :hasLookupCode ;
        sh:node its-core:ExactlyOneShape ;
        sh:class :LocationCode ;
        sh:message "CodedGeometry must have exactly one :hasLookupCode pointing to a LocationCode." ;
    ] .

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

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