Skip to content

Sparse graph queries

Gerard edited this page Mar 12, 2018 · 12 revisions

Basics

A sparse graph query is a query with which an attribute can be set in the sparse graph. This is usually a combination of an input from ETLocal and a serie of queryable attributes.

Syntax

A sparse graph query is a GQL with some quirks. There are three attributes which you can set:

- graph_key
- graph_attribute
- query

graph_key

A key which specifies either a node or an edge.

graph_attribute

A key which specifies which attribute to take.

query

A GQL statement.

Allowed GQL statements:

  • DATASET_INPUT(key) (Reads an input from the ETLocal front-end, unless the key is a direct sparse graph key)
  • EB(use, carrier) (Reads from the parent's dataset energy balance)
  • AREA(key) (Reads from the parent's dataset area file)
  • SHARE(key, attribute) (Reads from the parent's dataset share values)
  • EFFICIENCY(key, direction, carrier) (Reads from the parent's dataset efficiencies)
  • CENTRAL_PRODUCTION(key, attr = :demand) (Reads from the parent's dataset central production csv)
  • PRIMARY_PRODUCTION(key, attr) (Reads from the parent's dataset primary production)
  • TIME_CURVE(key, attr) (Reads from the parent's dataset time curve)
  • DEMAND(key, attr) (Reads a demand from the parent's dataset demands)

Example:

- graph_key = households_final_demand_electricity
- graph_attribute = demand
- query = DATASET_INPUT(etlocal_test_key) * 5

This query will set the demand of households_final_demand_electricity by multiplying the input from etlocal_test_key by 5.

Clone this wiki locally