# 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://joinedcontext.com/models/SummaryGroup>
  a sh:PropertyGroup ;
  sh:order 0 ;
  rdfs:label "Základné"@sk, "Summary"@en .

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

<https://joinedcontext.com/models/KeyPerformanceIndicatorShape>
  a sh:NodeShape ;
  sh:targetClass <https://joinedcontext.com/models/KeyPerformanceIndicator> ;
  sh:closed false ;
  sh:property [
    sh:path <https://joinedcontext.com/models/name> ;
    sh:name "name", "Název"@cs, "Name"@en, "Nimi"@fi, "Názov"@sk ;
    sh:order 0 ;
    sh:group <https://joinedcontext.com/models/SummaryGroup> ;
    sh:datatype xsd:string ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    rdfs:comment "The indicator's own name, equal to the `{localId}` of its id, so the territory is legible without parsing the URN."
  ] ;
  sh:property [
    sh:path <https://joinedcontext.com/models/currentValue> ;
    sh:name "currentValue", "Hodnota"@cs, "Value"@en, "Arvo"@fi, "Hodnota"@sk ;
    sh:order 1 ;
    sh:group <https://joinedcontext.com/models/SummaryGroup> ;
    sh:datatype xsd:anyURI ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    rdfs:comment "The number, with its unit on the Property as `unitCode`, a UN/CEFACT common code, and the instant it describes as `observedAt`. A window with no reading in it carries the string `not measured` instead of a number, and never a zero: a zero reads as a measurement (Development/10 §5)."
  ] ;
  sh:property [
    sh:path <https://joinedcontext.com/models/calculationPeriod> ;
    sh:name "calculationPeriod", "Období"@cs, "Period"@en, "Jakso"@fi, "Obdobie"@sk ;
    sh:order 2 ;
    sh:group <https://joinedcontext.com/models/SummaryGroup> ;
    sh:datatype xsd:anyURI ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    rdfs:comment "The window the value actually covers, as `{ start, end }` RFC 3339 instants. It is the window the pipeline used and not the one it was asked for, so the distance between `calculationPeriod.end` and `updatedAt` is how stale the source is."
  ] ;
  sh:property [
    sh:path <https://joinedcontext.com/models/updatedAt> ;
    sh:name "updatedAt", "Aktualizováno"@cs, "Updated"@en, "Päivitetty"@fi, "Aktualizované"@sk ;
    sh:order 3 ;
    sh:group <https://joinedcontext.com/models/SummaryGroup> ;
    sh:datatype xsd:dateTime ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    rdfs:comment "When the pipeline last ran, as an NGSI-LD DateTime. It is the run and not the window: an indicator whose source stopped moving keeps its window and gains a newer `updatedAt`, which is the visible fact that the source is static."
  ] ;
  sh:property [
    sh:path <https://joinedcontext.com/models/calculationFormula> ;
    sh:name "calculationFormula", "Výpočet"@cs, "Formula"@en, "Laskentakaava"@fi, "Výpočet"@sk ;
    sh:order 4 ;
    sh:group <https://joinedcontext.com/models/DetailGroup> ;
    sh:datatype xsd:string ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    rdfs:comment "How the value was computed, in words a reader can check the number against: the measure, the aggregation, the window and any divisor, such as `per km² of the district's own area`. English plain text: a table leaves it out, so a Slovak answer never shows English prose (T-4727)."
  ] ;
  sh:property [
    sh:path <https://joinedcontext.com/models/derivedFrom> ;
    sh:name "derivedFrom" ;
    sh:order 5 ;
    sh:group <https://joinedcontext.com/models/DetailGroup> ;
    sh:datatype xsd:string ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    rdfs:comment "The Endpoint the sources were read through, as its URN. The endpoint and not the space: what an indicator could see is what that endpoint's policy let it see."
  ] ;
  sh:property [
    sh:path <https://joinedcontext.com/models/computedBy> ;
    sh:name "computedBy" ;
    sh:order 6 ;
    sh:group <https://joinedcontext.com/models/DetailGroup> ;
    sh:datatype xsd:string ;
    sh:minCount 1 ;
    sh:maxCount 1 ;
    rdfs:comment "The Pipeline that computed it, as its URN."
  ] ;
  sh:property [
    sh:path <https://purl.org/geojson/vocab#geometry> ;
    sh:name "location" ;
    sh:order 7 ;
    sh:group <https://joinedcontext.com/models/DetailGroup> ;
    sh:maxCount 1 ;
    rdfs:comment "Where the entity is, as GeoJSON geometry."
  ] .
