> For the complete documentation index, see [llms.txt](https://docs.dataclearinghouse.org/dch-2.0-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dataclearinghouse.org/dch-2.0-documentation/si-docs/dch-onboarding-brick-model-construction/generate_classifierset-operation.md).

# GENERATE\_CLASSIFIERSET Operation

This operation is used to add classes and properties to points in Datapools. This point classification can be done 100% online using the point [classifier interface of the Web-UI](/dch-2.0-documentation/si-docs/dch-onboarding-brick-model-construction/point-classifier-ui.md) to create a classifier set and subsequently apply it to a Datapool. However some onboarding teams may prefer to generate the classifier sets offline. This is supported by the model generation tooling through the GENERATE\_CLASSIFIERSET operation. Once a classifier set is created it can be uploaded via REST API, and applied to Datapool(s) either using the Web-UI or via REST API.

{% hint style="warning" %}
Note that multiple point\_class.csv files can be supplied to the manifest and that field is a list with square brackets.
{% endhint %}

{% code title="manifest.json" %}

```json
{
  "manifest_version": "1.0.0",
  "id_mapping": {
    "bld": "dch:org/myOrg/site/mySite/building/myBuilding#",
    "myDatapool": "dch:org/myOrg/datapool/managed_datapool_MyDataPool_12345678-9abc-def0-1234-56789abcdef0#"
  },
  "operations": [{
      "operation_type": "CREATE",
      "config": {
        "object_file": "objects.csv"
      }
    }, {
      "operation_type": "RELATE",
      "config": {
        "skeleton_file": "skeleton.csv"
      }
    }, {
      "operation_type": "POINT_CREATE_LINK_PATTERN_MATCH",
      "config": {
        "point_linkage_file": "point_linkage.csv",
        "point_list_files": ["point_list.csv"]
      }
    }, {
      "operation_type": "GENERATE_CLASSIFIERSET",
      "config": {
        "organisation": "myOrg",
        "point_class_files": ["point_class.csv"]
      }
    }]
}
```

{% endcode %}

All other CSVs in this example are from POINT\_CREATE\_LINK\_PATTERN\_MATCH example 4, but now we add a new `point_class.csv`. This CSV assigns classes to Points based on a pattern match on the end of the Point ID string.&#x20;

{% hint style="info" %}
For example, for classifying a Point with the ID `mySite.myBuilding.AHU_1.Enb`, the pattern Enb is matched to the class Enable\_Status.
{% endhint %}

The CSV has 2 primary columns:

1. `Point_Expression`: the field where you put the pattern you would like to match.
2. `Brick Class`: the BRICK class you would like to assign to any Point that has matched the value in Point\_Expression.

Entity Properties can also be declared in other columns to assign units, scale, offset and any other metadata as defined in BRICK. For this example, the `point_class.csv` looks like below:

{% hint style="warning" %}
Order of rows in the CSV is important as application of latter rules in a file can overwrite changes from earlier rows. In scenarios where similar patterns share an expression, the top level should be done first. E.g. Points with pattern "\*AHU1" are classed as brick:Enable and Points with "\*AHU1.Filter" are classed as brick:Status. "\*AHU1" should be declared at a higher row in the CSV:

AHU1,Enable

AHU1.Filter,Status

In contrast, by doing "AHU1.Filter" first, when the pattern "AHU1" is processed, the class for "AHU1.Filter" is overwritten to be brick:Enable, instead of brick:Status.
{% endhint %}

### Example

#### Inputs

<table data-full-width="false"><thead><tr><th width="169">Point_Expression</th><th width="281">Brick Class</th><th width="90">brick:hasUnit</th><th width="503">brick:scaleFactor [brick:scale, brick:offset]</th></tr></thead><tbody><tr><td>bom_gov_au.94870.air.air_temp</td><td>Outside_Air_Temperature_Sensor</td><td>DEG_C</td><td></td></tr><tr><td>5.DefVal</td><td>Temperature_Setpoint</td><td>DEG_C</td><td></td></tr><tr><td>AhrPbAct.In</td><td>Mode_Command</td><td></td><td></td></tr><tr><td>AhrPbAct.Out</td><td>Mode_Command</td><td></td><td></td></tr><tr><td>AhrPbAct.Reset</td><td>Reset_Command</td><td></td><td></td></tr><tr><td>Alm</td><td>Alarm</td><td></td><td></td></tr><tr><td>ClgVlv</td><td>Valve_Position_Sensor</td><td>PERCENT</td><td>[100,0]</td></tr><tr><td>EcoEnb</td><td>Operating_Mode_Status</td><td></td><td></td></tr><tr><td>Enb</td><td>Enable_Status</td><td></td><td></td></tr><tr><td>FilDpStp</td><td>Differential_Pressure_Setpoint</td><td>KiloPA</td><td></td></tr><tr><td>FiltDpr</td><td>Filter_Differential_Pressure_Sensor</td><td>KiloPA</td><td></td></tr><tr><td>HtgVlv</td><td>Valve_Position_Sensor</td><td>PERCENT</td><td>[100,0]</td></tr><tr><td>MaSatStp</td><td>Max_Discharge_Air_Temperature_Setpoint_Limit</td><td>DEG_C</td><td></td></tr><tr><td>MaxDmdEn</td><td>Operating_Mode_Status</td><td></td><td></td></tr><tr><td>MinSatStp</td><td>Min_Discharge_Air_Temperature_Setpoint_Limit</td><td>DEG_C</td><td></td></tr><tr><td>OaDmp</td><td>Damper_Position_Sensor</td><td>PERCENT</td><td></td></tr><tr><td>OatMaxSp</td><td>Outside_Air_Lockout_Temperature_Setpoint</td><td>DEG_C</td><td></td></tr><tr><td>OatMinSp</td><td>Low_Outside_Air_Temperature_Enable_Setpoint</td><td>DEG_C</td><td></td></tr><tr><td>OccClgSp</td><td>Cooling_Temperature_Setpoint</td><td>DEG_C</td><td></td></tr><tr><td>OccDb</td><td>Air_Temperature_Sensor</td><td>DEG_C</td><td></td></tr><tr><td>OccHtgSp</td><td>Heating_Temperature_Setpoint</td><td>DEG_C</td><td></td></tr><tr><td>Pb</td><td>Mode_Command</td><td></td><td></td></tr><tr><td>PosMinOa</td><td>Min_Position_Setpoint_Limit</td><td>PERCENT</td><td></td></tr><tr><td>RaDmp</td><td>Damper_Position_Sensor</td><td>PERCENT</td><td></td></tr><tr><td>RmSp</td><td>Room_Air_Temperature_Setpoint</td><td>DEG_C</td><td></td></tr><tr><td>Sat</td><td>Discharge_Air_Temperature_Sensor</td><td>DEG_C</td><td></td></tr><tr><td>Sts</td><td>System_Status</td><td></td><td></td></tr><tr><td>Tmp</td><td>Air_Temperature_Sensor</td><td>DEG_C</td><td></td></tr><tr><td>vOAT</td><td>Intake_Air_Temperature_Sensor</td><td>DEG_C</td><td></td></tr></tbody></table>

{% file src="/files/u6iRlbz8EboIl1DHj33P" %}
CLASSIFY Example 1: Full input archive
{% endfile %}

***

#### **Outputs**

Partial view of the output:

```json
{
    "name": "point_class_mgtool_2.0",
    "classifiers": [
        {
            "id": "a1b2c3d4-1234-1234-abcd-123456789abc",
            "enabled": true,
            "comment": "",
            "filterBy": {
                "id": {
                    "enabled": true,
                    "value": "*Pb"
                },
                "timeseriesId": {
                    "enabled": false
                },
                "class": {
                    "enabled": false,
                    "includeChildren": false
                },
                "label": {
                    "enabled": false
                },
                "entityProperties": {
                    "enabled": false
                },
                "entity": {
                    "enabled": false
                },
                "unit": {
                    "enabled": false
                }
            },
            "executeRules": {
                "class": {
                    "enabled": true,
                    "value": "brick:Mode_Command"
                },
                "entityProperties": {
                    "enabled": false,
                    "value": null
                },
                "label": {
                    "enabled": false
                },
                "entity": {
                    "enabled": false
                },
                "unit": {
                    "enabled": false,
                    "value": null
                }
            }
        },
        ...
```

This set can then be uploaded to DCH via this [endpoint](https://dataclearinghouse.org/api/aletheia/v1/swagger#/Classifier%20Set/post_classifiersets). You either continue the rest of the classification with the[ UI](/dch-2.0-documentation/si-docs/dch-onboarding-brick-model-construction/point-classifier-ui.md#using-previously-generated-and-saved-classifier-sets), or by using [REST API](#using-swagger-api-docs-to-finish-point-classification).

{% file src="/files/L0MLUhXuntaUc6sKHS4g" %}
CLASSIFY Example 1: Full output archive
{% endfile %}

### Using swagger API docs to finish point classification

Classification can be finished by using our[ API docs](https://dataclearinghouse.org/api/aletheia/v1/swagger#/).

**Step 1: authenticate**

1. [Generate an API key from DCH](/dch-2.0-documentation/walkthroughs/authenticating-with-dch-api.md).&#x20;
2. On the API docs page, press **Authorize**.&#x20;
3. Paste your API key in the **ApiKeyAuth (apiKey)** field.
4. Press **Authorize**.

<figure><img src="https://382380706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FffGApMA1vy23xdRjA7lY%2Fuploads%2F6bdj3jcLI3kkrHIUI0lf%2Fimage.png?alt=media&amp;token=8febb0d1-975e-4f12-8f95-39c1e27461fa" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
If you refresh the API docs page, your auth resets and you have to repeat this step again.
{% endhint %}

**Step 2: POST the generated classifier set**

{% hint style="danger" %}
Classifier Sets cannot be uploaded (unmodified) to DCH twice because the UUIDs of the individual classifiers need to be unique in DCH. If you wish to edit a Classifier Set and re-upload it you must update all the used UUIDs before reuploading it. Uploading a classifier set via the UI automatically updates UUIDs for you.
{% endhint %}

1. Scroll down to the **Classifier Set** section of the docs.
2. Press on "**POST**[**/classifiersets**](https://dataclearinghouse.org/api/aletheia/v1/swagger#/Classifier%20Set/post_classifiersets)".&#x20;
3. Click on **Try it out.**&#x20;
4. Copy and Paste the contents of your classifier set JSON in the **Request Body**.
5. Press **Execute**.
6. A response of 201 means this step was successfully executed. Copy the **id** field of the response (your set ID).

<figure><img src="https://382380706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FffGApMA1vy23xdRjA7lY%2Fuploads%2FjamS99o35to9hWx2se8q%2Fimage.png?alt=media&amp;token=09a8e429-2536-4842-9087-f5002b620edc" alt=""><figcaption></figcaption></figure>

**Step 3: POST classification plan**

{% hint style="info" %}
At this stage, you can move to the [UI](/dch-2.0-documentation/si-docs/dch-onboarding-brick-model-construction/point-classifier-ui.md#using-previously-generated-and-saved-classifier-sets) for steps 3 and 4, or you can continue with the API docs.
{% endhint %}

1. Scroll up to the **Classification Plan** section.
2. Press on **POST**[**/classificationplans**](https://dataclearinghouse.org/api/aletheia/v1/swagger#/Classification%20Plan/post_classificationplans)**.**
3. Click on **Try it out.**
4. Fill-in the request body
   1. Plan Scope is a list of datapools that are the target of this plan
   2. organisationId is the organisation where the datapool exists
   3. classifierSetId is the classifier set ID from step 2
5. Press **Execute**.
6. A response of 201 means this step was successfully executed. Copy the **id** field of the response again (your plan ID).

```json
{
  "planScope": [
    "my_datapool_id"
  ],
  "organisationId": "my_organisation_id",
  "classifierSetId": "my_classifier_set_id_from_step_2"
}
```

**Step 4: POST classification plan apply**

1. In the same section as step 3 (**Classification Plan**), press on \
   **POST**[**/classificationplans/{classification\_plan\_id}/apply**](https://dataclearinghouse.org/api/aletheia/v1/swagger#/Classification%20Plan/post_classificationplans__classification_plan_id__apply)
2. Click on **Try it out.**
3. Paste your plan ID from step 3
4. Press **Execute.**
