# 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/TrafficFlowObservedShape>
  a sh:NodeShape ;
  sh:targetClass <https://uri.etsi.org/ngsi-ld/default-context/TrafficFlowObserved> ;
  sh:closed false ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/name> ;
    sh:name "name", "Název"@cs, "Name"@de, "Name"@en, "Názov"@sk ;
    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 (a station, an event, a facility, a street section and its stretch, a street address, a district or barri, a work)."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/dateObserved> ;
    sh:name "dateObserved", "Čas měření"@cs, "Messzeitpunkt"@de, "Observed at"@en, "Čas merania"@sk ;
    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, a traffic state's report, a charging point's newest port change."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/congested> ;
    sh:name "congested", "Zácpa"@cs, "Stau"@de, "Congested"@en, "Zápcha"@sk ;
    sh:order 2 ;
    sh:group <https://smartdatamodels.org/SummaryGroup> ;
    sh:datatype xsd:boolean ;
    sh:maxCount 1 ;
    rdfs:comment "Whether the section is congested now: true for the city's states 4 (very dense) and 5 (congestion), false otherwise, as SDM reads an absent flag (no data and closed included; trafficState tells those apart)."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/trafficState> ;
    sh:name "trafficState", "Stav dopravy"@cs, "Verkehrslage"@de, "Traffic state"@en, "Stav dopravy"@sk ;
    sh:order 3 ;
    sh:group <https://smartdatamodels.org/SummaryGroup> ;
    sh:in ( "closed" "congestion" "dense" "fluid" "noData" "veryDense" "veryFluid" ) ;
    sh:maxCount 1 ;
    rdfs:comment "The city's own traffic state of the section (custom: TrafficFlowObserved has only `congested`), its code 1 to 6 named in English; Open Data BCN dataset trams."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/trafficStateForecast> ;
    sh:name "trafficStateForecast", "Předpověď stavu dopravy"@cs, "Verkehrslageprognose"@de, "Traffic state forecast"@en, "Predpoveď stavu dopravy"@sk ;
    sh:order 4 ;
    sh:group <https://smartdatamodels.org/DetailGroup> ;
    sh:in ( "closed" "congestion" "dense" "fluid" "noData" "veryDense" "veryFluid" ) ;
    sh:maxCount 1 ;
    rdfs:comment "The state the city forecasts for the section in 15 minutes, same codes as trafficState (custom)."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/travelTime> ;
    sh:name "travelTime", "Doba jízdy (s)"@cs, "Fahrzeit (s)"@de, "Travel time (s)"@en, "Čas jazdy (s)"@sk ;
    sh:order 5 ;
    sh:group <https://smartdatamodels.org/DetailGroup> ;
    sh:datatype xsd:integer ;
    sh:maxCount 1 ;
    rdfs:comment "How long a vehicle takes now to drive the route, in seconds (custom: TrafficFlowObserved has no travel time); Open Data BCN dataset itineraris, its fourth field. Absent while the city reports no reading for the route."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/usualTravelTime> ;
    sh:name "usualTravelTime", "Obvyklá doba jízdy (s)"@cs, "Übliche Fahrzeit (s)"@de, "Usual travel time (s)"@en, "Bežný čas jazdy (s)"@sk ;
    sh:order 6 ;
    sh:group <https://smartdatamodels.org/DetailGroup> ;
    sh:datatype xsd:integer ;
    sh:maxCount 1 ;
    rdfs:comment "The time the city expects for the route now from its history of the same kind of day, in seconds (custom; itineraris, its fifth field, temps previst). travelTime above it means slower traffic than usual."
  ] ;
  sh:property [
    sh:path <https://uri.etsi.org/ngsi-ld/default-context/source> ;
    sh:name "source", "Zdroj"@cs, "Quelle"@de, "Source"@en, "Zdroj"@sk ;
    sh:order 7 ;
    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 8 ;
    sh:group <https://smartdatamodels.org/DetailGroup> ;
    sh:maxCount 1 ;
    rdfs:comment "Where the entity is, as GeoJSON geometry."
  ] .
