Class BimApi

java.lang.Object
nl.bimbase.bimworks.client.apis.SubApi
nl.bimbase.bimworks.client.apis.BimApi

public class BimApi extends SubApi
BIM related API calls, mostly different ways of querying the stored models.
  • Constructor Details

  • 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 format
      versionUuids - 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:
      BimWorksException
      InterruptedException
    • validate

      public boolean validate(String query) throws BimWorksException, InterruptedException
      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 BimWorksQueryError such 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 true
      InterruptedException
    • validateQuery

      public List<BimApi.QueryValidationMessage> validateQuery(String query) throws BimWorksException
      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 (a BimWorksQueryError such 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 text
      versionUuids - 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:
      BimWorksException
      InterruptedException
    • 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 format
      versionUuids - 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:
      BimWorksException
      InterruptedException
    • 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 Version
      discipline - 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 value setDiscipline(UUID, Discipline) sets); an empty list clears all discipline fields.
      Parameters:
      versionUuid - UUID of the Version
      disciplines - 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:
      InterruptedException
      BimWorksException
    • 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 query
      versionUuids - 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:
      BimWorksException
      InterruptedException
    • queryCount

      public long queryCount(String query, Set<UUID> versionUuids) throws BimWorksException
      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): Query2 with onlyQids. Rows carry qid ("vid-oid") and, when selected, type.
      Throws:
      BimWorksException