Reference·Java · nl.bimbase.bimworks.client.apisJava

BimApi

CLASS in nl.bimbase.bimworks.client.apis.

API catalogue · nl.bimbase.bimworks.client.apis · CLASS

Java#
public class BimApi

BIM related API calls, mostly different ways of querying the stored models.

Inheritance and interfaces#

Members#

Member Kind Description
BimApi(BimWorksClient) CONSTRUCTOR
setAliasKeys(boolean) METHOD Since 3.0 an AS alias only names its column: every value stays where it is without one ( attribute.Name AS n is still at attribute.Name), computed colu…
isAliasKeys() METHOD Whether the queries of this client put values under their aliases, as before 3.0 (#setAliasKeys)
query(String, Set<UUID>) METHOD Execute a query on the given models
validate(String) METHOD Validate a query without executing it. A query that parses is accepted even when the validator has warnings about it; #validateQuery returns those.
validateQuery(String) METHOD Validate a query without executing it, with what the editor would mark in it.
resolveBvl(String, Set<UUID>) METHOD Resolve a BIM.works Visualization Language (BVL), in development
query(String, UUID...) METHOD Execute a query on the given models
queryWithColumns(String, UUID...) METHOD Execute a query on the given models, and say where each GET item is in the records: {objects, columns}. Each entry of columns is one item with its `ali…
setDiscipline(UUID, Discipline) METHOD Set the discipline of the given model
setDisciplines(UUID, List<Discipline>) METHOD Set the multi-label disciplines of the given model. The first entry becomes the primary (the value #setDiscipline sets); an empty list clears all discipline …
listBuildingStoreys(Set<UUID>) METHOD List all the building storeys of the given models
query(UUID, Set<UUID>) METHOD Execute a stored query (by its UUID) on the given models
queryCount(String, Set<UUID>) METHOD Number of objects a query matches, without fetching them.
parseQuery(String) METHOD Parse a BQL query into its AST without executing it (no credentials needed).
tableExport(BimApi.TableExportType, String, Set<UUID>) METHOD Query results as a table file. The caller closes the stream.
textSearch(String, Set<UUID>) METHOD Free-text search over property names and values (the search box), grouped per feature.
getObjectHistory(UUID, int) METHOD The change history of one object in the oid lineage of the version: the transactions that made the version or one of its ancestors, back to the upload its oi…
queryQids(String, Set<UUID>) METHOD The qids of the objects a query matches (what the viewer asks for to highlight a selection): Query2 with onlyQids. Rows carry qid ("vid-oid") and, when…

BimApi(BimWorksClient)#

Java#
public BimApi(nl.bimbase.bimworks.client.BimWorksClient bimWorksClient)

Parameters#

Name Type Description
bimWorksClient BimWorksClient

setAliasKeys(boolean)#

Java#
public void setAliasKeys(boolean aliasKeys)

Since 3.0 an AS alias only names its column: every value stays where it is without one ( attribute.Name AS n is still at attribute.Name), computed columns are keyed by their text (COUNT, SUM(quantity.*.NetVolume)), and #queryWithColumns says where each GET item is. Code written against the placement of before, where an alias moved the value to a root key of that name, calls setAliasKeys(true) to keep it for every query of this client.

Parameters#

Name Type Description
aliasKeys boolean

isAliasKeys()#

Java#
public boolean isAliasKeys()

Whether the queries of this client put values under their aliases, as before 3.0 (#setAliasKeys)

query(String, Set<UUID>)#

Java#
public com.fasterxml.jackson.databind.node.ArrayNode query(java.lang.String query, java.util.Set<java.util.UUID> versionUuids) throws nl.bimbase.bimworks.client.BimWorksException, java.lang.InterruptedException

Execute a query on the given models

Parameters#

Name Type Description
query java.lang.String The query, serialized using the BQL format
versionUuids java.util.Set<java.util.UUID> Set of UUID representing the models/Versions to query

Returns#

An ArrayNode with the results. This is untyped because the shape of the results depend on the query

Exceptions#

  • BimWorksException —
  • InterruptedException —

validate(String)#

Java#
public boolean validate(java.lang.String query) throws nl.bimbase.bimworks.client.BimWorksException, java.lang.InterruptedException

Validate a query without executing it. A query that parses is accepted even when the validator has warnings about it; #validateQuery returns those.

Parameters#

Name Type Description
query java.lang.String The query, serialized using the BQL format

Returns#

true when the server accepts the query, false when the server rejects the query itself (a BimWorksQueryError such as SYNTAX_ERROR)

Exceptions#

  • BimWorksException — on any other failure — authorization, transport, timeout. This method used to throw for invalid queries too, so it could only ever return true
  • InterruptedException —

validateQuery(String)#

Java#
public java.util.List<nl.bimbase.bimworks.client.apis.BimApi.QueryValidationMessage> validateQuery(java.lang.String query) throws nl.bimbase.bimworks.client.BimWorksException

Validate a query without executing it, with what the editor would mark in it.

Parameters#

Name Type Description
query java.lang.String The query, serialized using the BQL format

Returns#

for a query that parses: the validator's warnings and errors (an IFC class in the wrong case, an unknown attribute, a regular expression that does not compile, ...) and a refusal such as FEATURE_NOT_VISIBLE; empty for a clean query

Exceptions#

  • BimWorksException — when the server rejects the query itself (a BimWorksQueryError such as SYNTAX_ERROR, whose message has the line and column), and on any other failure

resolveBvl(String, Set<UUID>)#

Java#
public nl.bimbase.bimworks.ResolvedActions resolveBvl(java.lang.String input, java.util.Set<java.util.UUID> versionUuids) throws nl.bimbase.bimworks.client.BimWorksException, java.lang.InterruptedException

Resolve a BIM.works Visualization Language (BVL), in development

Parameters#

Name Type Description
input java.lang.String The BVL source text
versionUuids java.util.Set<java.util.UUID> Set of UUID representing the models/Versions to resolve against

Returns#

The resolved actions, parsed from the server's wire form by ResolvedActions#fromJson

Exceptions#

  • BimWorksException —
  • InterruptedException —

query(String, UUID...)#

Java#
public com.fasterxml.jackson.databind.node.ArrayNode query(java.lang.String query, java.util.UUID... versionUuids) throws nl.bimbase.bimworks.client.BimWorksException, java.lang.InterruptedException

Execute a query on the given models

Parameters#

Name Type Description
query java.lang.String The query, serialized using the BQL format
versionUuids java.util.UUID... One or more UUID representing the models/Versions to query

Returns#

An ArrayNode with the results. This is untyped because the shape of the results depend on the query

Exceptions#

  • BimWorksException —
  • InterruptedException —

queryWithColumns(String, UUID...)#

Java#
public com.fasterxml.jackson.databind.node.ObjectNode queryWithColumns(java.lang.String query, java.util.UUID... versionUuids) throws nl.bimbase.bimworks.client.BimWorksException, java.lang.InterruptedException

Execute a query on the given models, and say where each GET item is in the records: {objects, columns}. Each entry of columns is one item with its alias, its BQL text (source), the header to show (label) and path, the keys from a record to its value (an array, because keys hold dots). Read a value by its alias by finding the column with that alias and following its path.

Parameters#

Name Type Description
query java.lang.String The query, serialized using the BQL format
versionUuids java.util.UUID... One or more UUID representing the models/Versions to query

Returns#

{"objects": [...], "columns": [...]}

setDiscipline(UUID, Discipline)#

Java#
public void setDiscipline(java.util.UUID versionUuid, nl.bimbase.bimworks.common.actions.Discipline discipline) throws nl.bimbase.bimworks.client.BimWorksException

Set the discipline of the given model

Parameters#

Name Type Description
versionUuid java.util.UUID UUID of the Version
discipline nl.bimbase.bimworks.common.actions.Discipline The discipline

Exceptions#

  • BimWorksException —

setDisciplines(UUID, List<Discipline>)#

Java#
public void setDisciplines(java.util.UUID versionUuid, java.util.List<nl.bimbase.bimworks.common.actions.Discipline> disciplines) throws nl.bimbase.bimworks.client.BimWorksException

Set the multi-label disciplines of the given model. The first entry becomes the primary (the value #setDiscipline sets); an empty list clears all discipline fields.

Parameters#

Name Type Description
versionUuid java.util.UUID UUID of the Version
disciplines java.util.List<nl.bimbase.bimworks.common.actions.Discipline> The disciplines, primary first

Exceptions#

  • BimWorksException —

listBuildingStoreys(Set<UUID>)#

Java#
public com.fasterxml.jackson.databind.node.ArrayNode listBuildingStoreys(java.util.Set<java.util.UUID> versionUuids) throws java.lang.InterruptedException, nl.bimbase.bimworks.client.BimWorksException

List all the building storeys of the given models

Parameters#

Name Type Description
versionUuids java.util.Set<java.util.UUID>

Exceptions#

  • InterruptedException —
  • BimWorksException —

query(UUID, Set<UUID>)#

Java#
public com.fasterxml.jackson.databind.node.ArrayNode query(java.util.UUID queryUuid, java.util.Set<java.util.UUID> versionUuids) throws nl.bimbase.bimworks.client.BimWorksException, java.lang.InterruptedException

Execute a stored query (by its UUID) on the given models

Parameters#

Name Type Description
queryUuid java.util.UUID UUID of the stored query
versionUuids java.util.Set<java.util.UUID> Set of UUID representing the models/Versions to query

Returns#

An ArrayNode with the results. This is untyped because the shape of the results depend on the query

Exceptions#

  • BimWorksException —
  • InterruptedException —

queryCount(String, Set<UUID>)#

Java#
public long queryCount(java.lang.String query, java.util.Set<java.util.UUID> versionUuids) throws nl.bimbase.bimworks.client.BimWorksException

Number of objects a query matches, without fetching them.

Parameters#

Name Type Description
query java.lang.String
versionUuids java.util.Set<java.util.UUID>

parseQuery(String)#

Java#
public com.fasterxml.jackson.databind.node.ObjectNode parseQuery(java.lang.String query) throws nl.bimbase.bimworks.client.BimWorksException

Parse a BQL query into its AST without executing it (no credentials needed).

Parameters#

Name Type Description
query java.lang.String

tableExport(BimApi.TableExportType, String, Set<UUID>)#

Java#
public java.io.InputStream tableExport(nl.bimbase.bimworks.client.apis.BimApi.TableExportType type, java.lang.String query, java.util.Set<java.util.UUID> versionUuids) throws nl.bimbase.bimworks.client.BimWorksException

Query results as a table file. The caller closes the stream.

Parameters#

Name Type Description
type BimApi.TableExportType
query java.lang.String
versionUuids java.util.Set<java.util.UUID>

textSearch(String, Set<UUID>)#

Java#
public com.fasterxml.jackson.databind.node.ObjectNode textSearch(java.lang.String text, java.util.Set<java.util.UUID> versionUuids) throws nl.bimbase.bimworks.client.BimWorksException

Free-text search over property names and values (the search box), grouped per feature.

Parameters#

Name Type Description
text java.lang.String
versionUuids java.util.Set<java.util.UUID>

Returns#

{query, groups:[{matchedIn, kind, set, name, type, count, qids, qidsComplete}]}

getObjectHistory(UUID, int)#

Java#
public com.fasterxml.jackson.databind.node.ObjectNode getObjectHistory(java.util.UUID versionUuid, int oid) throws nl.bimbase.bimworks.client.BimWorksException

The change history of one object in the oid lineage of the version: the transactions that made the version or one of its ancestors, back to the upload its oids come from.

Parameters#

Name Type Description
versionUuid java.util.UUID
oid int

queryQids(String, Set<UUID>)#

Java#
public com.fasterxml.jackson.databind.node.ArrayNode queryQids(java.lang.String query, java.util.Set<java.util.UUID> versionUuids) throws nl.bimbase.bimworks.client.BimWorksException

The qids of the objects a query matches (what the viewer asks for to highlight a selection): Query2 with onlyQids. Rows carry qid ("vid-oid") and, when selected, type.

Parameters#

Name Type Description
query java.lang.String
versionUuids java.util.Set<java.util.UUID>

Inherited members#

  • java.lang.Object#equals(java.lang.Object)
  • java.lang.Object#toString()
  • java.lang.Object#wait(long)
  • java.lang.Object#wait(long,int)
  • java.lang.Object#wait()
  • java.lang.Object#finalize()
  • java.lang.Object#getClass()
  • java.lang.Object#hashCode()
  • java.lang.Object#clone()
  • java.lang.Object#notify()
  • java.lang.Object#notifyAll()
  • getBimWorksClient()