Skip to main content

How it works

The upstream and downstream fields follow feeds relationships transitively, from a starting entity through the full chain of equipment, regardless of depth.
# Upstream: Zone ← VAV ← AHU ← Heat_Exchanger
zone(name: "Library") {
  fedBy { name type }
}

# Downstream: AHU → VAV → Zone
equipment(id: "TE01-XX-AHU-001") {
  downstream {
    name
    type
  }
}

Arguments

ArgumentTypeDefaultDescription
maxDepthIntunlimitedMaximum number of hops to traverse
mediumStringallFilter by distribution medium (AIR, CHILLED_WATER, HOT_WATER, CONDENSER_WATER)
isStringallFilter results to a specific Brick class (resolves subtypes)

Return type

Both upstream and downstream return [Equipment!]!, a flat list of equipment entities in traversal order (nearest first).

Examples

Basic upstream

{
  zone(name: "Library") {
    upstream {
      name
      type
    }
  }
}

With sensor data

{
  zone(name: "Library") {
    upstream {
      name
      type
      points(is: "Temperature_Sensor") {
        type
        currentValue { value timestamp }
      }
    }
  }
}

Filtered by medium

{
  equipment(id: "TE01-XX-AHU-001") {
    upstream(medium: "HOT_WATER") {
      name
      type
    }
  }
}

Filtered by type

{
  equipment(id: "TE01-XX-AHU-001") {
    downstream(is: "HVAC_Zone") {
      name
      type
    }
  }
}

Depth-limited

{
  zone(name: "Library") {
    upstream(maxDepth: 1) {
      name
      type
    }
  }
}

Equivalent SPARQL

The upstream field replaces this SPARQL pattern:
?zone ^brick:feeds+ ?equipment .
The downstream field replaces:
?equipment brick:feeds+ ?target .
Same traversal, expressed as declarative fields.