@base <https://celine-eu.github.io/ontologies/celine/> .
@prefix celine: <https://celine-eu.github.io/ontologies/celine#> .

@prefix saref: <https://saref.etsi.org/core/> .
@prefix s4ener: <https://saref.etsi.org/saref4ener/> .
@prefix s4bldg: <https://saref.etsi.org/saref4bldg/> .
@prefix s4city: <https://saref.etsi.org/saref4city/> .
@prefix sosa: <http://www.w3.org/ns/sosa/> .
@prefix bigg: <http://bigg-project.eu/ontology#> .
@prefix bigg4kpi: <http://bigg-project.eu/ontology/bigg4kpi#> .
@prefix seas: <https://w3id.org/seas/> .
@prefix emkpi: <https://omic-tools.org/ontology/em-kpi#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .


#################################################################
# Observation Shape (SOSA / CELINE)
#################################################################

celine:ObservationShape a sh:NodeShape ;
    sh:targetClass celine:Observation ;
    sh:name "CELINE Observation" ;
    sh:property [
        sh:path sosa:madeBySensor ;
        sh:name "madeBySensor" ;
        sh:description "The sensor/meter that produced this observation." ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:nodeKind sh:IRI
    ] ;
    sh:property [
        sh:path sosa:hasFeatureOfInterest ;
        sh:name "hasFeatureOfInterest" ;
        sh:description "The asset or feature this observation is about." ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:nodeKind sh:IRI
    ] ;
    sh:property [
        sh:path sosa:observedProperty ;
        sh:name "observedProperty" ;
        sh:description "The property that is being observed (e.g. energy consumption)." ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:nodeKind sh:IRI
    ] ;
    sh:property [
        sh:path sosa:resultTime ;
        sh:name "resultTime" ;
        sh:description "The time when the observation result became available." ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:datatype xsd:dateTime
    ] ;
    sh:property [
        sh:path sosa:hasSimpleResult ;
        sh:name "hasSimpleResult" ;
        sh:description "Numeric value of the observation (e.g. kWh)." ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:datatype xsd:float
    ] .


#################################################################
# TimeSeries Shape (BIGG / CELINE)
#################################################################

celine:TimeSeriesShape a sh:NodeShape ;
    sh:targetClass celine:TimeSeries ;
    sh:name "CELINE Time Series" ;
    sh:property [
        sh:path bigg:hasTimeSeriesPoint ;
        sh:name "hasTimeSeriesPoint" ;
        sh:description "Points belonging to this time series." ;
        sh:minCount 1 ;
        sh:class bigg:TimeSeriesPoint
    ] .


#################################################################
# TimeSeriesPoint Shape (BIGG)
#################################################################

celine:TimeSeriesPointShape a sh:NodeShape ;
    sh:targetClass bigg:TimeSeriesPoint ;
    sh:name "CELINE Time Series Point" ;
    sh:property [
        sh:path bigg:dateTime ;
        sh:name "dateTime" ;
        sh:description "Timestamp for this time series point." ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:datatype xsd:dateTime
    ] ;
    sh:property [
        sh:path bigg:hasValue ;
        sh:name "hasValue" ;
        sh:description "Numeric value at this time." ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:datatype xsd:float
    ] ;
    sh:property [
        sh:path bigg:refersToProperty ;
        sh:name "refersToProperty" ;
        sh:description "The property this time series point refers to (e.g. EnergyConsumption)." ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:nodeKind sh:IRI
    ] .


#################################################################
# Meter Shape
#################################################################

celine:MeterShape a sh:NodeShape ;
    sh:targetClass celine:Meter ;
    sh:name "CELINE Meter" ;
    sh:property [
        sh:path celine:hasTimeSeries ;
        sh:name "hasTimeSeries" ;
        sh:description "Time series associated with this meter." ;
        sh:minCount 0 ;
        sh:class celine:TimeSeries
    ] ;
    sh:property [
        sh:path celine:hasObservation ;
        sh:name "hasObservation" ;
        sh:description "Individual observations produced by this meter." ;
        sh:minCount 0 ;
        sh:class celine:Observation
    ] .


#################################################################
# Energy Community Shape
#################################################################

celine:EnergyCommunityShape a sh:NodeShape ;
    sh:targetClass celine:EnergyCommunity ;
    sh:name "CELINE Energy Community" ;
    sh:property [
        sh:path celine:hasMember ;
        sh:name "hasMember" ;
        sh:description "Members (prosumers) of this energy community." ;
        sh:minCount 1 ;
        sh:class celine:Prosumer
    ] ;
    sh:property [
        sh:path celine:hasTariff ;
        sh:name "hasTariff" ;
        sh:description "Tariff(s) applicable to this community." ;
        sh:minCount 0 ;
        sh:class celine:Tariff
    ] ;
    sh:property [
        sh:path celine:evaluatedBy ;
        sh:name "evaluatedBy" ;
        sh:description "KPI assessments for this community." ;
        sh:minCount 0 ;
        sh:class celine:EnergyKPI
    ] .
