@prefix celine: <https://w3id.org/celine/ontology#> .
@prefix owl:    <http://www.w3.org/2002/07/owl#> .
@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 dct:    <http://purl.org/dc/terms/> .
@prefix time:   <http://www.w3.org/2006/time#> .

@prefix peco:   <https://purl.org/peco/peco-core#> .
@prefix saref:  <https://saref.etsi.org/core/> .
@prefix sosa:   <http://www.w3.org/ns/sosa/> .
@prefix bigg:   <https://w3id.org/bigg/ontology#> .

################################################################################
# Ontology
################################################################################

celine:CELINEOntology
    a owl:Ontology ;
    dct:title "CELINE Core Ontology" ;
    dct:description """
    Lightweight orchestration ontology for Renewable Energy Communities
    and Digital Twin workflows. CELINE integrates PECO, SAREF, SOSA and BIGG
    without redefining domain semantics.
    """ ;
    dct:license <https://creativecommons.org/licenses/by/4.0/> ;
    owl:imports
        <https://purl.org/peco/peco-core> ,
        <https://saref.etsi.org/core/v3.1.1/saref.ttl> ,
        <https://saref.etsi.org/saref4ener/v1.2.1/saref4ener.ttl> ,
        <https://github.com/w3c/sdw/raw/refs/heads/gh-pages/ssn/integrated/sosa.ttl> ,
        <https://raw.githubusercontent.com/BeeGroup-cimne/biggontology/refs/heads/main/ontology/ontology.ttl> ,
        <https://raw.githubusercontent.com/BeeGroup-cimne/biggontology/refs/heads/main/extensions/bigg4kpi.ttl> .

################################################################################
# Core Context Classes
################################################################################

celine:CommunityContext
    a owl:Class ;
    rdfs:label "Community Context" ;
    rdfs:comment """
    Operational context binding a PECO Energy Community
    with assets, datasets and simulations.
    """ .

celine:Scenario
    a owl:Class ;
    rdfs:label "Scenario" ;
    rdfs:comment """
    Definition of assumptions, temporal scope and configuration
    for one or more simulations.
    """ .

celine:Simulation
    a owl:Class ;
    rdfs:label "Simulation" ;
    rdfs:comment """
    Abstract simulation definition independent from execution.
    """ .

celine:SimulationRun
    a owl:Class ;
    rdfs:label "Simulation Run" ;
    rdfs:comment """
    Concrete execution of a Simulation under a specific Scenario.
    """ .

################################################################################
# Dataset Abstraction
################################################################################

celine:DatasetReference
    a owl:Class ;
    rdfs:label "Dataset Reference" ;
    rdfs:comment """
    Reference to an external dataset used as input or produced as output.
    CELINE does not define dataset schemas.
    """ .

################################################################################
# KPI Evaluation Layer
################################################################################

celine:KPIEvaluation
    a owl:Class ;
    rdfs:label "KPI Evaluation" ;
    rdfs:comment """
    Evaluation of a BIGG KPI in a specific Scenario or SimulationRun.
    """ .

################################################################################
# Object Properties (Glue Layer)
################################################################################

celine:hasCommunity
    a owl:ObjectProperty ;
    rdfs:domain celine:CommunityContext ;
    rdfs:range peco:EnergyCommunity ;
    rdfs:label "has energy community" .

celine:usesAsset
    a owl:ObjectProperty ;
    rdfs:domain celine:CommunityContext ;
    rdfs:range saref:Device ;
    rdfs:label "uses asset" ;
    rdfs:comment "References SAREF or SAREF4ENER devices." .

celine:hasScenario
    a owl:ObjectProperty ;
    rdfs:domain celine:Simulation ;
    rdfs:range celine:Scenario ;
    rdfs:label "has scenario" .

celine:hasSimulation
    a owl:ObjectProperty ;
    rdfs:domain celine:CommunityContext ;
    rdfs:range celine:Simulation ;
    rdfs:label "has simulation" .

celine:hasSimulationRun
    a owl:ObjectProperty ;
    rdfs:domain celine:Simulation ;
    rdfs:range celine:SimulationRun ;
    rdfs:label "has simulation run" .

celine:usesDataset
    a owl:ObjectProperty ;
    rdfs:domain celine:SimulationRun ;
    rdfs:range celine:DatasetReference ;
    rdfs:label "uses dataset" .

celine:producesDataset
    a owl:ObjectProperty ;
    rdfs:domain celine:SimulationRun ;
    rdfs:range celine:DatasetReference ;
    rdfs:label "produces dataset" .

celine:evaluatesKPI
    a owl:ObjectProperty ;
    rdfs:domain celine:KPIEvaluation ;
    rdfs:range bigg:KPI ;
    rdfs:label "evaluates KPI" .

celine:hasKPIEvaluation
    a owl:ObjectProperty ;
    rdfs:domain celine:SimulationRun ;
    rdfs:range celine:KPIEvaluation ;
    rdfs:label "has KPI evaluation" .

################################################################################
# Temporal Properties
################################################################################

celine:hasTimeInterval
    a owl:ObjectProperty ;
    rdfs:range time:Interval ;
    rdfs:label "has time interval" .

################################################################################
# Measurement Linking (No Redefinition)
################################################################################

celine:usesObservation
    a owl:ObjectProperty ;
    rdfs:domain celine:SimulationRun ;
    rdfs:range sosa:Observation ;
    rdfs:label "uses observation" ;
    rdfs:comment "References SOSA observations (e.g. weather, sensors)." .
