---
title: IfcApi
summary: Java SDK: the IFC - Industry Foundation Classes operations, 21 methods, each with its parameters, result and a complete example.
order: 14
languages: [java]
sdk-package: Java SDK · nl.bimbase.bimworks.sdk
link-terms: true
---

# IfcApi

[[page:reference/sdk/java|Java SDK]] · `nl.bimbase.bimworks.sdk.api` · class · 21 methods

IFC related calls, for example queries and model checks

Construct it with the client of [[page:reference/sdk/java#connect|the connect step]]: `new IfcApi(client)`. Each method is one operation of the [[page:api|API part]], where it runs on its page.

<table class="dense">
<thead><tr><th>Method</th><th>Operation</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>[[page:reference/sdk/java/ifcapi#check|check]]</code></td><td>[[openapi:Check]]</td><td>Check one or more models</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#committransaction|commitTransaction]]</code></td><td>[[openapi:CommitTransaction]]</td><td>Commit a BUL transaction against the head Version of a Node, producing a new Version</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#comparemodels|compareModels]]</code></td><td>[[openapi:CompareModels]]</td><td>Compare two models with a BCOL definition</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#compareobjects|compareObjects]]</code></td><td>[[openapi:CompareObjects]]</td><td>Compare two chosen objects</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#deletecomparepairoverride|deleteComparePairOverride]]</code></td><td>[[openapi:DeleteComparePairOverride]]</td><td>Take a pair fixed by hand away again</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#exportcompareresult|exportCompareResult]]</code></td><td>[[openapi:ExportCompareResult]]</td><td>Download a stored compare result (deprecated, use GetCompareResult with a format)</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#getcomparebul|getCompareBul]]</code></td><td>[[openapi:GetCompareBul]]</td><td>The changes between two Versions as BUL</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#getcompareresult|getCompareResult]]</code></td><td>[[openapi:GetCompareResult]]</td><td>Read a stored compare result</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#getmatchcandidates|getMatchCandidates]]</code></td><td>[[openapi:GetMatchCandidates]]</td><td>The added objects that could be a removed object</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#getobjecthistory|getObjectHistory]]</code></td><td>[[openapi:GetObjectHistory]]</td><td>The change history of one object</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#getversionchanges|getVersionChanges]]</code></td><td>[[openapi:GetVersionChanges]]</td><td>What changed in Versions since the Versions before them</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#listbuildingstoreys|listBuildingStoreys]]</code></td><td>[[openapi:ListBuildingStoreys]]</td><td>The building storeys of one or more models</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#listcomparepairoverrides|listComparePairOverrides]]</code></td><td>[[openapi:ListComparePairOverrides]]</td><td>The pairs fixed by hand for two Versions</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#mapqids|mapQids]]</code></td><td>[[openapi:MapQids]]</td><td>Map objects of one Version to their counterparts in another</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#parsequery|parseQuery]]</code></td><td>[[openapi:ParseQuery]]</td><td>Parse a BQL query into its syntax tree</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#query|query]]</code></td><td>[[openapi:Query]]</td><td>Query one or more IFC models</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#recorduploadastransaction|recordUploadAsTransaction]]</code></td><td>[[openapi:RecordUploadAsTransaction]]</td><td>Replace an upload by a transaction with the same changes</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#resolvebvl|resolveBvl]]</code></td><td>[[openapi:ResolveBvl]]</td><td>Resolve a BVL script to what it shows, hides, selects and colours</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#setcomparepairoverride|setComparePairOverride]]</code></td><td>[[openapi:SetComparePairOverride]]</td><td>Fix a pair by hand for two Versions</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#textsearch|textSearch]]</code></td><td>[[openapi:TextSearch]]</td><td>Free-text search in models</td></tr>
<tr><td><code>[[page:reference/sdk/java/ifcapi#upgradesyntax|upgradeSyntax]]</code></td><td>[[openapi:UpgradeSyntax]]</td><td>Rewrite BQL, BVL and BCL written for 2.x in the 3.0 syntax</td></tr>
</tbody>
</table>

## `check` {#check}

```java
public CheckResultsResponse check(CheckRequest checkRequest) throws ApiException
```

Check one or more models. Checks one or more models against an IDS definition (XML), a BCL definition (BIM.works Checking Language) or a stored check action. Pass exactly one of `ids`, `bcl` and `action_uuid`. A stored action is an IDS or a BCL (CHECK3) action; running it needs read rights on it, not actions:read.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:Check]] · <code>POST /openapi/ifc/Check</code></td></tr>
<tr><th>Scope</th><td>[[scope:checks:run]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>checkRequest</code></td><td><code>[[page:reference/sdk/java/models#CheckRequest|CheckRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:Check]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#CheckResultsResponse|CheckResultsResponse]]</code> — The check results in the requested format

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.CheckRequest;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        CheckRequest request = client.getObjectMapper().readValue("""
                {
                  "models": [
                    {
                      "type": "VersionModelIdentifier",
                      "uuid": "BIM_WORKS_FIRST_MODEL"
                    }
                  ],
                  "ids": "<ids xmlns=\\"http://standards.buildingsmart.org/IDS\\">…</ids>"
                }
                """, CheckRequest.class);

        // 3. The call
        var result = new IfcApi(client).check(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `commitTransaction` {#committransaction}

```java
public CommitTransactionResult commitTransaction(CommitTransactionRequest commitTransactionRequest) throws ApiException
```

Commit a BUL transaction against the head Version of a Node, producing a new Version. Applies one or more BUL (BIM.works Update Language) statements to the given Version and creates a new Version on the same Node. The given Version must be the head (latest) Version of its Node: history is linear, and committing against an older Version fails with 409. The commit is atomic (either the complete new Version is created, or nothing is) and synchronous: the new Version is ready when the call returns.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:CommitTransaction]] · <code>POST /openapi/ifc/CommitTransaction</code></td></tr>
<tr><th>Scope</th><td>[[scope:model:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>commitTransactionRequest</code></td><td><code>[[page:reference/sdk/java/models#CommitTransactionRequest|CommitTransactionRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:CommitTransaction]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#CommitTransactionResult|CommitTransactionResult]]</code> — The transaction result. For a commit: <code>transaction</code> and <code>node</code>. For a dry run: <code>updates</code>, <code>is_head</code> and (only when the Version is not the head) <code>head_version</code>

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.CommitTransactionRequest;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        CommitTransactionRequest request = client.getObjectMapper().readValue("""
                {
                  "version_uuid": "BIM_WORKS_FIRST_MODEL",
                  "bul": [
                    "SET attribute.Name = \\"Standard door\\" WHERE type = IFCDOOR"
                  ],
                  "comment": "Normalize door names"
                }
                """, CommitTransactionRequest.class);

        // 3. The call
        var result = new IfcApi(client).commitTransaction(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `compareModels` {#comparemodels}

```java
public CompareResult compareModels(CompareModelsRequest compareModelsRequest) throws ApiException
```

Compare two models with a BCOL definition. Compares two models (usually two Versions of one Node, left the older one) and returns what was added, removed, changed and unchanged, by the categories of a BCOL (BIM.works Compare Language) definition: the built-in Default, another built-in definition, a stored compare action, or BCOL text.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:CompareModels]] · <code>POST /openapi/ifc/CompareModels</code></td></tr>
<tr><th>Scope</th><td>[[scope:query:run]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>compareModelsRequest</code></td><td><code>[[page:reference/sdk/java/models#CompareModelsRequest|CompareModelsRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:CompareModels]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#CompareResult|CompareResult]]</code> — The compare result, at the requested detail level

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.CompareModelsRequest;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        CompareModelsRequest request = client.getObjectMapper().readValue("""
                {
                  "left": {
                    "models": [
                      {
                        "type": "VersionModelIdentifier",
                        "uuid": "BIM_WORKS_FIRST_MODEL"
                      }
                    ]
                  },
                  "right": {
                    "models": [
                      {
                        "type": "VersionModelIdentifier",
                        "uuid": "BIM_WORKS_FIRST_MODEL"
                      }
                    ]
                  }
                }
                """, CompareModelsRequest.class);

        // 3. The call
        var result = new IfcApi(client).compareModels(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `compareObjects` {#compareobjects}

```java
public CompareObjectsResult compareObjects(CompareObjectsRequest compareObjectsRequest) throws ApiException
```

Compare two chosen objects. Compares two objects as one pair, whatever matching would say: of one model or of two. By default with the built-in `everything` definition. The answer says what differs (`changed_features` and `changes`, in the shape of a compare record) and what the definition watches.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:CompareObjects]] · <code>POST /openapi/ifc/CompareObjects</code></td></tr>
<tr><th>Scope</th><td>[[scope:query:run]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>compareObjectsRequest</code></td><td><code>[[page:reference/sdk/java/models#CompareObjectsRequest|CompareObjectsRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:CompareObjects]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#CompareObjectsResult|CompareObjectsResult]]</code> — What differs between the two objects

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.CompareObjectsRequest;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        CompareObjectsRequest request = client.getObjectMapper().readValue("""
                {
                  "left": "",
                  "right": "",
                  "bcol": "",
                  "definition": "everything"
                }
                """, CompareObjectsRequest.class);

        // 3. The call
        var result = new IfcApi(client).compareObjects(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `deleteComparePairOverride` {#deletecomparepairoverride}

```java
public ComparePairOverrides deleteComparePairOverride(DeleteComparePairOverrideRequest deleteComparePairOverrideRequest) throws ApiException
```

Take a pair fixed by hand away again. Needs read rights on both Versions and write rights on the right one.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:DeleteComparePairOverride]] · <code>POST /openapi/ifc/DeleteComparePairOverride</code></td></tr>
<tr><th>Scope</th><td>[[scope:model:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>deleteComparePairOverrideRequest</code></td><td><code>[[page:reference/sdk/java/models#DeleteComparePairOverrideRequest|DeleteComparePairOverrideRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:DeleteComparePairOverride]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#ComparePairOverrides|ComparePairOverrides]]</code> — What the two Versions still have

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.DeleteComparePairOverrideRequest;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        DeleteComparePairOverrideRequest request = client.getObjectMapper().readValue("""
                {
                  "uuid": "BIM_WORKS_FIRST_MODEL"
                }
                """, DeleteComparePairOverrideRequest.class);

        // 3. The call
        var result = new IfcApi(client).deleteComparePairOverride(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `exportCompareResult` {#exportcompareresult}

```java
public File exportCompareResult(ExportCompareResultRequest exportCompareResultRequest) throws ApiException
```

Download a stored compare result (deprecated, use GetCompareResult with a format). Deprecated: GetCompareResult with `format` (`document` for this operation's `json`) answers the same files, and a 202 with the status while the result is computed. This operation will be removed in a later release.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ExportCompareResult]] · <code>POST /openapi/ifc/ExportCompareResult</code></td></tr>
<tr><th>Scope</th><td>[[scope:query:run]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>exportCompareResultRequest</code></td><td><code>[[page:reference/sdk/java/models#ExportCompareResultRequest|ExportCompareResultRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:ExportCompareResult]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>File</code> — The file

### Example

```java
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.ExportCompareResultRequest;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        ExportCompareResultRequest request = client.getObjectMapper().readValue("""
                {
                  "result_uuid": "00000000-0000-0000-0000-000000000000",
                  "format": "xlsx",
                  "categories": [
                    ""
                  ]
                }
                """, ExportCompareResultRequest.class);

        // 3. The call
        var result = new IfcApi(client).exportCompareResult(request);

        // 4. The result
        Files.move(result.toPath(), Path.of("export-compare-result.bin"), StandardCopyOption.REPLACE_EXISTING);
    }
}
```

## `getCompareBul` {#getcomparebul}

```java
public CompareBul getCompareBul(GetCompareBulRequest getCompareBulRequest) throws ApiException
```

The changes between two Versions as BUL. The changes of a compare of two Versions written as BUL statements on the left Version, verified by a dry run of that Version, and the changes BUL cannot write, each with the reason. Values carry their IFC type (`IFCPOSITIVELENGTHMEASURE(1200 mm)`), moves and rotations become TRANSFORM statements, removed objects DELETE OBJECT; added objects, materials, relations and changed shapes are never BUL. The compare compares every value exactly and is stored like any other; the BUL is made once per compare result and kept with it. `record` says whether the right Version, an upload, can be replaced by a transaction with these changes (RecordUploadAsTransaction).

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:GetCompareBul]] · <code>POST /openapi/ifc/GetCompareBul</code></td></tr>
<tr><th>Scope</th><td>[[scope:query:run]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>getCompareBulRequest</code></td><td><code>[[page:reference/sdk/java/models#GetCompareBulRequest|GetCompareBulRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:GetCompareBul]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#CompareBul|CompareBul]]</code> — The statements, the residual, the coverage and whether the upload can be recorded

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.GetCompareBulRequest;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        GetCompareBulRequest request = client.getObjectMapper().readValue("""
                {
                  "left_version_uuid": "00000000-0000-0000-0000-000000000000",
                  "right_version_uuid": "00000000-0000-0000-0000-000000000000"
                }
                """, GetCompareBulRequest.class);

        // 3. The call
        var result = new IfcApi(client).getCompareBul(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `getCompareResult` {#getcompareresult}

```java
public CompareResult getCompareResult(GetCompareResultRequest getCompareResultRequest) throws ApiException
```

Read a stored compare result. Reads a result of CompareModels by its `result_uuid`, at a detail level and a page of its records, or its status while it is computed. Requires read access to both sides, and the same feature visibility as the caller that computed it (otherwise compare the models again).

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:GetCompareResult]] · <code>POST /openapi/ifc/GetCompareResult</code></td></tr>
<tr><th>Scope</th><td>[[scope:query:run]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>getCompareResultRequest</code></td><td><code>[[page:reference/sdk/java/models#GetCompareResultRequest|GetCompareResultRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:GetCompareResult]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#CompareResult|CompareResult]]</code> — The result in the requested format, or for format json its status while it is computed

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.GetCompareResultRequest;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        GetCompareResultRequest request = client.getObjectMapper().readValue("""
                {
                  "result_uuid": "4d1f2a3b-5c6d-4e7f-8a9b-0c1d2e3f4a5b",
                  "details": "changes",
                  "limit": 100
                }
                """, GetCompareResultRequest.class);

        // 3. The call
        var result = new IfcApi(client).getCompareResult(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `getMatchCandidates` {#getmatchcandidates}

```java
public MatchCandidates getMatchCandidates(GetMatchCandidatesRequest getMatchCandidatesRequest) throws ApiException
```

The added objects that could be a removed object. For the review of a stored compare's unmatched objects. Per removed object the added objects that could be it, best first by the geometric matcher's cost (the distance between the box centres, the size, the type, the name). Objects a user confirmed are listed apart.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:GetMatchCandidates]] · <code>POST /openapi/ifc/GetMatchCandidates</code></td></tr>
<tr><th>Scope</th><td>[[scope:query:run]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>getMatchCandidatesRequest</code></td><td><code>[[page:reference/sdk/java/models#GetMatchCandidatesRequest|GetMatchCandidatesRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:GetMatchCandidates]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#MatchCandidates|MatchCandidates]]</code> — The removed objects with their candidates, the added objects, and what was confirmed

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.GetMatchCandidatesRequest;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        GetMatchCandidatesRequest request = client.getObjectMapper().readValue("""
                {
                  "result_uuid": "00000000-0000-0000-0000-000000000000",
                  "left_oids": [
                    0
                  ],
                  "left_qids": [
                    ""
                  ],
                  "limit": 5,
                  "radius_mm": 10000
                }
                """, GetMatchCandidatesRequest.class);

        // 3. The call
        var result = new IfcApi(client).getMatchCandidates(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `getObjectHistory` {#getobjecthistory}

```java
public Map<String, Object> getObjectHistory(GetObjectHistoryRequest getObjectHistoryRequest) throws ApiException
```

The change history of one object. Every transaction that changed the object (by its oid) in the Node's line of Versions, newest first (as ListTransactions), with what it changed, and the Version the object first appeared in. `feature` limits it to one feature (`property.Pset_WallCommon.IsExternal`); `features_only` answers only the features that ever changed.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:GetObjectHistory]] · <code>POST /openapi/ifc/GetObjectHistory</code></td></tr>
<tr><th>Scope</th><td>[[scope:model:read]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>getObjectHistoryRequest</code></td><td><code>[[page:reference/sdk/java/models#GetObjectHistoryRequest|GetObjectHistoryRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:GetObjectHistory]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>Map&lt;String, Object&gt;</code> — The history

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.GetObjectHistoryRequest;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        GetObjectHistoryRequest request = client.getObjectMapper().readValue("""
                {
                  "model": {
                    "type": "UrlModelIdentifier"
                  },
                  "oid": 0,
                  "feature": "",
                  "features_only": false
                }
                """, GetObjectHistoryRequest.class);

        // 3. The call
        var result = new IfcApi(client).getObjectHistory(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `getVersionChanges` {#getversionchanges}

```java
public VersionChangesResult getVersionChanges(GetVersionChangesRequest getVersionChangesRequest) throws ApiException
```

What changed in Versions since the Versions before them. The counts of the built-in Default compare of each Version with the Version before it on its Node (the highest version number below it among the Node's live, processed IFC Versions): added, removed, changed, unchanged and ignored objects. New uploads are compared automatically when the server has `compare.auto_on_upload` on. A Version nothing compared yet is compared now, in the background (`pending`), unless `only_stored` asks for stored results only. Read the full result with GetCompareResult or map objects with MapQids.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:GetVersionChanges]] · <code>POST /openapi/ifc/GetVersionChanges</code></td></tr>
<tr><th>Scope</th><td>[[scope:query:run]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>getVersionChangesRequest</code></td><td><code>[[page:reference/sdk/java/models#GetVersionChangesRequest|GetVersionChangesRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:GetVersionChanges]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#VersionChangesResult|VersionChangesResult]]</code> — Per Version its changes; for a single version_uuid the fields of that Version are also at the top level

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.GetVersionChangesRequest;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        GetVersionChangesRequest request = client.getObjectMapper().readValue("""
                {
                  "version_uuid": "BIM_WORKS_FIRST_MODEL",
                  "version_uuids": [
                    "BIM_WORKS_FIRST_MODEL"
                  ],
                  "only_stored": false
                }
                """, GetVersionChangesRequest.class);

        // 3. The call
        var result = new IfcApi(client).getVersionChanges(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `listBuildingStoreys` {#listbuildingstoreys}

```java
public BuildingStoreys listBuildingStoreys(ListBuildingStoreysRequest listBuildingStoreysRequest) throws ApiException
```

The building storeys of one or more models. The storeys of the models merged by name, highest first, each with the objects on it; the objects without a storey come last, under "[No BS]". What a storey picker or a walk mode needs in one call.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ListBuildingStoreys]] · <code>POST /openapi/ifc/ListBuildingStoreys</code></td></tr>
<tr><th>Scope</th><td>[[scope:query:run]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>listBuildingStoreysRequest</code></td><td><code>[[page:reference/sdk/java/models#ListBuildingStoreysRequest|ListBuildingStoreysRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:ListBuildingStoreys]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#BuildingStoreys|BuildingStoreys]]</code> — The storeys

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.ListBuildingStoreysRequest;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        ListBuildingStoreysRequest request = client.getObjectMapper().readValue("""
                {
                  "models": [
                    {
                      "type": "UrlModelIdentifier"
                    }
                  ]
                }
                """, ListBuildingStoreysRequest.class);

        // 3. The call
        var result = new IfcApi(client).listBuildingStoreys(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `listComparePairOverrides` {#listcomparepairoverrides}

```java
public ComparePairOverrides listComparePairOverrides(ListComparePairOverridesRequest listComparePairOverridesRequest) throws ApiException
```

The pairs fixed by hand for two Versions. The objects a user linked as one object, and the objects a user confirmed as really removed or added. Every compare of the two Versions uses them. Needs read rights on both Versions.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ListComparePairOverrides]] · <code>POST /openapi/ifc/ListComparePairOverrides</code></td></tr>
<tr><th>Scope</th><td>[[scope:query:run]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>listComparePairOverridesRequest</code></td><td><code>[[page:reference/sdk/java/models#ListComparePairOverridesRequest|ListComparePairOverridesRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:ListComparePairOverrides]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#ComparePairOverrides|ComparePairOverrides]]</code> — The overrides, oldest first

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.ListComparePairOverridesRequest;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        ListComparePairOverridesRequest request = client.getObjectMapper().readValue("""
                {
                  "left_version_uuid": "00000000-0000-0000-0000-000000000000",
                  "right_version_uuid": "00000000-0000-0000-0000-000000000000"
                }
                """, ListComparePairOverridesRequest.class);

        // 3. The call
        var result = new IfcApi(client).listComparePairOverrides(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `mapQids` {#mapqids}

```java
public MapQidsResult mapQids(MapQidsRequest mapQidsRequest) throws ApiException
```

Map objects of one Version to their counterparts in another. The correspondence of a compare, for re-pointing stored object references after a new Version: every asked object of `from_version` with its counterpart in `to_version`, and the asked objects without one (added, removed, or outside the compare). Without `via` the built-in Default compare of the two Versions is used: a stored one in either direction (the automatic compare of an upload is one), else a new one.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:MapQids]] · <code>POST /openapi/ifc/MapQids</code></td></tr>
<tr><th>Scope</th><td>[[scope:query:run]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>mapQidsRequest</code></td><td><code>[[page:reference/sdk/java/models#MapQidsRequest|MapQidsRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:MapQids]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#MapQidsResult|MapQidsResult]]</code> — The pairs, aligned, and the unmatched objects

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;
import nl.bimbase.bimworks.sdk.model.MapQidsRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        MapQidsRequest request = client.getObjectMapper().readValue("""
                {
                  "from_version": "00000000-0000-0000-0000-000000000000",
                  "to_version": "00000000-0000-0000-0000-000000000000",
                  "qids": [
                    ""
                  ],
                  "oids": [
                    0
                  ],
                  "all": false,
                  "via": "00000000-0000-0000-0000-000000000000"
                }
                """, MapQidsRequest.class);

        // 3. The call
        var result = new IfcApi(client).mapQids(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `parseQuery` {#parsequery}

```java
public Map<String, Object> parseQuery(ParseQueryRequest parseQueryRequest) throws ApiException
```

Parse a BQL query into its syntax tree. The BQL query as its JSON syntax tree (the BQL JSON serialization, each node with a `__type`), with the `parameters` bound when given. A query that does not parse answers SYNTAX_ERROR with the line and column. No model is read.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ParseQuery]] · <code>POST /openapi/ifc/ParseQuery</code></td></tr>
<tr><th>Scope</th><td>any login</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>parseQueryRequest</code></td><td><code>[[page:reference/sdk/java/models#ParseQueryRequest|ParseQueryRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:ParseQuery]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>Map&lt;String, Object&gt;</code> — The syntax tree

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;
import nl.bimbase.bimworks.sdk.model.ParseQueryRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        ParseQueryRequest request = client.getObjectMapper().readValue("""
                {
                  "query": "",
                  "parameters": {}
                }
                """, ParseQueryRequest.class);

        // 3. The call
        var result = new IfcApi(client).parseQuery(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `query` {#query}

```java
public Object query(QueryRequest queryRequest) throws ApiException
```

Query one or more IFC models. Queries one or more models with BQL (BIM.works Query Language): the `query` text, or a stored query action by `action_uuid`. Running a stored query needs read rights on it, not actions:read.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:Query]] · <code>POST /openapi/ifc/Query</code></td></tr>
<tr><th>Scope</th><td>[[scope:query:run]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>queryRequest</code></td><td><code>[[page:reference/sdk/java/models#QueryRequest|QueryRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:Query]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>Object</code> — Query results in the requested format

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;
import nl.bimbase.bimworks.sdk.model.QueryRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        QueryRequest request = client.getObjectMapper().readValue("""
                {
                  "models": [
                    {
                      "type": "VersionModelIdentifier",
                      "name": "My model name",
                      "uuid": "BIM_WORKS_FIRST_MODEL"
                    }
                  ],
                  "query": "GET attribute.GlobalId, attribute.Name WHERE type = IFCWALL AND property.*.IsExternal = true"
                }
                """, QueryRequest.class);

        // 3. The call
        var result = new IfcApi(client).query(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `recordUploadAsTransaction` {#recorduploadastransaction}

```java
public RecordUploadAsTransactionResult recordUploadAsTransaction(RecordUploadAsTransactionRequest recordUploadAsTransactionRequest) throws ApiException
```

Replace an upload by a transaction with the same changes. Records an uploaded Version as a transaction on the Version before it: the BUL of GetCompareBul is committed on the previous Version, and the upload is deleted the way deleting the last Version does (a soft delete: its data stays). The new Version takes the upload's place and number, keeps the previous Version's object ids, and so keeps the history of every object and what refers to it. Only for the last Version of its Node, made by an upload, with a previous Version, when every change of the two is in the BUL (`record.possible` of GetCompareBul). Needs write rights on the Node and the user feature BUL (Model editing); without the feature the call answers 403 USER_FEATURE_REQUIRED.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:RecordUploadAsTransaction]] · <code>POST /openapi/ifc/RecordUploadAsTransaction</code></td></tr>
<tr><th>Scope</th><td>[[scope:model:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>recordUploadAsTransactionRequest</code></td><td><code>[[page:reference/sdk/java/models#RecordUploadAsTransactionRequest|RecordUploadAsTransactionRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:RecordUploadAsTransaction]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#RecordUploadAsTransactionResult|RecordUploadAsTransactionResult]]</code> — The committed transaction, the Node with its new Version, and the replaced upload

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;
import nl.bimbase.bimworks.sdk.model.RecordUploadAsTransactionRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        RecordUploadAsTransactionRequest request = client.getObjectMapper().readValue("""
                {
                  "version_uuid": "BIM_WORKS_FIRST_MODEL",
                  "comment": ""
                }
                """, RecordUploadAsTransactionRequest.class);

        // 3. The call
        var result = new IfcApi(client).recordUploadAsTransaction(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `resolveBvl` {#resolvebvl}

```java
public ResolvedActions resolveBvl(ResolveBvlRequest resolveBvlRequest) throws ApiException
```

Resolve a BVL script to what it shows, hides, selects and colours. Runs a BVL (BIM.works Visualisation Language) script against one or more models and returns its effect, ready for a viewer: the objects to show, hide, select and fit, the colour per object, the labels and the annotations. The server evaluates every condition of the script (each one is a BQL expression); the client only applies the answer, in the JavaScript SDK with `new BvlHelper(objectStateManager, viewer).processResults([answer])` of `@bimworks/viewercommon`.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ResolveBvl]] · <code>POST /openapi/ifc/ResolveBvl</code></td></tr>
<tr><th>Scope</th><td>[[scope:actions:read]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>resolveBvlRequest</code></td><td><code>[[page:reference/sdk/java/models#ResolveBvlRequest|ResolveBvlRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:ResolveBvl]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#ResolvedActions|ResolvedActions]]</code> — The resolved actions

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;
import nl.bimbase.bimworks.sdk.model.ResolveBvlRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        ResolveBvlRequest request = client.getObjectMapper().readValue("""
                {
                  "models": [
                    {
                      "type": "VersionModelIdentifier",
                      "uuid": "BIM_WORKS_FIRST_MODEL"
                    }
                  ],
                  "bvl": "if (type = IFCWALL AND property.*.IsExternal = true) { COLOR \\"red\\" VIEWFIT; }"
                }
                """, ResolveBvlRequest.class);

        // 3. The call
        var result = new IfcApi(client).resolveBvl(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `setComparePairOverride` {#setcomparepairoverride}

```java
public ComparePairOverrideSet setComparePairOverride(SetComparePairOverrideRequest setComparePairOverrideRequest) throws ApiException
```

Fix a pair by hand for two Versions. Links two objects as one object (the manual matcher pairs them before every other matcher), or confirms that an object really was removed or added (no matcher pairs it). Every compare of the two Versions uses it from then on; a stored result made before is computed again. An earlier override of either object is replaced. Needs read rights on both Versions and write rights on the right one.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:SetComparePairOverride]] · <code>POST /openapi/ifc/SetComparePairOverride</code></td></tr>
<tr><th>Scope</th><td>[[scope:model:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>setComparePairOverrideRequest</code></td><td><code>[[page:reference/sdk/java/models#SetComparePairOverrideRequest|SetComparePairOverrideRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:SetComparePairOverride]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#ComparePairOverrideSet|ComparePairOverrideSet]]</code> — The new override and every override of the two Versions

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;
import nl.bimbase.bimworks.sdk.model.SetComparePairOverrideRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        SetComparePairOverrideRequest request = client.getObjectMapper().readValue("""
                {
                  "left_version_uuid": "00000000-0000-0000-0000-000000000000",
                  "right_version_uuid": "00000000-0000-0000-0000-000000000000",
                  "kind": "pair",
                  "left_oid": 0,
                  "right_oid": 0,
                  "note": ""
                }
                """, SetComparePairOverrideRequest.class);

        // 3. The call
        var result = new IfcApi(client).setComparePairOverride(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `textSearch` {#textsearch}

```java
public TextSearchResult textSearch(TextSearchRequest textSearchRequest) throws ApiException
```

Free-text search in models. Searches the text of the models (names and values of attributes, properties, quantities, classifications, materials, layers) for words, not with BQL. Each group says where the text matched, how many objects match there and which (at most `max_qids_per_group`). A query that is a GlobalId (22 characters, or a UUID) also finds that object exactly, as a value match on the attribute GlobalId. Needs text indexing on the instance (features.text_indexing). Not available in a workspace whose filter limits the objects.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:TextSearch]] · <code>POST /openapi/ifc/TextSearch</code></td></tr>
<tr><th>Scope</th><td>[[scope:query:run]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>textSearchRequest</code></td><td><code>[[page:reference/sdk/java/models#TextSearchRequest|TextSearchRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:TextSearch]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#TextSearchResult|TextSearchResult]]</code> — The matches

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;
import nl.bimbase.bimworks.sdk.model.TextSearchRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        TextSearchRequest request = client.getObjectMapper().readValue("""
                {
                  "models": [
                    {
                      "type": "UrlModelIdentifier"
                    }
                  ],
                  "query": "",
                  "fuzzy": true,
                  "max_edits": 0,
                  "prefix": true,
                  "search_values": true,
                  "search_names": true,
                  "kind": "attribute",
                  "set": "",
                  "name": "",
                  "type": "",
                  "max_qids_per_group": 100
                }
                """, TextSearchRequest.class);

        // 3. The call
        var result = new IfcApi(client).textSearch(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `upgradeSyntax` {#upgradesyntax}

```java
public UpgradeSyntaxResponse upgradeSyntax(UpgradeSyntaxRequest upgradeSyntaxRequest) throws ApiException
```

Rewrite BQL, BVL and BCL written for 2.x in the 3.0 syntax. For BQL, BVL and BCL texts that a client keeps itself, written for BIM.works 2.x: each text that no longer parses in 3.0 because of a known syntax change comes back in the 3.0 syntax, with the changes made. The known changes are the unit clause (`IN mm` is `UNIT mm`), `CS LENGTH` (is `LENGTH`) and names that 3.0 reserves as keywords (quoted: `property.Dimensions."length"`, `AS "status"`). A text that parses already comes back as it is (`UNCHANGED`); a text with any other error comes back as it is too, with the 3.0 parser's message (`NOT_REWRITTEN`), also when it has known changes as well. Strings and comments are never changed. Up to 1000 texts per request, answered in the order they were sent. No model is read. A stored action needs no call: the instance rewrites its stored actions once, as new versions.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:UpgradeSyntax]] · <code>POST /openapi/ifc/UpgradeSyntax</code></td></tr>
<tr><th>Scope</th><td>any login</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>upgradeSyntaxRequest</code></td><td><code>[[page:reference/sdk/java/models#UpgradeSyntaxRequest|UpgradeSyntaxRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:UpgradeSyntax]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#UpgradeSyntaxResponse|UpgradeSyntaxResponse]]</code> — One result per input, in the order of the inputs

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.IfcApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;
import nl.bimbase.bimworks.sdk.model.UpgradeSyntaxRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        UpgradeSyntaxRequest request = client.getObjectMapper().readValue("""
                {
                  "inputs": [
                    {
                      "id": "wall-heights",
                      "language": "BQL",
                      "text": "GET qid, quantity.Qto_WallBaseQuantities.Height IN mm WHERE type = IFCWALL"
                    },
                    {
                      "id": "lengths",
                      "language": "BCL",
                      "text": "select (type = IFCWALL) { require property.Dimensions.length > 0; }"
                    }
                  ]
                }
                """, UpgradeSyntaxRequest.class);

        // 3. The call
        var result = new IfcApi(client).upgradeSyntax(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```
