Time Series - statnett/Talk2PowerSystem GitHub Wiki

Time-series in Cognite

There are a total of 39 time series records in Cognite. They are described with json metadata and are of three types:

Power Flow

8 time-series of power flow. Here is the metadata of the power flow between NO3 and NO4.

    {
        "external_id": "9bb00faf-0f2f-831a-e040-1e828c94e833_estimated_value",
        "name": "Elspot NO3-NO4 MW_estimated_value",
        "is_string": false,
        "metadata": {
            "source": "eTerra",
            "topic": "observations_grid_power_no_ems_analog_active_power_res_1s_avro_v1",
            "measurement_type": "ThreePhaseActivePower",
            "timeseries_type": "estimated_value",
            "unit_multiplier": "M",
            "unit_symbol": "W",
            "mrid": "9bb00faf-0f2f-831a-e040-1e828c94e833",
            "unit": "MW",
            "substation": "",
            "end_time": "",
            "subscription": "DIV_NCC",
            "device": "ELSPOT"
        },
        "unit": "MW",
        "asset_id": 7963992857657991,
        "is_step": false,
        "description": "ThreePhaseActivePower",
        "security_categories": [],
        "data_set_id": 5515145765342807,
        "id": 544839464297326,
        "created_time": "2023-06-13 21:12:48.306+00:00",
        "last_updated_time": "2025-02-17 14:31:10.853+00:00"
    }

Price

28 time-series of actual energy prices in EUR and NOK. Here is the metadata of the energy price at NO3 bidding zone in Norwegian Krone.

    {
        "external_id": "Kraftpriser_NO3_NOK_13",
        "name": "Kraftpriser_NO3_NOK",
        "is_string": false,
        "metadata": {
            "PRIS_TYPE": "PRI7004",
            "measurementType": "Price",
            "PRIS_OMRAADE_TYPE": "1.0",
            "PRIS_OMRAADE": "NO3",
            "timeseriesType": "value",
            "table": "MMS.RAPPORT_KRAFTPRIS_ELSPOT_NO",
            "PRIS_VALUTA": "NOK"
        },
        "unit": "NOK per MWh",
        "asset_id": 2149735182077095,
        "is_step": false,
        "description": "Kraftpriser for prisomrade NO3 (NOK)",
        "security_categories": [],
        "data_set_id": 7519740957219860,
        "id": 2896958021852,
        "created_time": "2020-05-05 20:11:02.889+00:00",
        "last_updated_time": "2024-12-02 15:41:40.072+00:00"
    }

Exchange Rate

3 time-series with currency exchange rates. Here is the metadata of the exchange rate between the Euro and Swedish Krona

    {
        "external_id": "Valutakurs_EUR_SEK",
        "name": "Valutakurs_EUR_SEK",
        "is_string": false,
        "metadata": {
            "kafka_stream": "connect_ogg_fifty_MMS_RAPPORT_KRAFTPRIS_ELSPOT_NO_avro",
            "ENDRET_AV": "Fifty",
            "measurementType": "Price",
            "BASIS_VALUTA": "EUR",
            "timeseriesType": "value",
            "table": "MMS.VALUTA_KURS",
            "PRIS_VALUTA": "SEK"
        },
        "unit": "[SEK/EUR]",
        "asset_id": 3264270732874159,
        "is_step": false,
        "description": "Valutakurs for EUR SEK",
        "security_categories": [],
        "data_set_id": 7519740957219860,
        "id": 5024799473173428,
        "created_time": "2019-11-25 08:23:20.156+00:00",
        "last_updated_time": "2024-11-27 15:57:27.349+00:00"
    }

We use this metadata to create the RDF objects.

Time-series in RDF

  • In the RDF the time-series are nodes of type cim:Analog .
  • They are connected to the rest of the graph via the cim:Measurement.PowerSystemResource and cim:PowerSystemResource.Measurements predicates.
  • the cimr:Measurement.isInCognite boolean flag indicates if the record is in Cognite.
  • The mapping to the cognite record is done via the shared mRIDs (cim:IdentifiedObject.mRID in GrapDB and mRID in Cognite)
<urn:uuid:3d972481-ddff-4e7a-bec7-d581a6e4b36a> a cim:IdentifiedObject, cim:Measurement,
    cim:Analog;
  cim:IdentifiedObject.description "Kraftpriser for prisområde NO3 (NOK)";
  cim:IdentifiedObject.mRID "3d972481-ddff-4e7a-bec7-d581a6e4b36a";
  cim:IdentifiedObject.name "Kraftpriser_NO3_NOK";
  <http://qudt.org/schema/qudt/hasUnit> <http://qudt.org/vocab/unit/CCY_NOK-PER-MegaW-HR>;
  cim:Measurement.PowerSystemResource <urn:uuid:0f094148-164b-427a-a8e8-0c5f334688ae>;
  cim:Measurement.unitSymbol cim:UnitSymbol.NOKperMWh;
  cim:Measurement.measurementType "Price-Actual";
  cimr:mridSignificantPart "3d972481";
  cimr:Measurement.isInCognite true .

<urn:uuid:0f094148-164b-427a-a8e8-0c5f334688ae> a cim:IdentifiedObject, cim:PowerSystemResource, nc:BiddingZone;
    cim:IdentifiedObject.description "Norwegian Area Elspot Area 3";
    cim:IdentifiedObject.name "NO3";
    cim:PowerSystemResource.Measurements <urn:uuid:3d972481-ddff-4e7a-bec7-d581a6e4b36a> .

Query to retrieve the list of all time-series referenced in the KG

PREFIX cimr: <https://cim.ucaiug.io/rules#>
PREFIX cim: <https://cim.ucaiug.io/ns#>
select * where {
    ?x a cim:Analog ; 
    cimr:Measurement.isInCognite true ;
    cim:Measurement.measurementType ?measurementType ;
    cim:IdentifiedObject.name ?name ;
    cim:IdentifiedObject.description ?desc ;
    .
}

QUERY

Additions to QUDT

In order to represent these values, we added several fractional units to the QUDT ontology, such as "Euro per Megawatt Hour":

unit:CCY_EUR-PER-MegaW-HR
    a qudt:Unit ;
    qudt:applicableSystem sou:SI ;
    qudt:conversionMultiplier 0.000000000277777777777777777777777777778 ;
    qudt:conversionMultiplierSN 2.777777777777777777777777777777778E-10 ;
    qudt:hasDimensionVector qkdv:A0E0L-2I0M-1H0T2D0 ;
    qudt:hasFactorUnit [
      qudt:exponent -1 ;
      qudt:hasUnit unit:HR ;
    ] ;
    qudt:hasFactorUnit [
      qudt:exponent -1 ;
      qudt:hasUnit unit:MegaW ;
    ] ;
    qudt:hasFactorUnit [
      qudt:exponent 1 ;
      qudt:hasUnit unit:CCY_EUR ;
    ] ;
    qudt:hasQuantityKind quantitykind:CostPerEnergy ;
    qudt:plainTextDescription "Unit for measuring the cost of electricity." ;
    qudt:symbol "€/(MW·h)" ;
    rdfs:isDefinedBy <http://qudt.org/vocab/unit> ;
    rdfs:label "Euro per Megawatt Hour" ;
    rdfs:label "Euro per Megawatt Hour"@en ;
.

and "Exchange rate of Danish Krone to Euros"

unit:CCY_DKK-PER-CCY_EUR
    a qudt:Unit ;
    qudt:hasQuantityKind quantitykind:ExchangeRate ;
    qudt:hasFactorUnit [
      qudt:hasUnit unit:CCY_DKK;
      qudt:exponent 1
    ];
    qudt:hasFactorUnit [
      qudt:hasUnit unit:CCY_EUR;
      qudt:exponent -1
    ];
    rdfs:label "Danish Krone per Euro" ;
    qudt:symbol "DKK/EUR" ;
    qudt:plainTextDescription "Exchange rate of Danish Krone to Euros" ;
    rdfs:isDefinedBy <http://qudt.org/vocab/unit> ;
.

A new quantity kind, "Exchange Rate" was also added

quantitykind:ExchangeRate a qudt:QuantityKind ;
    qudt:applicableUnit unit:CCY_NOK-PER-CCY_EUR ;
    qudt:applicableUnit unit:CCY_SEK-PER-CCY_EUR ;
    qudt:applicableUnit unit:CCY_DKK-PER-CCY_EUR ;
    qudt:hasDimensionVector qkdv:A0E0L0I0M0H0T0D1 ; ## see https://github.com/qudt/qudt-public-repo/issues/1283
    qudt:informativeReference "https://en.wikipedia.org/wiki/Exchange_rate"^^xsd:anyURI ;
    qudt:plainTextDescription "Rate at which one currency will be exchanged for another currency" ;
    rdfs:comment "Applicable units are fractions of two qudt:CurrencyUnit" ;
    rdfs:isDefinedBy <http://qudt.org/vocab/quantitykind> ;
    rdfs:label "Exchange rate"@en .

Cognite query tools

The chatbot can use these tools to query Coginte data.

Competency questions for time-series data

These are example questions that can be handled by the chatbot, using the query tool

  • "Power flow from NO1 to NO3; for 2025, weekly average, min, max"
  • "Power flow from NO3 to NO1; for 2025, weekly average, min, max."
  • "Energy prices in EUR for NO1; for the second half of 2024, monthly average and standard deviation"
  • "Energy prices in NOK for NO1; for the second half of 2024, monthly average and standard deviation"
  • "Energy prices for NO1; for the second half of 2024, monthly average and standard deviation" - according to Olav data-streams for prices in NOK are obsolete, hence the implied currency here is EUR
  • "What is the EIC code of zone NO1; and its energy price for last year (monthly average)"
  • "Give me the percentage of time for the past month, where the Voltage readings on the line ARENDAL-KRISTIANSAND are above its operational limit"

see also issue #117

Issues