@prefix sh: <http://www.w3.org/ns/shacl#> .

@prefix adu: <http://cef.uv.es/lodroadtran18/def/transporte/dtx_srti/administrativeUnit#> .
@prefix adu_cz: <https://lod.tamtamresearch.com/resource/dtx_srti/administrativeUnit/> .

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dce: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .


# SHACL for administrativeUnit representation
#
# The common hierarchy is as follows:
#
# (adu:MěstskýObvod - adu_cz:belongToMunicipality -> )
# adu:Obec - adu_cz:belongToDistrict ->
# adu:Okres - adu_cz:belongToRegion ->
# adu:Kraj - adu_cz:belongToCountryCZ ->
# adu:Stát
#
# The ONLY exception to this is Praha/Prague, which itself
# is an instance of adu:Obec, but does not belong to any district,
# and thus uses directly the adu_cz:belongToRegion predicate instead.
# (<https://lod.tamtamresearch.com/resource/dtx_srti/administrativeUnit/Obec/554782>)
# Note that a different IRI also represents Prague as an instance of adu:Kraj,
# which has the hierarchy going up as all other instances of this class.

<https://lod.tamtamresearch.com/shacl/dtx_srti/administrativeUnit> rdf:type sh:NodeShape, owl:Ontology ;
        owl:imports                    <http://www.opengis.net/ont/geosparql> , <http://www.w3.org/2006/time#2016> , <https://ec.europa.eu/eurostat/ramon/ontologies/geographic.rdf> ;
        dcterms:title                  "SHACL for Gazetteer of Administrative Units in Czechia"@en ;
        dcterms:title                  "SHACL pro geografický index adminstrativních oblastí v Česku"@cs ;
        rdfs:seeAlso                   "http://cef.uv.es/lodroadtran18/" ;
        rdfs:seeAlso                   "https://lod.tamtamresearch.com/" ;
        rdfs:seeAlso                   "https://tamtamresearch.com" ;
        rdfs:seeAlso                   "http://cef.uv.es/lodroadtran18/def/transporte/dtx_srti/administrativeUnit#" ;

        dce:date                       "2022-10-31"@en ;
        dce:source                     "http://cef.uv.es/lodroadtran18/def/transporte/dtx_srti/administrativeUnit#" ;
        dcterms:creator                "TamTam Research s.r.o." ;
        dcterms:contributor            "TamTam Research s.r.o." ;
        dcterms:contributor            "Eliška Vlčinská <eliska.vlcinska@tamtamresearch.com>" ;
        dcterms:abstract               "SHACL file defines constraints (mostly which information shall be present) on a RDF data describing items in gazetteer of Czech adminstrative Units. RDF is using ontology LOD SRTI DATEX II ADU which allows to describe adminstrative units in Czechia and Spain. Items describe ALERT-C location code, name, NUTS and RUIAN code, and links to sws.geonames.org, vdp.cuzk.cz and data.europa.eu/nuts/code"@en ;
        dcterms:abstract               "SHACL soubor definuje omezení (většinou informace, které mají být přítomny) na RDF data, popisující položky v geografickém indexu adminstrativních jednotek Česka. RDF staví na ontologii LOD SRTI DATEX II ADU, která umožňuje popsat adminstrativní jednotky na území Česka a Španělska. Položky popisují ALERT-C kód lokace, název, NUTS a RUIAN kód a odkaz do sws.geonames.org, vdp.cuzk.cz and data.europa.eu/nuts/code"@cs ;
        dcterms:spatial                <http://publications.europa.eu/resource/authority/country/CZE> ;
        dcterms:license                "https://creativecommons.org/licenses/by/4.0/" ;
        dcterms:publisher              "TamTam Research s.r.o." ;
        owl:versionInfo                "1.0"@en .

adu_cz:CommonADUShape a sh:NodeShape ;
  sh:property [
    sh:path rdfs:label ;
    sh:datatype xsd:string;
    sh:minCount 1 ;
    sh:maxCount 1 ;
  ] ;
  sh:property [
    sh:path rdf:type ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
  ] ;
  sh:property [
    sh:path adu:name;
    sh:datatype xsd:string;
    sh:maxCount 1 ;
  ] ;
  sh:property [
    sh:path dcterms:title;
    sh:datatype xsd:string;
    sh:maxCount 1 ;
  ] ;
  sh:property [
    sh:path adu:regionCode;
    sh:datatype xsd:string;
    sh:maxCount 1 ;
  ] ;
  sh:property [
    sh:path adu:level;
    sh:datatype xsd:decimal;
    sh:maxCount 1 ;
  ] ;
  sh:property [
    sh:path adu:alertcCode;
    sh:datatype xsd:string;
    sh:maxCount 1 ;
  ] ;
  sh:property [
    sh:path adu:ruianCode;
    sh:datatype xsd:string;
    sh:maxCount 1 ;
  ] ;
  sh:property [
    sh:path owl:sameAs;
    sh:nodeKind sh:IRI;
  ] .

# adu_cz:KatastrálníÚzemíShape a sh:NodeShape.
# KatastrálníÚzemí is not present in the dataset,
# thus no shape has been made for it.

adu_cz:KrajShape a sh:NodeShape;
  sh:targetClass adu:Kraj;
  sh:property [
    sh:path adu_cz:belongToCountryCZ;
    sh:nodeKind sh:IRI;
    sh:class adu:Stát;
    sh:minCount 1 ;
    sh:maxCount 1 ;
  ] ;
  sh:property [
    sh:path adu:level;
    sh:hasValue 3.0;
    sh:minCount 1;
    sh:maxCount 1;
  ] ;
  sh:node adu_cz:CommonADUShape.

adu_cz:MěstskýObvodShape a sh:NodeShape;
  sh:targetClass adu:MěstskýObvod;
  sh:property [
    sh:path adu_cz:belongToMunicipality;
    sh:nodeKind sh:IRI;
    sh:class adu:Obec;
    sh:minCount 1 ;
    sh:maxCount 1 ;
  ] ;
  sh:node adu_cz:CommonADUShape.

adu_cz:ObecShape a sh:NodeShape;
  sh:targetClass adu:Obec;
  sh:or (adu_cz:RegularObecShape adu_cz:PrahaObecShape);
  sh:property [
    sh:path adu:level;
    sh:hasValue 5.0 ;
    sh:minCount 1 ;
    sh:macCount 1 ;
  ];
  sh:node adu_cz:CommonADUShape.

adu_cz:RegularObecShape a sh:NodeShape;
  sh:property [
    sh:path adu_cz:belongToDistrict;
    sh:nodeKind sh:IRI;
    sh:class adu:Okres;
    sh:minCount 1 ;
    sh:maxCount 1 ;
  ] .
adu_cz:PrahaObecShape a sh:NodeShape;
  sh:targetNode <https://lod.tamtamresearch.com/resource/dtx_srti/administrativeUnit/Obec/554782>;
  sh:property [
    sh:path adu_cz:belongToRegion;
    sh:nodeKind sh:IRI;
    sh:class adu:Kraj;
    sh:minCount 1 ;
    sh:maxCount 1 ;
  ] .

adu_cz:OkresShape a sh:NodeShape;
  sh:targetClass adu:Okres;
  sh:property [
    sh:path adu_cz:belongToRegion;
    sh:nodeKind sh:IRI;
    sh:class adu:Kraj;
    sh:minCount 1 ;
    sh:maxCount 1 ;
  ] ;
  sh:property [
    sh:path adu:level;
    sh:hasValue 4.0 ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
  ];
  sh:node adu_cz:CommonADUShape.

adu_cz:StátShape a sh:NodeShape;
  sh:targetClass adu:Stát;
  sh:property [
    sh:path adu:level;
    sh:hasValue 0.0 ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
  ];
  sh:node adu_cz:CommonADUShape.
