Skip to content

Physical Data Model

cognite.neat._session._physical.ReadPhysicalDataModel #

Read physical data model from various sources into NeatSession store.

yaml(io, format='neat') #

Read physical data model from YAML file(s)

Parameters:

Name Type Description Default
io Any

The file or directory path or buffer to read from.

required
format Literal['neat', 'toolkit']

The format of the input file(s). - "neat": Neat's DMS table format. - "toolkit": Cognite DMS API format which is the format used by Cognite Toolkit.

'neat'

json(io, format='neat') #

Read physical data model from JSON file(s)

Parameters:

Name Type Description Default
io Any

The file or directory path or buffer to read from.

required
format Literal['neat', 'toolkit']

The format of the input file(s). - "neat": Neat's DMS table format. - "toolkit": Cognite DMS API format which is the format used by Cognite Toolkit.

'neat'

excel(io) #

Read physical data model from Excel file

Parameters:

Name Type Description Default
io Any

The file path or buffer to read from.

required

cdf(space, external_id, version) #

Read physical data model from CDF

Parameters:

Name Type Description Default
space str

The schema space of the data model.

required
external_id str

The external id of the data model.

required
version str

The version of the data model.

required

cognite.neat._session._physical.WritePhysicalDataModel #

Write physical data model to various sources from NeatSession store.

yaml(io, format='neat') #

Write physical data model to YAML file

Parameters:

Name Type Description Default
io Any

The file path or buffer to write to.

required
format Literal['neat', 'toolkit']

The format of the output file - "neat": Neat's DMS table format. - "toolkit": Cognite DMS API format which is the format used by Cognite Toolkit.

'neat'

json(io, format='neat') #

Write physical data model to JSON file

Parameters:

Name Type Description Default
io Any

The file path or buffer to write to.

required
format Literal['neat', 'toolkit']

The format of the output file - "neat": Neat's DMS table format. - "toolkit": Cognite DMS API format which is the format used by Cognite Toolkit.

'neat'

excel(io, skip_other_spaces=True) #

Write physical data model to Excel file

Parameters:

Name Type Description Default
io Any

The file path or buffer to write to.

required
skip_other_spaces bool

If true, only properties in the same space as the data model will be written.

True

cdf(dry_run=True, rollback=False, drop_data=False) #

Write physical data model with views, containers, and spaces that are in the same space as the data model to CDF.

This method depends on the session governance profile for data modeling set when creating the NeatSession. - In 'additive' mode, only new or updates to data models/views/containers will be applied. You cannot remove views from data models, properties from views or containers, or indexes or constraints from containers. - In 'rebuild' mode, the data model in CDF will be made to exactly match the data model in Neat. If there are any breaking changes, Neat will delete and recreate the relevant data model/view/container. However, if drop_data is set to False, Neat will treat containers as 'additive' and will not delete any containers or remove properties, indexes, or constraints. To fully rebuild the data model, including containers, set drop_data to True.

Parameters:

Name Type Description Default
dry_run bool

If true, the changes will not be applied to CDF. Instead, Neat will report what changes would have been made.

True
rollback bool

If true, all changes will be rolled back if any error occurs.

False
drop_data bool

Only applicable if the session mode is 'rebuild'. If

False