Skip to main content

Smart Data reference


How a smart curve is stored​

A smart curve is a data item of type VarSmartCurve on a private master data record. The extension saves it with a merge update of the record (POST object/v1/private) that has the item as a property, so the record's other properties are not touched. Northgate's clean spark spread is stored as:

{
"_id": "NGE_SPREADS",
"CLEAN_SPARK_DE": {
"_id": "CLEAN_SPARK_DE",
"_type": "VarSmartCurve",
"name": "German clean spark spread",
"description": "German base power less the gas and carbon cost of a gas plant",
"baseCurve": {"_type": "VarReference", "_service": "data", "_oid": "NGE.POWER.DE:BASE"},
"expression": "BASE - GAS / EFFICIENCY - CARBON * EMISSION_FACTOR / EFFICIENCY",
"currency": "EUR",
"units": "MWh",
"cacheOptions": {"type": "OnDependencies"},
"category": "Spreads", "commodity": "Electricity", "market": "DE", "product": "Base", "priority": 1,
"properties": {
"_replace": true,
"GAS": {"_type": "VarReference", "_service": "data", "_oid": "NGE.GAS.TTF:MID"},
"CARBON": {"_type": "VarReference", "_service": "data", "_oid": "NGE.EUA:SETTLE"},
"EFFICIENCY": 0.49,
"EMISSION_FACTOR": 0.202
}
}
}
FieldWhat it is
_idThe id on the record. The full id is RECORD:ID, here NGE_SPREADS:CLEAN_SPARK_DE
name, descriptionThe name and description
baseCurveThe base: a reference to a curve (_oid), with _source when it was found in public data
expressionThe ODSL expression
scriptThe id of the script whose functions the expression uses, when it has one
currency, units, timezoneWhat the result is in; inputs are converted to them
cacheOptionstype: OnDependencies, OnDemand, OnSchedule (with a cron schedule), Never or External
category, commodity, market, product, priorityThe classification
precisionscale (decimal places) and roundingMode, when set
propertiesThe inputs: a reference for a curve or timeseries input, a number or text for a value input. Also the conversion settings CCY_DATASET and CCY_DATASET_SOURCE (FX provider), density, timefactor, heatRate, toUnit and conversionFactor
properties._replaceSent on updates, so the stored inputs are replaced rather than merged: an input removed in the editor is removed from the stored item

A curve input with an ondate option has it at the end of its id: NGE.GAS.TTF:MID:-ONDATE (latest on or before), :<ONDATE (latest before) or :-ABSOLUTE (latest by absolute period). A timeseries input of a smart curve has "_otype": "VarTimeSeries" on its reference.

Fields the editor does not show, such as tenor or _identity, are kept as they are when it is saved.


How a smart timeseries is stored​

The same, with type VarSmartTimeSeries, baseTimeSeries instead of baseCurve, an optional calendar, no cacheOptions, and the classification in properties:

{
"_id": "POWER_DE_DA_USD",
"_type": "VarSmartTimeSeries",
"name": "German day-ahead power in USD",
"baseTimeSeries": {"_type": "VarReference", "_service": "data", "_oid": "NGE.POWER.DE.DA:PRICE"},
"expression": "BASE * FX",
"currency": "USD",
"units": "MWh",
"properties": {
"_replace": true,
"FX": {"_type": "VarReference", "_service": "data", "_source": "public", "_oid": "#ECB_FX.EURUSD:SPOT"},
"category": "Prices", "commodity": "Electricity", "market": "DE", "product": "Day-ahead", "priority": 2
}
}

Smart data areas​

A smart data area is a private master data record of type smart_data_area, created by the extension when you choose A new smart data area while saving.

FieldWhat it is
_idThe record id, such as NGE_SPREADS
nameIts name, such as Northgate spreads
ownerThe email of the person who created it
teamOptional, the team it belongs to

The platform calls​

WhatCall
List smart curves or timeseriesGET data/v1/private with a _filter on _type VarSmartCurve or VarSmartTimeSeries
Read oneGET data/v1/private/RECORD:ID?_raw=true
Preview a smart curveGET data/v1/{source}/BASE:ONDATE?expression=...&script=...&currency=...&units=...&GAS=private/NGE.GAS.TTF:MID&__EFFICIENCY=0.49: a data input is NAME=source/ID, a value input __NAME=value
Preview a smart timeseriesGET data/v1/{source}/BASE?_range=last(90)&expression=...&FX=public/#ECB_FX.EURUSD:SPOT
Read the saved versionGET data/v1/private/RECORD:ID:ONDATE (curve) or RECORD:ID?_range=... (timeseries)
Build and store a smart curve for an ondateGET data/v1/private/RECORD:ID:ONDATE?_run=true
Stored buildsGET data/v1/private with _filter {"_smartcurve": "RECORD:ID"}
The ondates it can be built forGET data/v1/private/RECORD:ID?_range=between(FROM,TO)
VersionsGET data/v1/private/RECORD:ID/* (list) and .../RECORD:ID/N?_raw=true (one)
What uses itGET data/v1/private/RECORD:ID?_function=dependents
Roll backDELETE data/v1/private/RECORD:ID (deletes the current version)
Delete completelyDELETE data/v1/private/RECORD:ID/*
Audit trailGET audit/v1/private with _filter {"service": "data", "key": "RECORD:ID"}

The preview and the builds are made by the platform itself, so what you see in the preview is what the saved smart data gives.


Permissions​

WhatNeeds
The Smart Data screen and the Master Data tabThe feature policy extension.odsl.smart_data (features odsl.smart_data.manage and odsl.smart_data.master_data)
Saving and deletingPermission to update the master data record it is stored on, and its data
Reading the base and inputsRead access to that data, private or public
The Script tabThe same rights as the Script Manager: update on the script to save it, run to run or debug it

What the extension contains​

ItemIdWhat it is
Extensionodsl.smart_dataSmart Data, with the icon magic
ViewInformation, Smart DataScript odsl.smart_data.manage, feature odsl.smart_data.manage
ViewMaster Data, tab Smart DataScript odsl.smart_data.master_data, feature odsl.smart_data.master_data
Scriptsodsl.smart_data.common, odsl.smart_data.workspace, odsl.smart_data.codeThe shared parts of both views: the model, preview, library, chart and grid, the workspace, and the Script tab
Typesmart_data_areaThe record type of smart data areas
Feature policyextension.odsl.smart_dataGives access to both views

Your choices on the screens (the kind shown, the record filter, chart styles, period types, the grid order and date order) are kept in your browser only.


Troubleshooting​

What you seeWhy, and what to do
The preview shows the base unchangedThe live preview of a smart curve is built on a stored base curve. When the base is itself a smart, event or composed curve, save it and use Saved, as the platform builds it
The expression returned no valuesEvery contract was missing: the inputs have no tenors in common with the base, have no curve for this ondate, or the expression divides by zero. Check the inputs' Ondate option
A timeseries input has no valueA timeseries input of a smart curve needs a value for the ondate being built. Its chip in the Show row says so and gives the latest value before it
Unknown function after changing the scriptThe preview uses the saved script: save the script first
A build failed for some ondatesThe summary gives the platform's reason, most often an input with no curve for that ondate. Use Latest on or before the ondate for an input that is not updated every day
The curve did not change for past ondates after a saveSaving does not rebuild stored builds. Use Build with Build them again
Delete is refusedAnother smart curve or timeseries uses it: the dialog lists them
Smart data made by OpenDataDSL is missing from the listIt is in the category ODSL: tick Show ODSL