Reference·JavaScript · @bimworks/jssdkJavaScript

QueryHelper

Class in @bimworks/jssdk.

API catalogue · @bimworks/jssdk · Class

TypeScript#
class QueryHelper

Builders and transformations for parsed BQL queries (the JSON form): the conditions the BIM.works UI creates when a feature is clicked, and helpers to adapt a query before it runs.

Members#

Member Kind Description
constructor Method
addFeatureIfNotExists Method
and Method
attributeExpression Method
augmentQueryForVisualization Method Adds what the viewers need to show the result (qids) to a query
buildingQidEqual Method Objects located in the building with this qid
buildingStoreyQidEqual Method Objects located on the building storey with this qid
calculatedEqual Method
classificationEqualIdentification Method
classificationEqualItemReference Method
classificationEqualLocation Method
classificationEqualName Method
classificationSystemFieldEqual Method Objects whose classification belongs to a classification system whose field (name, edition, source) equals the value
collectParameters Method The $name parameters of a parsed, unbound query, each once: kind is one of qids | in | types | range | range-from | range-to | number | scalar | string | l…
createCollectQid Method
createCountQid Method
createExpressionFromObject Method
createNameFeature Method
createQidFeature Method
expressionToBql Method A whole query with this expression as its WHERE
fromQids Method The BQL condition qid IN (...)
hasPropertySet Method Objects that have a property set with this name, whatever is in it
hasQuantitySet Method Objects that have a quantity set with this name, whatever is in it
isQuantityKey Method Whether a quantity figure name is a calculated quantity key
layerEqual Method
mapParameters Method Substitutes parameters in a parsed query; prefer sending query text with parameters
materialEqual Method
modelEquals Method
modelHeaderFeatureEquals Method
not Method
projectQidEqual Method Objects located in the project with this qid
propertyEqual Method
qidExpression Method
quantityEqual Method
quantityFigureQuery Method The BQL query that fetches one quantity figure of one object
removeAllAggregateFeatures Method Removes COUNT/COLLECT and other aggregates from a parsed query
representationItemEqual Method
representationTypeEqual Method
siteQidEqual Method Objects located on the site with this qid
systemNameEqual Method
toParameterValues Method A {name -> QidSet | array | scalar} map in the plain-JSON shape the server binds as parameters
typeAttributeExpression Method
typeCondition Method
typeObjectQidEqual Method Objects whose type object (IfcTypeObject) is the one with this qid
typePropertyEqual Method Objects whose type object has this property value
typeQuantityEqual Method Objects whose type object has this quantity value
zoneNameEqual Method

constructor#

TypeScript#
constructor()

addFeatureIfNotExists#

TypeScript#
static addFeatureIfNotExists(query: QueryNode, feature: QueryNode): void

Parameters#

Name Type Description
query QueryNode
feature QueryNode

and#

TypeScript#
static and(left: QueryNode | null, right: QueryNode | null): QueryNode

Parameters#

Name Type Description
left QueryNode | null
right QueryNode | null

attributeExpression#

TypeScript#
static attributeExpression(name: string, value: unknown, caseSensitive?: boolean): QueryNode

Parameters#

Name Type Description
name string
value unknown
caseSensitive boolean

augmentQueryForVisualization#

TypeScript#
static augmentQueryForVisualization(ast: QueryNode): QueryNode

Adds what the viewers need to show the result (qids) to a query

Parameters#

Name Type Description
ast QueryNode

buildingQidEqual#

TypeScript#
static buildingQidEqual(qid: string | Qid): QueryNode

Objects located in the building with this qid

Parameters#

Name Type Description
qid string | Qid

buildingStoreyQidEqual#

TypeScript#
static buildingStoreyQidEqual(qid: string | Qid): QueryNode

Objects located on the building storey with this qid

Parameters#

Name Type Description
qid string | Qid

calculatedEqual#

TypeScript#
static calculatedEqual(path: string, key: string, value: unknown): QueryNode

Parameters#

Name Type Description
path string
key string
value unknown

classificationEqualIdentification#

TypeScript#
static classificationEqualIdentification(identification: string): QueryNode

Parameters#

Name Type Description
identification string

classificationEqualItemReference#

TypeScript#
static classificationEqualItemReference(itemReference: string): QueryNode

Parameters#

Name Type Description
itemReference string

classificationEqualLocation#

TypeScript#
static classificationEqualLocation(location: string): QueryNode

Parameters#

Name Type Description
location string

classificationEqualName#

TypeScript#
static classificationEqualName(name: string): QueryNode

Parameters#

Name Type Description
name string

classificationSystemFieldEqual#

TypeScript#
static classificationSystemFieldEqual(field: string, value: string): QueryNode

Objects whose classification belongs to a classification system whose field (name, edition, source) equals the value

Parameters#

Name Type Description
field string
value string

collectParameters#

TypeScript#
static collectParameters(ast: QueryNode): ({ fromName?: string; kind: string; name?: string; toName?: string })[]

The $name parameters of a parsed, unbound query, each once: kind is one of qids | in | types | range | range-from | range-to | number | scalar | string | length; a BETWEEN with both bounds parameterized is one "range" entry with fromName and toName instead of name

Parameters#

Name Type Description
ast QueryNode

createCollectQid#

TypeScript#
static createCollectQid(): QueryNode

createCountQid#

TypeScript#
static createCountQid(): QueryNode

createExpressionFromObject#

TypeScript#
static createExpressionFromObject(object: object): QueryNode

Parameters#

Name Type Description
object object

createNameFeature#

TypeScript#
static createNameFeature(): QueryNode

createQidFeature#

TypeScript#
static createQidFeature(): QueryNode

expressionToBql#

TypeScript#
static expressionToBql(expression: QueryNode): QueryNode

A whole query with this expression as its WHERE

Parameters#

Name Type Description
expression QueryNode

fromQids#

TypeScript#
static fromQids(qids: (string | Qid)[]): string

The BQL condition qid IN (...)

Parameters#

Name Type Description
qids (string | Qid)[]

hasPropertySet#

TypeScript#
static hasPropertySet(name: string): QueryNode

Objects that have a property set with this name, whatever is in it

Parameters#

Name Type Description
name string

hasQuantitySet#

TypeScript#
static hasQuantitySet(name: string): QueryNode

Objects that have a quantity set with this name, whatever is in it

Parameters#

Name Type Description
name string

isQuantityKey#

TypeScript#
static isQuantityKey(name: string): boolean

Whether a quantity figure name is a calculated quantity key

Parameters#

Name Type Description
name string

layerEqual#

TypeScript#
static layerEqual(name: string): QueryNode

Parameters#

Name Type Description
name string

mapParameters#

TypeScript#
static mapParameters(ast: QueryNode, map: Record<string, unknown>): QueryNode

Substitutes parameters in a parsed query; prefer sending query text with parameters

Parameters#

Name Type Description
ast QueryNode
map Record<string, unknown>

materialEqual#

TypeScript#
static materialEqual(name: string): QueryNode

Parameters#

Name Type Description
name string

modelEquals#

TypeScript#
static modelEquals(name: string): QueryNode

Parameters#

Name Type Description
name string

modelHeaderFeatureEquals#

TypeScript#
static modelHeaderFeatureEquals(name: string, value: unknown): QueryNode

Parameters#

Name Type Description
name string
value unknown

not#

TypeScript#
static not(inner: QueryNode): QueryNode

Parameters#

Name Type Description
inner QueryNode

projectQidEqual#

TypeScript#
static projectQidEqual(qid: string | Qid): QueryNode

Objects located in the project with this qid

Parameters#

Name Type Description
qid string | Qid

propertyEqual#

TypeScript#
static propertyEqual(name: string, value: unknown, setName?: string): QueryNode

Parameters#

Name Type Description
name string
value unknown
setName string The property set, any set by default

qidExpression#

TypeScript#
static qidExpression(qid: string | Qid): QueryNode

Parameters#

Name Type Description
qid string | Qid

quantityEqual#

TypeScript#
static quantityEqual(name: string, value: unknown, setName?: string): QueryNode

Parameters#

Name Type Description
name string
value unknown
setName string The quantity set, any set by default

quantityFigureQuery#

TypeScript#
static quantityFigureQuery(qid: string | Qid, name: string): string

The BQL query that fetches one quantity figure of one object

Parameters#

Name Type Description
qid string | Qid
name string

removeAllAggregateFeatures#

TypeScript#
static removeAllAggregateFeatures(ast: QueryNode): void

Removes COUNT/COLLECT and other aggregates from a parsed query

Parameters#

Name Type Description
ast QueryNode

representationItemEqual#

TypeScript#
static representationItemEqual(entity: string): QueryNode

Parameters#

Name Type Description
entity string

representationTypeEqual#

TypeScript#
static representationTypeEqual(type: string): QueryNode

Parameters#

Name Type Description
type string

siteQidEqual#

TypeScript#
static siteQidEqual(qid: string | Qid): QueryNode

Objects located on the site with this qid

Parameters#

Name Type Description
qid string | Qid

systemNameEqual#

TypeScript#
static systemNameEqual(name: string): QueryNode

Parameters#

Name Type Description
name string

toParameterValues#

TypeScript#
static toParameterValues(map: Record<string, unknown>): Record<string, unknown>

A {name -> QidSet | array | scalar} map in the plain-JSON shape the server binds as parameters

Parameters#

Name Type Description
map Record<string, unknown>

typeAttributeExpression#

TypeScript#
static typeAttributeExpression(name: string, value: unknown, caseSensitive?: boolean): QueryNode

Parameters#

Name Type Description
name string
value unknown
caseSensitive boolean

typeCondition#

TypeScript#
static typeCondition(type: string): QueryNode

Parameters#

Name Type Description
type string

typeObjectQidEqual#

TypeScript#
static typeObjectQidEqual(qid: string | Qid): QueryNode

Objects whose type object (IfcTypeObject) is the one with this qid

Parameters#

Name Type Description
qid string | Qid

typePropertyEqual#

TypeScript#
static typePropertyEqual(name: string, value: unknown): QueryNode

Objects whose type object has this property value

Parameters#

Name Type Description
name string
value unknown

typeQuantityEqual#

TypeScript#
static typeQuantityEqual(name: string, value: unknown): QueryNode

Objects whose type object has this quantity value

Parameters#

Name Type Description
name string
value unknown

zoneNameEqual#

TypeScript#
static zoneNameEqual(name: string): QueryNode

Parameters#

Name Type Description
name string