Skip to main content

KAPPA-Automate IT Infrastructure

Multiwell Load Data Source Configuration

Multiwell load data source configuration defines how the external data service interprets and maps database tables, fields, and measurement units into the KAPPA-Automate data model. Each configuration is represented as a JSON object, which encapsulates all settings for the multiwell load data source. The name field defines a unique name identifying the data source. The description field provides a short summary of its purpose or function. The pluginId field specifies the identifier of the plugin or adapter responsible for interfacing with the external data source (SQL Server or Snowflake). The configuration field specifies the required parameters and connection settings essential for the plugin’s functionality.

{
"name": "KAPPA SQL Multiwell - SPE View",
"description": "Multiwell datasource for KAPPA SQL Schema",
"pluginId": "b459783e-bbfc-4355-9983-cb5ab6550e57",
"configuration": {...}
}

This section presents the standardized multiwell load configuration template for the KAPPA SQL schema:

Options

The Options section is a top-level map on the data source configuration. It exposes general flags that affect how the plugin interprets the external data. Keys are case-sensitive; values are not. Currently, only DefaultUnitSystem is defined. DefaultUnitSystem sets the unit system used for database values that carry no unit of their own. Accepted values are SI, OilField, Hydro, French, or the name of a custom unit system defined in KAPPA-Automate. When absent or blank, the plugin defaults to OilField.

The default unit system applies to gauge depths (Md, Tvd, Tvdss), to wellbore trajectory, casing, tubing, gas lifts, and perforations, and to the PVT reference temperature and reference pressure. It does not apply to gauge data, to well properties that carry an explicit unit, or to the content of PVT files.

{
  "Options": {
    "DefaultUnitSystem": "SI"
  }
}

Database version

The DatabaseVersion field on the data source configuration selects the version of the KAPPA SQL schema the plugin reads. It is an unquoted integer and defaults to 1.

The DatabaseVersion 1 is the default behaviour and matches the original schema. Every casing row on a given date is loaded into a single casing string (the root pipe), and every tubing row into a single tubing string, which is the only child of the casing. The wellbore_casing table is read without CasingSequence, IsOpenHole, or TopMd, and open-hole sections cannot be described. Casing and tubing rows are ordered by BottomMd. A missing Length is derived from the difference between successive BottomMd values, and the first section's length is derived from its BottomMd.

The DatabaseVersion 2 extends the wellbore_casing table with three new columns (CasingSequence, IsOpenHole, TopMd) and enables the plugin to load multiple nested casing strings and an explicit open hole section. It also activates the dynamic_meta depth columns (Md, Tvd, Tvdss). CasingSequence identifies the casing string a row belongs to; IsOpenHole marks the open hole row; and TopMd records the top measured depth of a section. Casing rows are grouped by CasingSequence and ordered from the lowest value outward to the highest inward. The first string becomes the root pipe, each later one becomes its child, and the tubing is the innermost child. Within each string, sections are ordered by BottomMd.

An open-hole section is one casing row with IsOpenHole set to true and becomes the outermost pipe, regardless of its CasingSequence. It is optional: a well cased to total depth leaves it out. A date is rejected and its wellbore skipped when casing rows mix numbered and NULL CasingSequence values, when there are more than 20 casing strings, when more than one open-hole row is defined, or when the open hole does not reach the bottomhole measured depth.

{
  "DatabaseVersion": 2,
}

Time zone management

The timeZoneManagement section declares the time zone of date columns that do not carry an offset (SQL Server DATETIME, Snowflake TIMESTAMP_NTZ). Without this section, zoneless dates are treated as UTC, which can shift the data by several hours when the source database stores local time. The section has three entries. The enable flag (default false) turns the conversion on.

The timeZoneInfoIdentifier names the zone the zone-less columns are in and is required when enable is true.

The enableDaylightSavingTime flag (default false) controls whether the declared zone honours daylight saving transitions. Set it to true for a source that records local wall-clock time; leave it false only for a fixed-offset source.

An additional top-level flag, wellboreDatesIgnoreTimeZone (default false), excludes wellbore geometry and perforation dates from the conversion. Set it to true only on a data source that already contains wellbore loads made before the time zone was declared, so that the existing dates are not shifted. Both Windows identifiers (for example Central Standard Time) and IANA identifiers (for example America/Chicago) are accepted. The Windows form is recommended. A zone-carrying column (DATETIMEOFFSET, TIMESTAMP_TZ) is left unchanged by this setting.

{
  "timeZoneManagement": {
    "enable": true,
    "timeZoneInfoIdentifier": "Central Standard Time",
    "enableDaylightSavingTime": true
  },
  "wellboreDatesIgnoreTimeZone": false
}

Database tables mapping

The table mappings section defines how the system connects to and interprets specific tables in the SQL database. It tells the plugin where to find well information, wellbore definitions, parameters, and dynamic data, and how to link these tables together using unique identifiers.  These mappings allow the system to connect static and dynamic data logically.  In the KAPPA SQL database, the wellTable acts as the central reference, while the other tables provide additional layers of information tied to each well. Each database table (wellTable, ParametersTable, dynamicMetaTable, dynamicTable, TrajectoryTable, WellboreFlowConditionsTable, WellboreTubingTable, WellboreCasingTable, PerforationsTable, PvtTable, PvtFilesTable) is structured as follows:

"wellTable": {   
    "schema": "dbo",   
    "table": "well",   
    "baseIdColumn": "WellId"
}

Mapping definitions

The mappingForDbParameterStrings section is responsible for translating unit and data type strings from an external SQL database into the KAPPA-Automate. This mapping ensures that physical quantities and data types are consistently interpreted within KAPPA-Automate, regardless of the naming conventions used in the data source. Unit strings from the external data source are mapped to KAPPA-Automates internal unit definitions. This ensures that measurements (e.g., pressure, temperature, or flow rate) are consistently recognized, even if the units are labeled differently in the data source (e.g., ‘psia’ vs. KAPPA-Automates internal ‘PressurePsiaUnit’). Data type mapping is required when the data type name in the data source does not match any built-in KAPPA-Automate data type. This is especially relevant for dynamic data. For example, the FLP (Flowline pressure gauge) data type is not defined in KAPPA-Automate. It can be mapped to a built-in KAPPA-Automate data type as P (pressure), or a custom data type can be created in KAPPA-Automate to match the source definition. If the data type in the source matches an existing KAPPA-Automate data type exactly, no mapping is required.

"mappingForDbParameterStrings": {    
    "ft": "LengthFeetUnit",    
    "psia": "PressurePsiagUnit",            
    "FLP": "P"
}

The mappingsToWellKnownProperty section defines the mapping of well properties between the data source and the built-in well properties in KAPPA-Automate. The mapping is based on matching the corresponding aliases defined in both the external SQL database and KAPPA-Automate.

"mappingsToWellKnownProperty": {            
    "InitialResPressure": { "Property": "MainResults_InitialPressure" }    
    "Porosity": { "Property": "MainResults_Porosity" }            
    "WbRadius": { "Property": "TestParameter_WellboreRadius" }
}

This MappingsToUserDefinedProperty section defines the mapping of well properties that are not present in the KAPPA-Automate well property catalog. For numeric data types, the unit of measurement must be specified; otherwise, the property will be imported as a ‘string’ type. Since these custom well properties are not defined in the KAPPA-Automate catalog, they will be created automatically using the same alias and name provided in the data source. However, if the user wants to change the name from the one used in the database to the one used in KAPPA-Automate, this can be done by adding a ‘Property’ entry here as well.

"MappingsToUserDefinedProperty": {    
    "Tvd": {"Property": "True Vertical Depth", "Measurement": "Depth" },            
    "BubblePointPressure": {"Measurement": "Pressure" },            
    "SepTemperature": {"Measurement": "Temperature" },            
    "WellSpacing": {"Measurement": "Length"},            
    "Reservoir": {}
}

The filterParameters section defines which parameters should be exposed as filters in the user interface (UI). Filters enable the selective import of specific wells by applying criteria based on available parameters. The order of entries determines the filtering behavior. There is no backend limit on the number of filter levels, but the UI and the REST API still render every defined filter as a single flat list, so deeply nested filters appear as one long dropdown. For instance, to import only wells from a designated reservoir within a certain geographic area, filters can be configured using 'State' and 'Reservoir' parameters. These filters are represented in the UI, where the tags displayed in the dropdown menu correspond to the active filter criteria.

"filterParameters": [ "State", "Reservoir" ]

The GroupingParameters section allows the configuration of parameters used to perform automatic well grouping. When a multiwell load is triggered, wells will be automatically grouped based on the specified parameter(s). As with filterParameters, the order of entries is significant and determines the grouping hierarchy. For example, if ‘well type’ is defined as the grouping criteria, the multiwell load will automatically create groups such as Oil Producers and Gas Producers.

"GroupingParameters": [ "WellProdType" ]

The mirroringDataSource declares which mirroring data sources the plugin uses to refresh gauge samples after ingestion. A multiwell load may now reference more than one mirroring data source (multimirror), so gauges of different types can be refreshed from different systems (for example, production rates from a KAPPA SQL database and pressure gauges from a PI historian).

Each entry describes one mirroring data source. The name is the data source name. The id references the mirroring data source configuration. The type identifies the schema of the referenced data source and is set to ‘KappaSql’ or ‘SQLType1’. The entry is omitted for mirroring data sources that are not KAPPA SQL or Type 1, such as PI or ADX. The datatypes list declares which gauge types are mirrored from this data source, and the values must be K-A type aliases, not the database type aliases used in dynamic_meta (database aliases are translated to K-A aliases through the mapping definitions when the dynamic property is built). The datatypes entry is optional when a single mirroring data source is declared.

The meta information for every gauge must be defined in the dynamic_meta table of the ingestion data source, even when the samples themselves live in another database or service. Tags must be consistent across the ingestion and mirroring data sources; for PI and ADX, tags must be the encoded form used by those systems. The selection of a mirroring data source for a given dynamic_meta entry is based on the data type. If two mirroring data sources declare the same data type, the plugin cannot distinguish between them, and a new data type must be created in the Field data model to separate the two sets of gauges.

To setup the mirroring data sources, ensure that the dynamic_meta table is populated correctly and the gauges expected from different data sources have unique data types, and a mirroring data source is available:

  • Check the data types needed by reviewing the dynamic_meta table.

  • Add any missing data types to the Field data model.

  • Configure the mirroring data source entry in the data source configuration. Do not include a type entry when the mirroring data source is PI or ADX.

"mirroringDataSources": [
      {
    "name":  "datasource1"
        "type": "SQLType1",
        "id" : "b6576186-8c9b-4b66-8d5e-0123456789ab",
        "datatypes": ["Qo", "Qg", "Qw"]
      },
      {
    "name":  "datasource2"
        "type": "KappaSql",
        "id" : "b6576186-8c9b-4b66-8d5e-0123456789ac",
        "datatypes": ["qo", "qg", "qw"]
      }
]

The connectionString is the string used to access the SQL Server database.

The complete JSON configuration structure for KAPPA SQL Schema.

{            
"name": "KAPPA SQL Multiwell - SPE View",    
"description": null,    
"configuration": {
    "DatabaseVersion": 2,    
    "mirroringDataSource": "79eb30ca-222a-469d-abd1-319c3548cb5e",
    "timeZoneManagement": {
       "enable": true,
       "timeZoneInfoIdentifier": "Central Standard Time",
       "enableDaylightSavingTime": true
    },
    "wellboreDatesIgnoreTimeZone": false,
    "wellTable": {        
        "schema": "dbo",        
        "table": "well",        
        "baseIdColumn": "WellId"      
},      
"ParametersTable": {        
    "schema": "dbo",        
    "table": "parameters",        
    "baseIdColumn": "WellId"      
},      
"dynamicTable": {        
    "schema": "dbo",        
    "table": "dynamic",        
    "baseIdColumn": "VectorId"      
},      
"dynamicMetaTable": {        
    "schema": "dbo",        
    "table": "dynamic_meta",        
    "baseIdColumn": "WellId"              
},              
"mappingForDbParameterStrings": {                
    "psia": "PressurePsiaUnit",                
    "STB/d": "RateStandardBarilPerDayUnit",                
},              
"mappingsToWellKnownProperty": {                
    "Name": {                          
        "Property": "Well_Name"                        
    }              
},              
"MappingsToUserDefinedProperty": {                
    "BubblePointPressure": {                          
        "Measurement": "Pressure"                        
    }      
}              
"filterParameters": [ "State", "Reservoir" ]              
"connectionString": "Server='Server','Port';Initial Catalog='DATABASE';User ID=USER;Password=*****;"              
}              
"pluginid": "b459783e-bbfc-4355-9983-cb5ab6550e57",              
"fileFormats": null              
}

Once the configuration is complete, it must be submitted to the appropriate KAPPA-Automate instance via a POST request to the MultiWellLoadDataSourceCommand endpoint.  The most convenient way to perform this POST request is through the ExternalData Swagger API interface, which provides a user-friendly way to interact with the API.

IMG-1.png

External Data Swagger API interface

IMG-3.png

Multiwell load data source - POST request