Template:DefineVariables

From Open Energy Information

This is the DefineVariables template. It is typically used to assign the results of an ask or sparql query as variables using a simple label:value format. It is used by many pages, including the states pages, and is most frequently called as the template parameter in a query returned as format=template.

For more help on this, see Extension:SparqlExtension, Template Help.

Parameters
  1. label - The label, property or predicate of the query.
    • Note: This template will strip everything left of the right-most '/' from the label and transform spaces back into _s!
  2. value - The value or object specified in the query.

Note: Parameters can be called in numerical order, or using parameter name.

Usage

It should be called in the following format:

{{#sparql
  SELECT ...
 |format=template
 |template=DefineVariables
 |..
}}
Example

Passing http://openei.org/lod/object/foo, bar to the template will result in the assignment of "bar" to the variable foo.

Edit the page to see the template text.