> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognite.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Parse GAP model revisions

> Learn how the GAP connector extracts information models from simulator model revisions including flowsheet hierarchy, equipment properties, and connections.

<Warning>
  The features described in this section are in [public preview](/cdf/product_feature_status#public-preview) and may change.
</Warning>

The GAP connector extracts the information model from GAP simulator model revisions. This feature parses the **flowsheet hierarchy** of GAP simulator model revisions, including **functional blocks**, such as process equipment, **block properties**, such as operating parameters, physical properties and configuration settings, **connections** between blocks, and **graphical information** for visualization processes.

The connector stores the parsed information in Cognite Data Fusion (CDF) alongside the associated simulator model revision.

## Enable model extraction

By default, model extraction is disabled. Enable the feature by adding the following to your `config.yml`:

```yaml theme={"languages":{"custom":["/_languages/kuiper.json","../_languages/kuiper.json"]}}
automation:
  information-model-extraction-enabled: true
```

## Prerequisites

Model parsing automatically activates when:

* A valid `modelparsing.config.yml` file exists in the connector's configuration directory.

* Connector configuration `automation.information-model-extraction-enabled` is set to `true`.

* A new simulator model revision is created or an existing model revision is reparsed.

* The GAP model contains a **single** flowsheet.

## Configure parsing

You configure the model parsing in a separate YAML file (`modelparsing.config.yml`) that defines which properties to extract from different equipment types.

Use `modelparsing.config.example.yml` for guidance.

### Configuration file structure

```yaml theme={"languages":{"custom":["/_languages/kuiper.json","../_languages/kuiper.json"]}}
# Common properties extracted from all equipment types
common-properties:
  - name: OilRate
    value-type: DOUBLE
    unit:
      quantity: Liquid Rate
    description: Oil rate from the network solver.
    address-suffix: .SolverResults[0].OilRate
  - name: WaterRate
    value-type: DOUBLE
    unit:
      quantity: Liquid Rate
    description: Water rate from the network solver.
    address-suffix: .SolverResults[0].WaterRate

# Equipment-specific properties
equipment-properties:
  - equipment: well
    properties:
      - name: WellModel
        value-type: STRING
        description: Type of well model used.
        address-suffix: .WellModel
      - name: TypeWell
        value-type: STRING
        description: Type of well.
        address-suffix: .TypeWell
  - equipment: pipe
    properties:
      - name: PipeModel
        value-type: STRING
        description: Type of pipeline model used.
        address-suffix: .PipeModel
      - name: PipeCorr
        value-type: STRING
        description: Type of pipeline correlation used.
        address-suffix: .PIPECORR
```

### Property configuration parameters

| Parameter          | Description                                                                                          | Required |
| ------------------ | ---------------------------------------------------------------------------------------------------- | -------- |
| **name**           | The display name for the property.                                                                   | Yes      |
| **value-type**     | The data type of the property. Supported values: `STRING`, `DOUBLE`, `STRING_ARRAY`, `DOUBLE_ARRAY`. | Yes      |
| **address-suffix** | The GAP address suffix to append to the equipment address to retrieve the property value.            | Yes      |
| **unit.quantity**  | The unit quantity associated with the property. Only relevant for numeric properties.                | No       |
| **description**    | A brief description of the property for documentation purposes.                                      | No       |

## Extract information

This is how the GAP connector extracts information from simulator model revisions:

<Steps>
  <Step title="Loads the model">
    When a simulator model revision is validated, the connector loads the GAP model.
  </Step>

  <Step title="Discovers equipment">
    The parser queries GAP to discover all equipment types and instances in the model.
  </Step>

  <Step title="Extracts properties">
    For each equipment instance, the parser:

    * Extracts common properties defined in the configuration.

    * Extracts equipment-specific properties based on the equipment type.

    * Retrieves unit information for numeric properties.
  </Step>

  <Step title="Generates edges">
    The parser analyzes equipment connections to generate edges representing material flows
  </Step>

  <Step title="Stores the information model">
    The complete information model is stored in CDF and associated with the simulator model revision.
  </Step>
</Steps>

## Access parsed information

When a simulator model revision has been parsed, use the simulator model revision endpoints to fetch the associated flowsheet data.

## Property extraction errors

During model parsing, the connector automatically skips any property where it fails to extract data to continue parsing. For example:

**Invalid address**

If the `address-suffix` contains a typo, for instance, `.SolverResults[0].OliuRate` instead of `.SolverResults[0].OilRate`, the property is skipped.

**Incorrect unit quantity**

If the specified `unit.quantity` doesn't match the property type, for instance, using `Temperature` for a pressure value, the property extraction fails and is skipped.

**Wrong value type**

If the `value-type` doesn't match the actual data type, for instance, specifying `DOUBLE` for a string property, the property is skipped and the connector logs details about the failed property extraction, continues processing remaining properties, and excludes the failed property from the final information model.

## Limitations and considerations

* Only GAP models with a **single flowsheet** are supported. The connector skips parsing for models with multiple flowsheets.

* Model parsing requires a **valid configuration file**.

* Model parsing **adds processing time** during model validation. The impact depends on model complexity.

* Not all properties may be available for all equipment types. Missing properties are logged and skipped.

* **Unit information** is retrieved when available, but may be missing for some properties.

* Individual property extraction failures don't stop the overall parsing process, but may result in incomplete information models.
