Class BimApi
java.lang.Object
nl.bimbase.bimworks.client.apis.SubApi
nl.bimbase.bimworks.client.apis.BimApi
BIM related API calls, mostly different ways of querying the stored models.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne finding ofvalidateQuery(String): what the editor marks in a query that parses.static enumFile types oftableExport(BimApi.TableExportType, String, Set). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.node.ObjectNodegetObjectHistory(UUID versionUuid, int oid) 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.com.fasterxml.jackson.databind.node.ArrayNodelistBuildingStoreys(Set<UUID> versionUuids) List all the building storeys of the given modelscom.fasterxml.jackson.databind.node.ObjectNodeparseQuery(String query) Parse a BQL query into its AST without executing it (no credentials needed).com.fasterxml.jackson.databind.node.ArrayNodeExecute a query on the given modelscom.fasterxml.jackson.databind.node.ArrayNodeExecute a query on the given modelscom.fasterxml.jackson.databind.node.ArrayNodeExecute a stored query (by its UUID) on the given modelslongqueryCount(String query, Set<UUID> versionUuids) Number of objects a query matches, without fetching them.com.fasterxml.jackson.databind.node.ArrayNodeThe qids of the objects a query matches (what the viewer asks for to highlight a selection):Query2withonlyQids.nl.bimbase.bimworks.ResolvedActionsresolveBvl(String input, Set<UUID> versionUuids) Resolve a BIM.works Visualization Language (BVL), in developmentvoidsetDiscipline(UUID versionUuid, nl.bimbase.bimworks.common.actions.Discipline discipline) Set the discipline of the given modelvoidsetDisciplines(UUID versionUuid, List<nl.bimbase.bimworks.common.actions.Discipline> disciplines) Set the multi-label disciplines of the given model.tableExport(BimApi.TableExportType type, String query, Set<UUID> versionUuids) Query results as a table file.com.fasterxml.jackson.databind.node.ObjectNodetextSearch(String text, Set<UUID> versionUuids) Free-text search over property names and values (the search box), grouped per feature.booleanValidate a query without executing it.validateQuery(String query) Validate a query without executing it, with what the editor would mark in it.Methods inherited from class SubApi
getBimWorksClient
-
Constructor Details
-
BimApi
-
-
Method Details
-
query
public com.fasterxml.jackson.databind.node.ArrayNode query(String query, Set<UUID> versionUuids) throws BimWorksException, InterruptedException Execute a query on the given models- Parameters:
query- The query, serialized using the BQL formatversionUuids- 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
- Throws:
BimWorksExceptionInterruptedException
-
validate
Validate a query without executing it. A query that parses is accepted even when the validator has warnings about it;validateQuery(String)returns those.- Parameters:
query- The query, serialized using the BQL format- Returns:
- true when the server accepts the query, false when the server rejects the query
itself (a
BimWorksQueryErrorsuch as SYNTAX_ERROR) - Throws:
BimWorksException- on any other failure — authorization, transport, timeout. This method used to throw for invalid queries too, so it could only ever return trueInterruptedException
-
validateQuery
Validate a query without executing it, with what the editor would mark in it.- Parameters:
query- 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
- Throws:
BimWorksException- when the server rejects the query itself (aBimWorksQueryErrorsuch as SYNTAX_ERROR, whose message has the line and column), and on any other failure
-
resolveBvl
public nl.bimbase.bimworks.ResolvedActions resolveBvl(String input, Set<UUID> versionUuids) throws BimWorksException, InterruptedException Resolve a BIM.works Visualization Language (BVL), in development- Parameters:
input- The BVL source textversionUuids- Set of UUID representing the models/Versions to resolve against- Returns:
- The resolved actions, parsed from the server's wire form by
ResolvedActions.fromJson(ObjectNode) - Throws:
BimWorksExceptionInterruptedException
-
query
public com.fasterxml.jackson.databind.node.ArrayNode query(String query, UUID... versionUuids) throws BimWorksException, InterruptedException Execute a query on the given models- Parameters:
query- The query, serialized using the BQL formatversionUuids- 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
- Throws:
BimWorksExceptionInterruptedException
-
setDiscipline
public void setDiscipline(UUID versionUuid, nl.bimbase.bimworks.common.actions.Discipline discipline) throws BimWorksException Set the discipline of the given model- Parameters:
versionUuid- UUID of the Versiondiscipline- The discipline- Throws:
BimWorksException
-
setDisciplines
public void setDisciplines(UUID versionUuid, List<nl.bimbase.bimworks.common.actions.Discipline> disciplines) throws BimWorksException Set the multi-label disciplines of the given model. The first entry becomes the primary (the valuesetDiscipline(UUID, Discipline)sets); an empty list clears all discipline fields.- Parameters:
versionUuid- UUID of the Versiondisciplines- The disciplines, primary first- Throws:
BimWorksException
-
listBuildingStoreys
public com.fasterxml.jackson.databind.node.ArrayNode listBuildingStoreys(Set<UUID> versionUuids) throws InterruptedException, BimWorksException List all the building storeys of the given models- Parameters:
versionUuids-- Returns:
- Throws:
InterruptedExceptionBimWorksException
-
query
public com.fasterxml.jackson.databind.node.ArrayNode query(UUID queryUuid, Set<UUID> versionUuids) throws BimWorksException, InterruptedException Execute a stored query (by its UUID) on the given models- Parameters:
queryUuid- UUID of the stored queryversionUuids- 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
- Throws:
BimWorksExceptionInterruptedException
-
queryCount
Number of objects a query matches, without fetching them.- Throws:
BimWorksException
-
parseQuery
public com.fasterxml.jackson.databind.node.ObjectNode parseQuery(String query) throws BimWorksException Parse a BQL query into its AST without executing it (no credentials needed).- Throws:
BimWorksException
-
tableExport
public InputStream tableExport(BimApi.TableExportType type, String query, Set<UUID> versionUuids) throws BimWorksException Query results as a table file. The caller closes the stream.- Throws:
BimWorksException
-
textSearch
public com.fasterxml.jackson.databind.node.ObjectNode textSearch(String text, Set<UUID> versionUuids) throws BimWorksException Free-text search over property names and values (the search box), grouped per feature.- Returns:
{query, groups:[{matchedIn, kind, set, name, type, count, qids, qidsComplete}]}- Throws:
BimWorksException
-
getObjectHistory
public com.fasterxml.jackson.databind.node.ObjectNode getObjectHistory(UUID versionUuid, int oid) throws 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.- Throws:
BimWorksException
-
queryQids
public com.fasterxml.jackson.databind.node.ArrayNode queryQids(String query, Set<UUID> versionUuids) throws BimWorksException The qids of the objects a query matches (what the viewer asks for to highlight a selection):Query2withonlyQids. Rows carryqid("vid-oid") and, when selected,type.- Throws:
BimWorksException
-