@prefix coswot: <https://w3id.org/coswot/> .
@prefix cc: <http://creativecommons.org/ns#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix time: <http://www.w3.org/2006/time#>.

cc:license a owl:AnnotationProperty .
dct:issued a owl:AnnotationProperty .
dct:title a owl:AnnotationProperty .
dct:description a owl:AnnotationProperty .
dct:modified a owl:AnnotationProperty .
dct:contributor a owl:AnnotationProperty .
vann:preferredNamespacePrefix a owl:AnnotationProperty .
vann:preferredNamespaceUri a owl:AnnotationProperty .
skos:Concept a owl:Class .
skos:example a owl:AnnotationProperty .
skos:note a owl:AnnotationProperty .

coswot:core\/observations a owl:Ontology ;
  cc:license <https://creativecommons.org/licenses/by/4.0/> ;
  dct:description "The CoSWoT Core Sensors module describes sensors and observations."@en ;
  dct:title "CoSWoT Core sensors module"@en ;
  dct:contributor "Maxime Lefrançois", "Catherine Roussey", "Fatma-Zohra Hannou" ;
  vann:preferredNamespacePrefix "coswot" ;
  vann:preferredNamespaceUri "https://w3id.org/coswot/" ;
  owl:imports coswot:core\/procedures .


coswot:Sensor a owl:Class ;
  rdfs:subClassOf coswot:Device  ;
  rdfs:label "Sensor"@en ;
  rdfs:comment "Sensors are devices designed to observe one or more properties or states of features."@en ;
  owl:disjointUnionOf ( coswot:SensorOfInterest coswot:SensorKind ) ;
  rdfs:subClassOf [ a owl:Restriction ; owl:onProperty coswot:observes ; owl:minCardinality 1 ] ;
  rdfs:isDefinedBy coswot:core\/observations .

coswot:SensorOfInterest a owl:Class ;
  rdfs:subClassOf coswot:Sensor , coswot:DeviceOfInterest ;
  rdfs:label "Sensor Of Interest"@en ;
  rdfs:comment "A specific, tangible device designed to observe one or more properties or states of one or more features of interest."@en ;
  rdfs:subClassOf [ a owl:Restriction ; owl:onProperty coswot:observes ; owl:minCardinality 1 ] ;
  rdfs:isDefinedBy coswot:core\/observations .

coswot:SensorKind a owl:Class ;
  rdfs:subClassOf coswot:Sensor , coswot:DeviceKind;
  rdfs:label "Sensor Kind"@en ;
  rdfs:comment "Sensor kinds allow to describe types of sensors, with common properties having the same value, common states being the same, common functions, and common services. An instance of coswot:SensorKind represents an archetype of real world sensors, for example to populate device catalogs."@en ;
  rdfs:isDefinedBy coswot:core\/observations .

coswot:SensingFunction a owl:Class ;
  rdfs:subClassOf coswot:Function ;
  rdfs:label "Sensing Function"@en ;
  rdfs:comment "An sensing function is a function that has at least one sensing command."@en ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty coswot:hasCommand ;
    owl:someValuesFrom coswot:SensingCommand ] ;
  rdfs:isDefinedBy coswot:core\/observations .

coswot:SensingCommand a owl:Class ;
  rdfs:subClassOf coswot:Command ;
  rdfs:label "Sensing Command"@en ;
  rdfs:comment "An instance of sensing command is a command that observes something."@en ;
  rdfs:subClassOf [
    a owl:Restriction ;
    owl:onProperty coswot:observes ;
    owl:minCardinality 1 ] ;
  rdfs:isDefinedBy coswot:core\/observations .

coswot:Observation a owl:Class ;
  rdfs:label "Observation"@en ;
  rdfs:subClassOf coswot:ProcedureExecution ;
  rdfs:comment "A coswot:Observation is the act of carrying out a procedure to estimate or calculate a value of a property of a feature of interest, or a state of a feature of interest. It links to a sensor to describe what made the observation, and to the observed feature, property, property of interest, state, or state of interest. Typically, its result is a property value or a state. An observation of a state (OP coswot:observes) should have a state as a result (OP coswot:hasResult). Respectively, an observation of a property should have a property value as a result."@en ;
  rdfs:subClassOf [ a owl:Restriction ; owl:onProperty coswot:madeBy ; owl:allValuesFrom coswot:Sensor ] ;
  rdfs:subClassOf [ a owl:Restriction ; owl:onProperty coswot:observes ; owl:minCardinality 1 ] ;
  rdfs:isDefinedBy coswot:core\/observations .

coswot:Forecast a owl:Class ;
  rdfs:subClassOf coswot:Observation ;
  rdfs:label "Forecast"@en ;
  rdfs:comment "A forecast is the act of estimating a property value (future temporal validity context)."@en ;
  rdfs:isDefinedBy coswot:core\/procedures .


## OP coswot:observes links a device, function, command, or procedure execution, to the feature, property, or state, it observes.

coswot:observes a owl:ObjectProperty ;
  rdfs:subPropertyOf coswot:targets ;
  owl:inverseOf coswot:isObservedBy ;
  rdfs:label "observes"@en ;
  rdfs:comment "Links a sensor, sensing function, sensing command, or observation, to the feature, property, or state, it observes."@en ;
  rdfs:domain
      [   a owl:Class ;
          owl:unionOf (
              coswot:Sensor
              coswot:SensingFunction
              coswot:SensingCommand
              coswot:Observation ) ] ;
  rdfs:isDefinedBy coswot:core\/procedures .

coswot:isObservedBy a owl:ObjectProperty ;
  rdfs:subPropertyOf coswot:isTargetOf ;
  owl:inverseOf coswot:observes ;
  rdfs:label "is observed by"@en ;
  rdfs:comment "Links a feature, property, or state, to the sensor, sensing function, sensing command, or observation, that observes it."@en ;
  rdfs:isDefinedBy coswot:core\/procedures .
