# Copyright 2016 ITEA 12004 SEAS Project.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#      http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing,
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dc: <http://purl.org/dc/terms/> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix voaf: <http://purl.org/vocommons/voaf#> .
@prefix vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#> .
@prefix cc: <http://creativecommons.org/ns#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix qudt: <http://qudt.org/1.1/schema/qudt#>.
@prefix prov: <http://www.w3.org/ns/prov#>.
@prefix ssn: <http://www.w3.org/ns/ssn/>.
@prefix skos: <http://www.w3.org/2004/02/skos/core#>.

@prefix seas: <https://w3id.org/seas/>.
@base <https://w3id.org/seas/>.


seas:EvaluationOntology a owl:Ontology , voaf:Vocabulary ;
  dc:title "SEAS-Evaluation ontology"@en ;
  dc:description "The Seas Evaluation ontology generalizes quantity ontologies such as QUDT or OM."@en ;
  dc:description <https://w3id.org/seas/evaluation.png> ;
  dc:issued "2016-06-08"^^xsd:date ;
  dc:modified "2016-07-22"^^xsd:date ;
  dc:creator <http://www.maxime-lefrancois.info/me#> ;
  cc:license <https://creativecommons.org/licenses/by/4.0> ;
  vann:preferredNamespacePrefix "seas" ;
  vann:preferredNamespaceUri <https://w3id.org/seas/> ;  
  owl:imports seas:FeatureOfInterestOntology ;
  owl:versionIRI <https://w3id.org/seas/EvaluationOntology-1.0> ;
  owl:versionInfo "v1.0" .

seas:Property a owl:Class.

seas:evaluation a owl:ObjectProperty ;
  rdfs:label "evaluation"@en ;
  rdfs:comment """Links a property to one of its evaluations."""@en ;
  rdfs:domain seas:Property ;
  rdfs:range seas:Evaluation ;
  vs:term_status "stable" ;
  rdfs:isDefinedBy seas:EvaluationOntology .

seas:evaluationOf a owl:ObjectProperty ;
  rdfs:label "evaluation of"@en ;
  rdfs:comment """Links an evaluation to the property ot evaluates."""@en ;
  rdfs:domain seas:Evaluation ;
  rdfs:range seas:Property ;
  vs:term_status "stable" ;
  rdfs:isDefinedBy seas:EvaluationOntology .

qudt:quantityValue rdfs:subPropertyOf seas:evaluation .

seas:Evaluation a owl:Class ;
  rdfs:label "Evaluation"@en ;
  rdfs:comment """The evaluation is an indirection between a property and a literal value that qualifies some aspect of the property. It holds additional metadata about:

- the context of validity of the evaluation, and 
- the aspect of the property the literal qualifies.
  
  seas:Evaluation extends qudt:QuantityValue because the evaluated property may not be a Quantity.
  For example, if the property is an alternating current signal, several aspects of this signal may be qualified. Example of such aspects include:

- The average peak value (seas:ts-Average + seas:fourier-peak);
- the minimal operating value of the frequency (seas:op-Min + seas:fourier-frequency);
- the number of occurences of unusual values is detected.

  The context of validity of the evaluation is expressed using context properties. Prototypical context properties are seas:temporalContext, seas:temporalValidityContext, seas:geoPoint. They are defined in vocabulary seas:EvaluationContextVocabulary;
  (b) zero or more skos:Concepts that enable to interpret the evaluation. For instance seas:ag-Average, seas:op-Nominal. These concepts are defined in vocabulary seas:EvaluationInterpretationVocabulary.

  For instance, the meaning of the following RDF graph is: it is evaluated that the minimal population of the town in 2016 is 23000:

```
  <town/1/population> a seas:Property ;
    seas:evaluation <evaluation/1> .
  <evaluation/1> a seas:Evaluation ;
    seas:evaluatedValue 230000 ;
    seas:temporalContext [ 
      time:hasBeginning [ time:inXSDDateTime "2016-01-01T00:00:00Z"^^xsd:dateTime ] ;
      time:hasEnd [ time:inXSDDateTime "2017-01-01T00:00:00Z"^^xsd:dateTime ] ] ;
    seas:interpretedAs seas:ts-Minimum .
```"""@en ;
  vs:term_status "stable" ;
  rdfs:isDefinedBy seas:EvaluationOntology .

qudt:QuantityValue rdfs:subClassOf seas:Evaluation .

seas:evaluatedValue a owl:DatatypeProperty , owl:FunctionalProperty ;
  rdfs:label "evaluated value"@en ;
  rdfs:comment """Links an evaluation to the literal that qualifies some aspect of the property."""@en ;
  rdfs:domain seas:Evaluation ;
  rdfs:range rdfs:Literal ;
  vs:term_status "stable" ;
  rdfs:isDefinedBy seas:EvaluationOntology .

qudt:numericalValue rdfs:subPropertyOf seas:evaluatedValue .


# evaluation context

seas:ContextPropertyKey a owl:Class ;
  rdfs:label "context property"@en ;
  rdfs:comment """The class of context property keys that link evaluations to their context of validity.

  Any instance of seas:ContextPropertyKey is also a functional property (object or data) with domain seas:Evaluation."""@en ;
  vs:term_status "stable" ;
  rdfs:isDefinedBy seas:EvaluationOntology .
  

# evaluation interpretation

seas:interpretedAs a owl:ObjectProperty ;
  rdfs:label "interpreted as"@en ;
  rdfs:comment """Links an evaluation to a skos:Concept that enables to interpret the evaluation of a quantifiable property."""@en ;
  rdfs:domain seas:Evaluation ;
  rdfs:range seas:EvaluationInterpretationConcept ;
  vs:term_status "stable" ;
  rdfs:isDefinedBy seas:EvaluationOntology .

seas:EvaluationInterpretationConcept a owl:Class ;
  rdfs:label "Evaluation Interpretation Concept"@en ;
  rdfs:comment """The class of concepts that are used to interpret evaluations of quantifiable properties."""@en ;
  rdfs:subClassOf skos:Concept ;
  vs:term_status "stable" ;
  rdfs:isDefinedBy seas:EvaluationOntology .

seas:Exact a skos:Concept, seas:EvaluationInterpretationConcept ;
  rdfs:label "Exact"@en ;
  skos:prefLabel "Exact"@en ;
  skos:notation "Exact" ;
  rdfs:comment """Exact means that the given literal is the one and only value of the property, which hence has exactly one aspect. If the literal represents a quantity value, for instance with the use of datatype cdt:ucum, then the property is a quantity."""@en ;
  skos:definition """Exact means that the given literal is the one and only value of the property, which hence has exactly one aspect. If the literal represents a quantity value, for instance with the use of datatype cdt:ucum, then the property is a quantity."""@en ;
  vs:term_status "stable" ;
  rdfs:isDefinedBy seas:EvaluationOntology . 

# value

seas:value a owl:DatatypeProperty ;
  rdfs:label "value"@en ;
  rdfs:comment """Links a property to its literal value. For instance:

```
  <car/1/length> a seas:Property ;
    seas:value "4.27 m"^^cdt:ucum .
```

  The meaning of this RDF graph is that 4.27 m is the true, exact value of the length of the car, and is constant as long as the truth of the containing RDF graph holds.

  This property is a shortcut for an evaluation with no context (i.e., true in the most general context), and that is interpreted as seas:Exact. If the literal represents a quantity value, for instance with the use of datatype cdt:ucum, then the property is a quantity."""@en ;
  rdfs:domain seas:Property ;
  rdfs:range rdfs:Literal ;
  vs:term_status "stable" ;
  rdfs:isDefinedBy seas:EvaluationOntology .

