# SHACL shapes, rendered from the LinkML model.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .

<https://smartdatamodels.org/SummaryGroup>
  a sh:PropertyGroup ;
  sh:order 0 ;
  rdfs:label "Základné"@sk, "Summary"@en .

<https://smartdatamodels.org/DetailGroup>
  a sh:PropertyGroup ;
  sh:order 1 ;
  rdfs:label "Detail"@sk, "Detail"@en .

<https://smartdatamodels.org/AnyShape>
  a sh:NodeShape ;
  sh:targetClass <https://w3id.org/linkml/Any> ;
  sh:closed false .

<https://smartdatamodels.org/PhreaticObservedShape>
  a sh:NodeShape ;
  sh:targetClass <https://uri.etsi.org/ngsi-ld/default-context/PhreaticObserved> ;
  sh:closed false ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/name> ;
    sh:name "name" ;
    sh:order 0 ;
    sh:group <https://smartdatamodels.org/SummaryGroup> ;
    sh:datatype xsd:string ;
    sh:maxCount 1 ;
    rdfs:comment "The name as the city publishes it, in Catalan."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/dateObserved> ;
    sh:name "dateObserved" ;
    sh:order 1 ;
    sh:group <https://smartdatamodels.org/SummaryGroup> ;
    sh:datatype xsd:dateTime ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    rdfs:comment "The end of the period the entity's newest readings cover, UTC: the hour of an air-quality mean, the local day of a weather station's values, the day of a well's reading."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/measurementType> ;
    sh:name "measurementType" ;
    sh:order 2 ;
    sh:group <https://smartdatamodels.org/SummaryGroup> ;
    sh:in ( "depth" "other" "quality" "volume" ) ;
    rdfs:comment "What the well's readings measure; `depth` for each of the city's wells."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/waterTable> ;
    sh:name "waterTable" ;
    sh:order 3 ;
    sh:group <https://smartdatamodels.org/SummaryGroup> ;
    sh:datatype xsd:float ;
    sh:maxCount 1 ;
    rdfs:comment "The depth from the surface to the water in the well at the newest reading."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/piezometricLevel> ;
    sh:name "piezometricLevel" ;
    sh:order 4 ;
    sh:group <https://smartdatamodels.org/DetailGroup> ;
    sh:datatype xsd:float ;
    sh:maxCount 1 ;
    rdfs:comment "The height of the water above sea level at the newest reading (below 0 where the sea draws the aquifer down). A property of this model: PhreaticObserved has only the depth."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/investigationDepth> ;
    sh:name "investigationDepth" ;
    sh:order 5 ;
    sh:group <https://smartdatamodels.org/DetailGroup> ;
    sh:datatype xsd:float ;
    sh:maxCount 1 ;
    rdfs:comment "The depth of the well or piezometer in metres. A fixed property of the well, written without a unit code so its rows are never read as a measurement stamped on receipt."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/aquifer> ;
    sh:name "aquifer" ;
    sh:order 6 ;
    sh:group <https://smartdatamodels.org/DetailGroup> ;
    sh:datatype xsd:string ;
    sh:maxCount 1 ;
    rdfs:comment "The groundwater body (massa d'aigua) the well reaches, as the water agency names it."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/stationCode> ;
    sh:name "stationCode" ;
    sh:order 7 ;
    sh:group <https://smartdatamodels.org/DetailGroup> ;
    sh:datatype xsd:string ;
    sh:maxCount 1 ;
    rdfs:comment "The station's code in the network that runs it: the Catalan air-quality network (XVPCA, the city's codi_eoi, such as `8019043`), the Meteocat weather network (such as `D5`) or the Catalan water agency's well register (ACA, such as `08019-0148`)."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/address> ;
    sh:name "address" ;
    sh:order 8 ;
    sh:group <https://smartdatamodels.org/DetailGroup> ;
    sh:nodeKind sh:IRI ;
    sh:class <https://w3id.org/linkml/Any> ;
    sh:maxCount 1 ;
    rdfs:comment "Where the station, the well, the event or the facility is, as the city publishes it, field by field (Smart Data Models' common PostalAddress); a field the source leaves out is absent."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/areaServed> ;
    sh:name "areaServed" ;
    sh:order 9 ;
    sh:group <https://smartdatamodels.org/DetailGroup> ;
    sh:datatype xsd:string ;
    sh:maxCount 1 ;
    rdfs:comment "The neighbourhood (barri) the station or well is in, as the city names it."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/dataProvider> ;
    sh:name "dataProvider" ;
    sh:order 10 ;
    sh:group <https://smartdatamodels.org/DetailGroup> ;
    sh:datatype xsd:string ;
    sh:maxCount 1 ;
    rdfs:comment "Who publishes the data the entity was read from, with the credit its licence asks for."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/source> ;
    sh:name "source" ;
    sh:order 11 ;
    sh:group <https://smartdatamodels.org/DetailGroup> ;
    sh:datatype xsd:anyURI ;
    sh:maxCount 1 ;
    rdfs:comment "The open-data file or the Open Data BCN dataset the entity was read from."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/location> ;
    sh:name "location" ;
    sh:order 12 ;
    sh:group <https://smartdatamodels.org/DetailGroup> ;
    sh:maxCount 1 ;
    rdfs:comment "Where the entity is, as GeoJSON geometry."
  ] .
