Define what gets computed, from what, and how.
List every configured derivation
List every configured derivation › Responses
Every derivation, as a JSON array.
idnamefn_sourcePython source defining def run(inputs, row): ... Executed in a restricted sandbox - see this document's security note.
kindselectformula only. SPARQL SELECT binding target_var and every name in input_vars/extra_vars.
target_varformula only.
input_varsformula only. Bound to fn's inputs dict, each read as a point history series.
extra_varsformula only. Bound SPARQL variables passed through to fn's row as raw values, not read as point histories (e.g. a threshold literal).
formula only. Per-input_var override of window_seconds, for mixing points with very different update cadences.
root_selectrollup only. SPARQL SELECT binding ?root, one row per top-level entity to roll up.
part_relationshiprollup only. Parent->child predicate CURIE to walk, e.g. brick:hasPart.
leaf_point_classrollup only. Brick class CURIE identifying which directly-attached points at any tree node count as leaf inputs, e.g. brick:Meter.
window_secondsinterval_secondsOverrides the engine's default sweep tick for this derivation only.
applies_to_topic_globformula only. When set, an incoming MQTT message matching this glob triggers an immediate targeted re-evaluation in addition to the periodic sweep.
depends_onIds of other derivations that must be evaluated first in the same sweep.
Create a derivation
kind is "formula" (default - a SPARQL select binds a target
and named input_vars, one function call per matched row) or
"rollup" (a root_select binds one or more root entities; the
engine walks a part_relationship tree under each root, computing
a value at every node bottom-up from its own leaf_point_class
points plus its already-computed children).
fn_source must define def run(inputs, row): ... returning a
number or None ("no result this pass" - nothing is written).
test_cases is required and non-empty: every case is run through
the compiled function before the derivation is persisted, and any
compile failure or expected/actual mismatch is a 400 naming
exactly which case failed.
Create a derivation › Request Body
namefn_sourcePython source defining def run(inputs, row): ... Executed in a restricted sandbox - see this document's security note.
kindselectformula only. SPARQL SELECT binding target_var and every name in input_vars/extra_vars.
target_varformula only.
input_varsformula only. Bound to fn's inputs dict, each read as a point history series.
extra_varsformula only. Bound SPARQL variables passed through to fn's row as raw values, not read as point histories (e.g. a threshold literal).
formula only. Per-input_var override of window_seconds, for mixing points with very different update cadences.
root_selectrollup only. SPARQL SELECT binding ?root, one row per top-level entity to roll up.
part_relationshiprollup only. Parent->child predicate CURIE to walk, e.g. brick:hasPart.
leaf_point_classrollup only. Brick class CURIE identifying which directly-attached points at any tree node count as leaf inputs, e.g. brick:Meter.
window_secondsinterval_secondsOverrides the engine's default sweep tick for this derivation only.
applies_to_topic_globformula only. When set, an incoming MQTT message matching this glob triggers an immediate targeted re-evaluation in addition to the periodic sweep.
depends_onIds of other derivations that must be evaluated first in the same sweep.
Create a derivation › Responses
Created.
idnamefn_sourcePython source defining def run(inputs, row): ... Executed in a restricted sandbox - see this document's security note.
kindselectformula only. SPARQL SELECT binding target_var and every name in input_vars/extra_vars.
target_varformula only.
input_varsformula only. Bound to fn's inputs dict, each read as a point history series.
extra_varsformula only. Bound SPARQL variables passed through to fn's row as raw values, not read as point histories (e.g. a threshold literal).
formula only. Per-input_var override of window_seconds, for mixing points with very different update cadences.
root_selectrollup only. SPARQL SELECT binding ?root, one row per top-level entity to roll up.
part_relationshiprollup only. Parent->child predicate CURIE to walk, e.g. brick:hasPart.
leaf_point_classrollup only. Brick class CURIE identifying which directly-attached points at any tree node count as leaf inputs, e.g. brick:Meter.
window_secondsinterval_secondsOverrides the engine's default sweep tick for this derivation only.
applies_to_topic_globformula only. When set, an incoming MQTT message matching this glob triggers an immediate targeted re-evaluation in addition to the periodic sweep.
depends_onIds of other derivations that must be evaluated first in the same sweep.
Validate fn_source against test_cases without persisting anything
Same compile-and-run-test_cases path as POST /derivations, stateless - for iterating on a derivation before creating it.
Validate fn_source against test_cases without persisting anything › Request Body
fn_sourceValidate fn_source against test_cases without persisting anything › Responses
Per-case pass/fail, actual vs. expected.
passedactualWhat run() actually returned, or null if it errored.
expectederrorRun a derivation against live data without writing anything
Runs the full pipeline (SPARQL select/root_select against the real
ontology, real point_history reads, the sandboxed function call)
exactly as a real sweep would, but skips every mutating call
(point_history writes, graph writes, target-health updates) and
returns a step-by-step trace instead. Pass {"id": "<existing id>"}
to dry-run a saved derivation, or a full draft derivation body
(same shape as POST /derivations, test_cases optional here) to
try one out before creating it.
Run a derivation against live data without writing anything › Request Body
Decision Table
| Variant | Matching Criteria |
|---|---|
| type = object · requires: id | |
| type = object · requires: name, fn_source, test_cases |
idRun a derivation against live data without writing anything › Responses
One trace entry per evaluated target.
targetderivation_idcomputed_valuewould_write_uriwould_attach_towould_derive_fromerror
