> For the complete documentation index, see [llms.txt](https://docs.dataclearinghouse.org/dch-2.0-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dataclearinghouse.org/dch-2.0-documentation/dch-and-the-brick-schema-ontology/briql-query-language.md).

# BRIQL Query Language

## **BRIQL API overview** <a href="#sparqlapifordch2-briqlapioverview" id="sparqlapifordch2-briqlapioverview"></a>

BRIQL is a protocol used for querying semantic models, to extract building information that is useful to applications. BRIQL provides a domain-specific query syntax, and returns data in a JSON structure that is readily useful to client applications. 'Under the hood', the BRIQL API is performing SPARQL queries to extract information. This means that it is producing solutions by matching variables to model entities, and associating and/or constraining variables by the topology of nodes inside models.&#x20;

When BRIQL queries are executed, the following events occur:&#x20;

* Client software sends a BRIQL invocation to DCH endpoint.
* Access to models mentioned in the BRIQL invocation is verified.&#x20;
* BRIQL invocation translated into [**SPARQL 1.1**](https://www.w3.org/TR/sparql11-query/) query.
* SPARQL is executed in graph database.
* SPARQL solution is translated to a BRIQL solution.
* BRIQL solution is returned to the client software.

BRIQL queries may be either:

* a "select" query, with arbitrary matching logic over one or more models.
* a "describe" query, which will provide detailed information about a single node of a single model.

The response payload for select queries differ to responses for describe queries.

### **BRIQL-to-SPARQL translation** <a href="#sparqlapifordch2-briql-to-sparqltranslation" id="sparqlapifordch2-briql-to-sparqltranslation"></a>

This table briefly summarises relationship between BRIQL and SPARQL concepts. It may be useful to developers who are already familiar with SPARQL and RDF.

<table data-full-width="true"><thead><tr><th>BRIQL Concept</th><th>SPARQL Concept</th><th>BRIQL-SPARQL Translation Notes</th></tr></thead><tbody><tr><td>block</td><td><a href="https://www.w3.org/TR/sparql11-query/#GraphPattern">graph pattern</a></td><td>Parameters on a block determine the type of Graph Pattern in SPARQL.</td></tr><tr><td>model</td><td><a href="https://www.w3.org/TR/sparql11-query/#unnamedGraph">graph</a></td><td>Models specified in an invocation are transparently translated to a list of graphs to set the SPARQL query's ensemble 'default graph' (the Brick schema is implicitly included).</td></tr><tr><td>NodeVar</td><td><a href="https://www.w3.org/TR/sparql11-query/#QSynVariables">variable</a></td><td>For each BRIQL variable (a NodeVar), requested properties are mapped to SPARQL variables.</td></tr><tr><td>output</td><td><a href="https://www.w3.org/TR/sparql11-query/#selectproject">projection</a></td><td>NodeVars with "output"="true" will be included in the SELECT projection.</td></tr></tbody></table>

### **REST endpoint** <a href="#sparqlapifordch2-restendpoint" id="sparqlapifordch2-restendpoint"></a>

The DCH endpoint URL for BRIQL queries is **`https://dataclearinghouse.org/api/mv/v1/query/briql`**

Optionally, the URL query parameter **`?return_sparql=true`** can be added. This can be useful during development to determine precisely what a BRIQL invocation is doing.

## **BRIQL Request Classes** <a href="#sparqlapifordch2-briqlrequestclasses" id="sparqlapifordch2-briqlrequestclasses"></a>

### **QueryInvocation** <a href="#sparqlapifordch2-queryinvocation" id="sparqlapifordch2-queryinvocation"></a>

This class is the request payload submitted to the BRIQL endpoint.

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>queryDef</td><td><strong>Query</strong> (nullable)</td><td>If set, this specifies a Query to be run. The query is implicitly a "select" query. This is mutually exclusive with both 'queryRef' and 'describe'.</td></tr><tr><td>describe</td><td><strong>NodeReference</strong> (nullable)</td><td>If set, the invocation's response will fully describe this node. The query is implicitly a "describe" query. This is mutually exclusive with both 'queryRef' and 'queryDef'.</td></tr><tr><td>models</td><td>List of <strong>ModelReference</strong></td><td>List of ModelReferences against which the query is to be run. This determines the models over which the Query in queryDef will execute.</td></tr><tr><td>limitNodeRefs</td><td>Map (nullable)<br>Keys: string<br>Values: <strong>NodeReference</strong> </td><td>Keys of this map refer to BRIQL variable names in the query. If used, values will be injected into the composed SPARQL query, in the form <code>VALUES (?varname) { (uri1) (uri2) etc}</code>, to fo</td></tr></tbody></table>

### **Query** <a href="#sparqlapifordch2-query" id="sparqlapifordch2-query"></a>

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>ref</td><td>string (nullable)</td><td>(Ignored in DCH2)</td></tr><tr><td>comment</td><td>string (nullable)</td><td>Optional string to describe query’s purpose</td></tr><tr><td>variables</td><td>List of <strong>QueryVar</strong></td><td>In select mode: list of variables used in the query Block.</td></tr><tr><td>query</td><td><strong>Block</strong></td><td>In select mode: the outermost block of the SPARQL SELECT query to be matched. When composed into SPARQL, triples and graph patterns derived from this block will follow triples derived from the query variables. </td></tr></tbody></table>

### &#x20;NodeReference <a href="#sparqlapifordch2-nodereference" id="sparqlapifordch2-nodereference"></a>

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>modelRef</td><td><strong>ModelReference</strong></td><td>Reference to a model (site or building) which contains the node.</td></tr><tr><td>nodeId</td><td>String (nullable)</td><td>If null: the NodeReference represents the model itself. Otherwise, the NodeReference represents the identified node within the model.</td></tr></tbody></table>

### ModelReference <a href="#sparqlapifordch2-modelreference" id="sparqlapifordch2-modelreference"></a>

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>orgId</td><td>string</td><td>ID of the organisation to which the model belongs</td></tr><tr><td>siteId</td><td>string (nullable)</td><td>Site models: ID of the site<br>Building models: ID of the site to which the building belongs</td></tr><tr><td>buildingId</td><td>string (nullable)</td><td>Building models only: ID of the building; unique within the site.</td></tr><tr><td>dataPoolId</td><td>String (nullable)</td><td>Data pool models only: ID of the data pool.</td></tr></tbody></table>

### NodeVar <a href="#sparqlapifordch2-nodevar" id="sparqlapifordch2-nodevar"></a>

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>name</td><td>string</td><td>Name of the variable. Unlike SPARQL, do not prefix with '$' or '?'.</td></tr><tr><td>comment</td><td>string (nullable)</td><td>Optional comment about variable’s purpose</td></tr><tr><td>output</td><td>boolean (nullable)</td><td>If set and true, this variable will be included in solutions.</td></tr><tr><td>nullable</td><td>boolean (nullable)</td><td>If set and true, then SPARQL generated for this NodeVar will be composed with <code>OPTIONAL{...}</code>, and solutions to the BRIQL query may be emitted with a 'null' in this variable's position.</td></tr><tr><td>constraints</td><td><strong>Block</strong> (nullable)</td><td>If set, apply this Block's triples as constraints on this QueryVar. This is necessary for nullable NodeVars (where all triples should be gathered in a single optional block / graph pattern), and a convenience for non-nullable NodeVars. </td></tr><tr><td>nested</td><td>List of NodeVar</td><td>Useful primarily for nullable (optional) variables: If set and non-empty, these QueryVars will have matching triples materialised inside the optional matching block of the enclosing variable. In other words, if variable X is nullable, and variable Y will only exist if X exists, then nest Y in X.</td></tr><tr><td>fetch</td><td>List of <strong>VarFields</strong> (nullable)</td><td>list of fields to fetch and return in results (if null/empty, default is just [id]). Required if 'output' is 'true'. If this list contains 'pointinfo', then 'fetchPoints' must be non-null and non-empty.</td></tr><tr><td>orgId</td><td>string (nullable)</td><td>If these fields are set in a query or invocation, compose a node URI to be bound to the variable.</td></tr><tr><td>siteId</td><td>string</td><td></td></tr><tr><td>buildingId</td><td>string (nullable)</td><td></td></tr><tr><td>nodeId</td><td>string (nullable)</td><td></td></tr><tr><td>brickTypes</td><td>List of <strong>MatchType</strong> (nullable)</td><td>If set, all non-null solutions for this NodeVar must match at least one of the listed MatchTypes.</td></tr><tr><td>nodeProperty</td><td>List of <strong>QueryEntityProperty</strong> (nullable)</td><td>If set, require that matched solution nodes will have all of these properties.</td></tr><tr><td>fetchPoints</td><td>List of <strong>MatchType</strong> (nullable)</td><td>If set, only return associated points that match at least one of the listed MatchTypes. This field is required to be set if the fetch field includes pointinfo.</td></tr><tr><td>filterOn</td><td>list of <strong>VarFields</strong> (nullable)</td><td>If set and filterString is set, then the filter string is applied to these fields.</td></tr><tr><td>filterString</td><td>string (nullable)</td><td>If set and filterOn is set, then fields listed in 'filterOn' will be filtered to require this string is present.</td></tr><tr><td>orderHint</td><td>List of NodeVarField</td><td><p>If set, this determines the order of triples in SPARQL emitted for this NodeVar. Values may be: "brickTypes", "nodeProperty," and/or "fetchPoints" (listed here in default order). One, two or all three may be specified. Any absent values will be assumed to follow specified values, in their default order. Any repetition of a previously given value is silently discarded. </p><p>The default ordering means that triples relating to 'brickTypes' for the node will be emitted first, followed by entity property related triples, followed by point matching triples. </p><p>Use of a different ordering may improve performance. For example, if it can be assumed that (in most models) the node's type is very common but the node's associated point types of interest are very rare, then matching "fetchPoint" before "brickTypes" will generally be faster.</p></td></tr></tbody></table>

### **QueryEntityProperty** <a href="#sparqlapifordch2-queryentityproperty" id="sparqlapifordch2-queryentityproperty"></a>

Exactly one of 'property' or 'key' fields must be set.&#x20;

Exactly one 'val' field (intval, numval, strval, urival, boolval) must be set.

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>property</td><td>Prefixed or IRI term (nullable)</td><td><p>The brick property. Most commonly this will be a prefix-form URI. JSON examples of prefixed and IRI forms are, respectively:</p><ul><li>{"prefixed":"brick:hasPart"}</li><li>{"iri":"https://brickschema.org/schema/Brick#hasPart"}</li></ul></td></tr><tr><td>key</td><td>string (nullable)</td><td><br></td></tr><tr><td>intval</td><td>integer (nullable)</td><td>An integer value to be matched for this property.</td></tr><tr><td>numval</td><td>double (nullable)</td><td>A numeric value to be matchedfor this property.</td></tr><tr><td>strval</td><td>string (nullable)</td><td>A string value to be matched for this property.</td></tr><tr><td>urival</td><td>string (nullable)</td><td>A URI value to be matched for this property.</td></tr><tr><td>boolval</td><td>boolean (nullable)</td><td>A boolean value to be matched for this property.</td></tr><tr><td>unit</td><td>Prefixed or IRI term (nullable)</td><td><p>A QUDT unit to be matched for this property. e.g.: </p><ul><li>{"prefixed":"unit:M2"}</li><li>{"iri":"http://qudt.org/vocab/unit/M2"}</li></ul></td></tr></tbody></table>

### VarFields <a href="#sparqlapifordch2-varfields" id="sparqlapifordch2-varfields"></a>

VarFields is an enumeration, represented in JSON with a string equal to one of the following. Members are case sensitive.

<table data-full-width="true"><thead><tr><th>String value</th><th>Meaning</th></tr></thead><tbody><tr><td>id</td><td>The ID of the node</td></tr><tr><td>type</td><td>The Brick type of the node</td></tr><tr><td>hypernym</td><td>The hypernym of the node’s type (I.e. Location, Equipment, Zone or Point)</td></tr><tr><td>pointInfo</td><td>The IDs and streams IDs of points attached to the node</td></tr><tr><td>streams</td><td>Streams IDs of points attached to the node</td></tr><tr><td>label</td><td>The label of the node</td></tr><tr><td>entityProperty</td><td>The entity property(ies) of the node</td></tr><tr><td>unit</td><td>The unit(s) of the node.</td></tr></tbody></table>

### MatchType <a href="#sparqlapifordch2-matchtype" id="sparqlapifordch2-matchtype"></a>

MatchType determines how NodeVars are matched.&#x20;

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>match</td><td>Match (nullable)</td><td><p>Specify the kind of match to perform on type field:</p><ul><li>isa (match this Brick type or its child types or equivalent types) [e.g. AHU and Air_Handler_Unit]</li><li>equals (match this Brick type exactly) </li><li>parent (match only child types of this type)</li><li>hypernym (match this hypernym)</li><li>equalsOrEquivalent (match this Brick type and its aliases)</li></ul><p><br></p></td></tr><tr><td>type</td><td>string (nullable)</td><td>Match this Brick type. Requires match is 'equals', 'hypernym', 'isa', or 'parent'. Mutually exclusive with tags. This field expects only the fragment component of the type’s URI without prefix or delimeters (eg “Room”, not “brick:Room”).</td></tr><tr><td>tags</td><td>List of string (nullable)</td><td>If set and match is “tags”, match any Brick type which has all of these tags</td></tr><tr><td>hasAllProperties</td><td>List of QueryEntityProperty (nullable)</td><td>If set and not empty, the matched node must fit all of these entity properties (in addition to matching by tag or class)</td></tr></tbody></table>

### Match <a href="#sparqlapifordch2-match" id="sparqlapifordch2-match"></a>

Match is an enumeration, represented in JSON with a string equal to one of the following case-sensitive values.&#x20;

Read this section in conjunction with the definitions of&#x20;

<table data-full-width="true"><thead><tr><th>String value</th><th>Meaning</th><th>In MatchType, use in conjunction with...</th></tr></thead><tbody><tr><td>isa</td><td><p>Match model nodes which have a type that matches the nominated type, ether: </p><ul><li>exactly,</li><li>as direct/indirect (transitive) sub-classes of the nominated type, or</li><li>as types which are 'equivalent'. </li></ul><p>For example:</p><ul><li>if type is 'AHU', also find nodes of type 'Air_Handling_Unit' and 'Air_Handler_Unit', which are equivalent types in Brick Schema.</li><li>If type is 'Equipment', also find nodes of type 'AHU', since 'AHU' is an transitive subclass of 'Equipment' in Brick Schema.</li></ul><p>SPARQL property path: <strong><code>rdf:type/(rdfs:subClassOf|owl:equivalentClass)*</code></strong></p></td><td>type</td></tr><tr><td>equals</td><td><p>Match model nodes that have the nominated Brick type <em><strong>exactly</strong></em> (regardless of <a href="https://www.w3.org/TR/owl-ref/#equivalentClass-def">owl:equivalentClass</a>). </p><p>SPARQL property path: <strong><code>rdf:type</code></strong></p></td><td>type</td></tr><tr><td>parent</td><td><p>Nominated type is the 'parent' type; match only model nodes that have a type that is a child classes of the parent type.</p><p>For example:</p><ul><li>If type is 'Room', then nodes of a more specialised type like 'Workshop' would be found, but not nodes of type 'Room'. </li></ul><p>SPARQL property path: <strong><code>rdf:type/rdfs:subClassOf+</code></strong></p></td><td>type</td></tr><tr><td>hypernym</td><td><p>For use where the type is one of the top-level hypernym types (Location, Point, Equipment, Zone), with simpler internal SPARQL. </p><p>SPARQL property path: <strong><code>rdf:type/brick:hyponymOf+</code></strong></p></td><td>type</td></tr><tr><td>equalsOrEquivalent</td><td><p>Streams IDs of points attached to the node</p><p>SPARQL property path: <strong><code>rdf:type/owl:equivalentClass?</code></strong></p></td><td>type</td></tr><tr><td>tags</td><td>Match nodes which have a type that is tagged with all of the nominated tags.</td><td>tags</td></tr></tbody></table>

### Block <a href="#sparqlapifordch2-block" id="sparqlapifordch2-block"></a>

At run time, queries attempt to find solutions that match a nested structure of query elements. The fundamental unit of a BRIQL query is the Block. Each block contains zero or more paths, and zero or more nested blocks. Internally, these are translated to SPARQL [**graph patterns**](https://www.w3.org/TR/sparql11-query/#GraphPattern) at query run time. Paths are converted to triples patterns first (in specified order), followed by conversion of blocks (again, in specified order).

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>comment</td><td>string</td><td>Comment about block’s purpose.</td></tr><tr><td>paths</td><td>List of <strong>PropertyPath</strong> (nullable)</td><td>If set, these all of these paths must all be matched. These paths will act as constraints on variables.</td></tr><tr><td>nested</td><td>List of <strong>Block</strong> (nullable)</td><td>If set, nest these Blocks inside this Block.</td></tr><tr><td>logic</td><td>string (nullable)</td><td>Either 'and' (assumed by default) or 'or', indicating the matching logic to be applied to the elements enclosed by this block (all match, or any match respectively). When translated to SPARQL, blocks with "logic"="or" will have their internal triples composed as a series of UNION graph patterns.</td></tr><tr><td>optional</td><td>boolean (nullable)</td><td>If set and true, this block’s constraints are matched <a href="https://www.w3.org/TR/sparql11-query/#optionals"><strong>optionally</strong></a>. Defaults to false. This allows matching without eliminating un-matched subgraphs from the query's solution. </td></tr><tr><td>types</td><td>List of NodeVariableTypeConstraint</td><td>If set, apply these type matches to the named variables, inside this Block's context (rather than in the variable's definition).</td></tr><tr><td>retain</td><td>string ("present", "absent")</td><td><p>If set, this block removes bindings from the solution set.</p><ul><li>'present' is equivalent to SPARQL's FILTER EXISTS{...} form.</li><li>'absent' is equivalent to SPARQL's FILTER NOT EXISTS{...} form.</li></ul><p>See <a href="https://www.w3.org/TR/sparql11-query/#neg-notexists-minus">https://www.w3.org/TR/sparql11-query/#neg-notexists-minus</a></p></td></tr></tbody></table>

### **NodeVariableTypeConstraint** <a href="#sparqlapifordch2-nodevariabletypeconstraint" id="sparqlapifordch2-nodevariabletypeconstraint"></a>

Used in 'types' list in Block instances to constrain a variable's type, in that Block's context.

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>name</td><td>string</td><td>Variable name</td></tr><tr><td>brickTypes</td><td>List of <strong>MatchType</strong></td><td>The named variable must match at least one of these MatchTypes.</td></tr></tbody></table>

### PropertyPath <a href="#sparqlapifordch2-propertypath" id="sparqlapifordch2-propertypath"></a>

A [**property path**](https://www.w3.org/TR/sparql11-query/#propertypaths) expresses a chain of edges between one model node and another. A property path matches one subject node, one or more predicates (properties), and an object node. &#x20;

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>fromRef</td><td>string</td><td>The SPARQL subject node (value must be the name of a variable in the query definition)</td></tr><tr><td>properties</td><td>Non-empty list of <strong>Property</strong></td><td>One or more Property, representing the chain of predicates between subject node and object node.</td></tr><tr><td>toRef</td><td>string</td><td>The SPARQL object node (value must be the name of a variable in the query definition).</td></tr></tbody></table>

### Property <a href="#sparqlapifordch2-property" id="sparqlapifordch2-property"></a>

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>property</td><td>string (nullable)</td><td>If set, this Property is the named Brick property (mutually exclusive with the variable and or field)</td></tr><tr><td>variable</td><td><p>string (nullable)</p><p> </p></td><td>If set, this Property is the named variable (mutually exclusive with the property and or field)</td></tr><tr><td>or</td><td>List of <strong>Property</strong> (nullable)</td><td>If set, this Property’s position in the matched property path may take any one of the named Brick Properties (mutually exclusive with the property and variable field)</td></tr><tr><td>min</td><td>null, 0 or 1</td><td><p>Min and max fields, if set, apply property path quantifiers to specify how many chained occurrences of this property are to be matched by the query.<br>min==0 → z<strong>ero or more</strong> occurrences. This is equivalent to SPARQL's ZeroOrMorePath ("*") <a href="https://www.w3.org/TR/sparql11-query/#pp-language"><strong>quantifier</strong></a>.</p><p>min==1 and max==null → <strong>at least one</strong> occurrence. This is equivalent to SPARQL's OneOrMorePath ("+") quantifier.</p><p>min==0 and max ==1 → <strong>either zero or one</strong> occurrence. This is equivalent to SPARQL's ZeroOrOne ("?") quantifier.</p><p>Other combinations are not supported at this time.</p></td></tr><tr><td>max</td><td>null, or 1</td><td><p>Min and max fields, if set, apply property path quantifiers to specify how many chained occurrences of this property are to be matched by the query.<br>min==0 → z<strong>ero or more</strong> occurrences. This is equivalent to SPARQL's ZeroOrMorePath ("*") <a href="https://www.w3.org/TR/sparql11-query/#pp-language"><strong>quantifier</strong></a>.</p><p>min==1 and max==null → <strong>at least one</strong> occurrence. This is equivalent to SPARQL's OneOrMorePath ("+") quantifier.</p><p>min==0 and max ==1 → <strong>either zero or one</strong> occurrence. This is equivalent to SPARQL's ZeroOrOne ("?") quantifier.</p><p>Other combinations are not supported at this time.</p></td></tr></tbody></table>

## Query response (for select queries) <a href="#sparqlapifordch2-queryresponse-forselectqueries" id="sparqlapifordch2-queryresponse-forselectqueries"></a>

When a BRIQL invocation is complete, a response is returned to the client.&#x20;

For a select query, the response is a QueryResponse object. This is serialised as JSON.

The 'solutionTable' list of a QueryResponse is a table-like structure where each row is a single solution to the query. Each 'column' contains references to an entry in solutionNodes.

The 'solutionNodes' map of a QueryResponse contains descriptions of nodes mentioned in the solutionTable.

### **QueryResponse** <a href="#sparqlapifordch2-queryresponse" id="sparqlapifordch2-queryresponse"></a>

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>models</td><td>List of <strong>ModelReference</strong></td><td>The models which were included in the query.</td></tr><tr><td>variableNames</td><td>list of string</td><td>Names of output variables.</td></tr><tr><td>solutionNodes</td><td>map of string to (map of string to <strong>ResponseValue</strong>)</td><td>Outer key: variable’s name<br>Inner key: node’s full URI<br>Inner value: a NodeValue describing the node</td></tr><tr><td>solutionTable</td><td>List of (map of string to <strong>NodeValueRef</strong>)</td><td><p>The outer list is a list of solutions (rows).</p><p>Each solution is a map of variable name to a ResponseValue.</p></td></tr></tbody></table>

### ResponseValue <a href="#sparqlapifordch2-responsevalue" id="sparqlapifordch2-responsevalue"></a>

ResponseValue may be either NullValue or NodeValue.

### NullValue <a href="#sparqlapifordch2-nullvalue" id="sparqlapifordch2-nullvalue"></a>

(Has no fields; represents an value that is not bound to anything in this solution, for this variable.)

### **NodeValueRef** <a href="#sparqlapifordch2-nodevalueref" id="sparqlapifordch2-nodevalueref"></a>

For use inside the solutionTable. This is a reference to an entry of solutionNodes.

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>fullId</td><td>string</td><td>The models which were included in the query.</td></tr></tbody></table>

### NodeValue <a href="#sparqlapifordch2-nodevalue" id="sparqlapifordch2-nodevalue"></a>

This represents node values bound to variables in solutions.

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>modelIndex</td><td>integer</td><td>The model to which the node belongs (an index into the list in the models field of the QueryResponse)</td></tr><tr><td>id</td><td>string</td><td>The ID (local to the model) of the node, if requested</td></tr><tr><td>type</td><td>string</td><td>The brick type of the node, if requested</td></tr><tr><td>hypernym</td><td>string</td><td>The hypernym of the node’s type (if requested)</td></tr><tr><td>pointinfo</td><td>List of <strong>PointInfo</strong></td><td>List of PointInfo instances (if requested and any exist)</td></tr><tr><td>streams</td><td>List of string</td><td>List of Seanaps stream IDs (if 'streams' was requested in fetch field). This is only useful if the requested node is a Point.</td></tr></tbody></table>

### PointInfo <a href="#sparqlapifordch2-pointinfo" id="sparqlapifordch2-pointinfo"></a>

This represents information about Points which are attached to a node.

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>type</td><td>string</td><td>The Brick type of the Point</td></tr><tr><td>point</td><td>string</td><td>The Point’s node ID</td></tr><tr><td>streams</td><td>List of string</td><td>The Senaps stream ID(s), if any, belonging to the Point</td></tr><tr><td>entityProperty</td><td>List of EntityPropertyFromQuery</td><td>The entity properties, if any, of the Point.</td></tr><tr><td>unit</td><td>string</td><td>The unit (a QUDT URI) of the Point, if it exists.</td></tr></tbody></table>

### **EntityPropertyFromQuery** <a href="#sparqlapifordch2-entitypropertyfromquery" id="sparqlapifordch2-entitypropertyfromquery"></a>

This represents entity properties.

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>property</td><td>string</td><td>The Brick property URI.</td></tr><tr><td>key</td><td>string</td><td>for brick:keyValue, this is the key of the key-value pair</td></tr><tr><td>value</td><td>string</td><td>for brick:keyValue, this is the key of the key-value pair</td></tr><tr><td>unit</td><td>string</td><td>for entity properties with an applied QUDT unit, this is the URI of the unit.</td></tr><tr><td>nested</td><td>List of <strong>EntityPropertyFromQuery</strong></td><td>Any entity properties nested within this one, for complex types.</td></tr></tbody></table>

## Query response (for describe queries) <a href="#sparqlapifordch2-queryresponse-fordescribequeries" id="sparqlapifordch2-queryresponse-fordescribequeries"></a>

A describe query is a request for all information about a single node (its metadata, and relationships to other adjacent nodes within the model graph). This means that the response to a describe query is different to that of a select query.

### **DescribeResponse** <a href="#sparqlapifordch2-describeresponse" id="sparqlapifordch2-describeresponse"></a>

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>node</td><td><strong>NodeReference</strong></td><td>The node which was described in the response (equal to 'describe' value in QueryInvocation).</td></tr><tr><td>type</td><td>string</td><td>The brick type of the described node.</td></tr><tr><td>hypernym</td><td>string</td><td>The hypernym (top level class) of the described node.</td></tr><tr><td>unit</td><td>string</td><td>The described node's unit as a QUDT URI (if it has one).</td></tr><tr><td>label</td><td>string (nullable)</td><td>The label of the described node, if it has one.</td></tr><tr><td>comment</td><td>string (nullable)</td><td>The comment of the described node, if it has one.</td></tr><tr><td>streamIds</td><td>List of string</td><td>If the described node is a Point, its senaps stream IDs will be set here.</td></tr><tr><td>properties</td><td>List of <strong>EntityPropertyFromQuery</strong></td><td>If the described node has entity properties, these are listed here.</td></tr><tr><td>relatedNodes</td><td>List of <strong>RelatedNode</strong></td><td>If the described node has any adjacent nodes, these are listed here.</td></tr></tbody></table>

### **RelatedNode** <a href="#sparqlapifordch2-relatednode" id="sparqlapifordch2-relatednode"></a>

<table data-full-width="true"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td>relationship</td><td>string</td><td>The Brick relationship (feeds, feedsAir, isFedBy, hasPart, isPartOf, hasPoint, isPointOf, hasLocation, isLocationOf, hasSubMeter, isSubMeterOf, meters, isMeteredBy) by which the described node is associated to the related node.</td></tr><tr><td>node</td><td><strong>NodeReference</strong></td><td>A reference to the related node.</td></tr><tr><td>type</td><td>string</td><td>The brick type of the related node.</td></tr><tr><td>hypernym</td><td>string</td><td>The hypernym (top level class) of therelated node.</td></tr><tr><td>unit</td><td>string</td><td>The related node's unit as a QUDT URI (if it has one).</td></tr><tr><td>label</td><td>string (nullable)</td><td>The label of the related node, if it has one.</td></tr><tr><td>comment</td><td>string (nullable)</td><td>The comment of the related node, if it has one.</td></tr><tr><td>streamIds</td><td>List of string</td><td>If the related node is a Point, its senaps stream IDs will be set here.</td></tr><tr><td>properties</td><td>List of <strong>EntityPropertyFromQuery</strong></td><td>If the related node has entity properties, these are listed here.</td></tr></tbody></table>
