Data Modeling

Data Models

Retrieve data models by id(s)

DataModelsAPI.retrieve(ids: DataModelIdentifier | Sequence[DataModelIdentifier]) → DataModelList

Retrieve data_model(s) by id(s).

Parameters:ids (DataModelId | Sequence[DataModelId]) – Data Model identifier(s).
Returns:Requested data_model or None if it does not exist.
Return type:Optional[DataModel]

Examples

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> res = c.data_modeling.data_models.retrieve(("mySpace", "myDataModel", "v1"))

List data models

DataModelsAPI.list(limit: int = 10, space: str | None = None, inline_views: bool = False, all_versions: bool = False, include_global: bool = False) → DataModelList

List data models

Parameters:
  • limit (int, optional) – Maximum number of data model to return. Default to 10. Set to -1, float(“inf”) or None to return all items.
  • space – (str | None): The space to query.
  • inline_views (bool) – Whether to expand the referenced views inline in the returned result.
  • all_versions (bool) – Whether to return all versions. If false, only the newest version is returned, which is determined based on the ‘createdTime’ field.
  • include_global (bool) – Whether to include global data models.
Returns:

List of requested data model

Return type:

DataModelList

Examples

List 5 data model:

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> data_model_list = c.data_modeling.data_models.list(limit=5)

Iterate over data model:

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> for data_model in c.data_modeling.data_models:
...     data_model # do something with the data_model

Iterate over chunks of data model to reduce memory load:

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> for data_model_list in c.data_modeling.data_models(chunk_size=10):
...     data_model_list # do something with the data model

Apply data models

DataModelsAPI.apply(data_model: DataModelApply | Sequence[DataModelApply]) → DataModel | DataModelList

Create or update one or more data model.

Parameters:(data_model (data_model) – DataModelApply | Sequence[DataModelApply]): DataModel or data model to create or update (upsert).
Returns:Created data_model(s)
Return type:DataModel | DataModelList

Examples

Create new data model:

>>> from cognite.client import CogniteClient
>>> import cognite.client.data_classes.data_modeling as models
>>> c = CogniteClient()
>>> data_models = [models.DataModel(space="mySpace",external_id="myDataModel",version="v1",is_global=,last_updated_time=),
... DataModel(space="mySpace",external_id="myOtherDataModel",version="v1",is_global=,last_updated_time=)]
>>> res = c.data_modeling.data_models.create(data_models)

Delete data models

DataModelsAPI.delete(ids: DataModelIdentifier | Sequence[DataModelIdentifier]) → list[VersionedDataModelingId]

Delete one or more data model

Parameters:ids (DataModelId | Sequence[DataModelId]) – Data Model identifier(s).
Returns:The data_model(s) which has been deleted. None if nothing was deleted.

Examples

Delete data model by id:

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> c.data_modeling.data_models.delete(("mySpace", "myDataModel", "v1"))

Data model data classes

class cognite.client.data_classes.data_modeling.data_models.DataModel(space: str, external_id: str, version: str, is_global: bool, last_updated_time: int, created_time: int, description: str = None, name: str = None, views: list[ViewId | View] = None, **_)

Bases: cognite.client.data_classes.data_modeling.data_models.DataModelCore

A group of views. This is the read version of a Data Model

Parameters:
  • space (str) – The workspace for the data model, a unique identifier for the space.
  • external_id (str) – Combined with the space is the unique identifier of the data model.
  • description (str) – Textual description of the data model
  • name (str) – Human readable name for the data model.
  • version (str) – DMS version.
  • views (list) – List of views included in this data model.
  • is_global (bool) – Whether this is a global data model.
  • last_updated_time (int) – The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.
  • created_time (int) – The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.
dump(camel_case: bool = False) → dict[str, Any]

Dump the instance into a json serializable Python data type.

Parameters:camel_case (bool) – Use camelCase for attribute names. Defaults to False.
Returns:A dictionary representation of the instance.
Return type:Dict[str, Any]
class cognite.client.data_classes.data_modeling.data_models.DataModelApply(space: str, external_id: str, version: str, description: str = None, name: str = None, views: list[ViewId | ViewApply] = None, **_)

Bases: cognite.client.data_classes.data_modeling.data_models.DataModelCore

A group of views. This is the write version of a Data Model.

Parameters:
  • space (str) – The workspace for the data model, a unique identifier for the space.
  • external_id (str) – Combined with the space is the unique identifier of the data model.
  • description (str) – Textual description of the data model
  • name (str) – Human readable name for the data model.
  • version (str) – DMS version.
  • views (list[ViewReference | ViewApply]) – List of views included in this data model.
dump(camel_case: bool = False) → dict[str, Any]

Dump the instance into a json serializable Python data type.

Parameters:camel_case (bool) – Use camelCase for attribute names. Defaults to False.
Returns:A dictionary representation of the instance.
Return type:Dict[str, Any]
class cognite.client.data_classes.data_modeling.data_models.DataModelApplyList(resources: Collection[Any], cognite_client: CogniteClient = None)

Bases: cognite.client.data_classes._base.CogniteResourceList

class cognite.client.data_classes.data_modeling.data_models.DataModelCore(space: str, external_id: str, version: str, description: Optional[str] = None, name: Optional[str] = None, **_)

Bases: cognite.client.data_classes.data_modeling._core.DataModelingResource

A group of views.

Parameters:
  • space (str) – The workspace for the data model, a unique identifier for the space.
  • external_id (str) – Combined with the space is the unique identifier of the data model.
  • description (str) – Textual description of the data model
  • name (str) – Human readable name for the data model.
  • version (str) – DMS version.
class cognite.client.data_classes.data_modeling.data_models.DataModelFilter(space: Optional[str] = None, inline_views: bool = False, all_versions: bool = False, include_global: bool = False)

Bases: cognite.client.data_classes._base.CogniteFilter

Represent the filer arguments for the list endpoint.

Parameters:
  • space (str | None) – The space to query
  • inline_views (bool) – Whether to expand the referenced views inline in the returned result.
  • all_versions (bool) – Whether to return all versions. If false, only the newest version is returned, which is determined based on the ‘createdTime’ field.
  • include_global (bool) – Whether to include global views.
class cognite.client.data_classes.data_modeling.data_models.DataModelList(resources: Collection[Any], cognite_client: CogniteClient = None)

Bases: cognite.client.data_classes._base.CogniteResourceList

Spaces

Retrieve a space by id

SpacesAPI.retrieve(space: str | Sequence[str]) → Space | SpaceList | None

Retrieve space by id.

Parameters:space (str) – Space ID
Returns:Requested space or None if it does not exist.
Return type:Optional[Space]

Examples

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> res = c.data_modeling.spaces.retrieve(space='mySpace')

Get multiple spaces by id:

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> res = c.data_modeling.spaces.retrieve(spaces=["MySpace", "MyAwesomeSpace", "MyOtherSpace"])

List spaces

SpacesAPI.list(limit: int = 25) → cognite.client.data_classes.data_modeling.spaces.SpaceList

List spaces

Parameters:limit (int, optional) – Maximum number of spaces to return. Defaults to 25. Set to -1, float(“inf”) or None to return all items.
Returns:List of requested spaces
Return type:SpaceList

Examples

List spaces and filter on max start time:

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> space_list = c.data_modeling.spaces.list(limit=5)

Iterate over spaces:

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> for space in c.data_modeling.spaces:
...     space # do something with the space

Iterate over chunks of spaces to reduce memory load:

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> for space_list in c.data_modeling.spaces(chunk_size=2500):
...     space_list # do something with the spaces

Apply spaces

SpacesAPI.apply(space: SpaceApply | Sequence[SpaceApply]) → Space | SpaceList

Create or patch one or more spaces.

Parameters:(space (space) – Space | Sequence[Space]): Space or spaces of spacesda to create or update.
Returns:Created space(s)
Return type:Space | SpaceList

Examples

Create new spaces:

>>> from cognite.client import CogniteClient
>>> from cognite.client.data_classes.data_modeling import SpaceApply
>>> c = CogniteClient()
>>> spaces = [SpaceApply(space="mySpace", description="My first space", name="My Space"),
... SpaceApply(space="myOtherSpace", description="My second space", name="My Other Space")]
>>> res = c.data_modeling.spaces.apply(spaces)

Delete spaces

SpacesAPI.delete(space: str | Sequence[str]) → list[str]

Delete one or more spaces

Parameters:space (str | Sequence[str]) – ID or ID list ids of spaces.
Returns:The space(s) which has been deleted.
Return type:list[str]

Examples

Delete spaces by id:

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> c.data_modeling.spaces.delete(space=["mySpace", "myOtherSpace"])

Data classes

class cognite.client.data_classes.data_modeling.spaces.Space(space: str, is_global: bool, last_updated_time: int, created_time: int, description: Optional[str] = None, name: Optional[str] = None)

Bases: cognite.client.data_classes.data_modeling.spaces.SpaceCore

A workspace for data models and instances. This is the read version.

Parameters:
  • space (str) – a unique identifier for the space.
  • description (str) – Textual description of the space
  • name (str) – Human readable name for the space.
  • is_global (bool) – Whether the space is global or not.
  • last_updated_time (int) – The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.
  • created_time (int) – The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.
class cognite.client.data_classes.data_modeling.spaces.SpaceApply(space: str, description: Optional[str] = None, name: Optional[str] = None, **_)

Bases: cognite.client.data_classes.data_modeling.spaces.SpaceCore

A workspace for data models and instances. This is the write version

class cognite.client.data_classes.data_modeling.spaces.SpaceApplyList(resources: Collection[Any], cognite_client: CogniteClient = None)

Bases: cognite.client.data_classes._base.CogniteResourceList

class cognite.client.data_classes.data_modeling.spaces.SpaceCore(space: str, description: Optional[str] = None, name: Optional[str] = None, **_)

Bases: cognite.client.data_classes.data_modeling._core.DataModelingResource

A workspace for data models and instances.

Parameters:
  • space (str) – A unique identifier for space.
  • description (str) – Textual description of the space
  • name (str) – Human readable name for the space.
class cognite.client.data_classes.data_modeling.spaces.SpaceList(resources: Collection[Any], cognite_client: CogniteClient = None)

Bases: cognite.client.data_classes._base.CogniteResourceList

Views

Retrieve views by id(s)

ViewsAPI.retrieve(ids: ViewIdentifier | Sequence[ViewIdentifier]) → ViewList

Retrieve a single view by id.

Parameters:ids (ViewId | Sequence[ViewId]) – View dentifier(s)
Returns:Requested view or None if it does not exist.
Return type:Optional[View]

Examples

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> res = c.data_modeling.views.retrieve(('mySpace', 'myView', 'v1'))

List views

ViewsAPI.list(limit: int = 10, space: str | None = None, include_inherited_properties: bool = True, all_versions: bool = False, include_global: bool = False) → ViewList

List views

Parameters:
  • limit (int, optional) – Maximum number of views to return. Defaults to 25. Set to -1, float(“inf”) or None to return all items.
  • space – (str | None): The space to query.
  • include_inherited_properties (bool) – Whether to include properties inherited from views this view implements.
  • all_versions (bool) – Whether to return all versions. If false, only the newest version is returned, which is determined based on the ‘createdTime’ field.
  • include_global (bool) – Whether to include global views.
Returns:

List of requested views

Return type:

ViewList

Examples

List 5 views:

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> view_list = c.data_modeling.views.list(limit=5)

Iterate over views:

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> for view in c.data_modeling.views:
...     view # do something with the view

Iterate over chunks of views to reduce memory load:

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> for view_list in c.data_modeling.views(chunk_size=10):
...     view_list # do something with the views

Apply view

ViewsAPI.apply(view: ViewApply | Sequence[ViewApply]) → View | ViewList

Create or update (upsert) one or more views.

Parameters:(view (view) – ViewApply | Sequence[ViewApply]): View or views of views to create or update.
Returns:Created view(s)
Return type:View | ViewList

Examples

Create new views:

>>> from cognite.client import CogniteClient
>>> import cognite.client.data_classes.data_modeling as models
>>> c = CogniteClient()
>>> views = [models.View(space="mySpace",external_id="myView",version="v1"),
... models.View(space="mySpace",external_id="myOtherView",version="v1")]
>>> res = c.data_modeling.views.create(views)

Delete views

ViewsAPI.delete(ids: ViewIdentifier | Sequence[ViewIdentifier]) → list[VersionedDataModelingId]

Delete one or more views

Parameters:ids (ViewId | Sequence[ViewId]) – View dentifier(s)
Returns:The identifier for the view(s) which has been deleted. Empty list if nothing was deleted.

Examples

Delete views by id:

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> c.data_modeling.views.delete(('mySpace', 'myView', 'v1'))

View data classes

class cognite.client.data_classes.data_modeling.views.ConnectionDefinition

Bases: cognite.client.data_classes.data_modeling.views.ViewPropertyDefinition

class cognite.client.data_classes.data_modeling.views.MappedApplyPropertyDefinition(container: 'ContainerId', container_property_identifier: 'str', name: 'str | None' = None, description: 'str | None' = None, source: 'ViewId | None' = None)

Bases: cognite.client.data_classes.data_modeling.views.MappedCorePropertyDefinition

class cognite.client.data_classes.data_modeling.views.MappedCorePropertyDefinition(container: 'ContainerId', container_property_identifier: 'str', name: 'str | None' = None, description: 'str | None' = None)

Bases: cognite.client.data_classes.data_modeling.views.ViewPropertyDefinition

class cognite.client.data_classes.data_modeling.views.MappedPropertyDefinition(container: 'ContainerId', container_property_identifier: 'str', name: 'str | None' = None, description: 'str | None' = None, type: 'PropertyType | None' = None, nullable: 'bool' = True, auto_increment: 'bool' = False, default_value: 'str | int | dict | None' = None)

Bases: cognite.client.data_classes.data_modeling.views.MappedCorePropertyDefinition

class cognite.client.data_classes.data_modeling.views.SingleHopConnectionDefinition(type: 'DirectRelationReference', source: 'ViewId', name: 'str | None' = None, description: 'str | None' = None, edge_source: 'ViewId | None' = None, direction: "Literal[('outwards', 'inwards')]" = 'outwards')

Bases: cognite.client.data_classes.data_modeling.views.ConnectionDefinition

class cognite.client.data_classes.data_modeling.views.View(space: str, external_id: str, version: str, properties: dict[str, MappedPropertyDefinition | ConnectionDefinition], last_updated_time: int, created_time: int, description: str = None, name: str = None, filter: Filter | None = None, implements: list[ViewId] = None, writable: bool = False, used_for: Literal[('node', 'edge', 'all')] = 'node', is_global: bool = False, **_)

Bases: cognite.client.data_classes.data_modeling.views.ViewCore

A group of properties. Read only version.

Parameters:
  • space (str) – The workspace for the view, a unique identifier for the space.
  • external_id (str) – Combined with the space is the unique identifier of the view.
  • description (str) – Textual description of the view
  • name (str) – Human readable name for the view.
  • filter (dict) – A filter Domain Specific Language (DSL) used to create advanced filter queries.
  • implements (list) – References to the views from where this view will inherit properties and edges.
  • version (str) – DMS version.
  • writable (bool) – Whether the view supports write operations.
  • used_for (Literal["node", "edge", "all"]) – Does this view apply to nodes, edges or both.
  • is_global (bool) – Whether this is a global container, i.e., one of the out-of-the-box models.
  • properties (dict) – View with included properties and expected edges, indexed by a unique space-local identifier.
  • last_updated_time (int) – The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.
  • created_time (int) – The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.
as_apply() → cognite.client.data_classes.data_modeling.views.ViewApply

Convert to a view applies.

Returns:The view apply.
Return type:ViewApply
dump(camel_case: bool = False) → dict[str, Any]

Dump the instance into a json serializable Python data type.

Parameters:camel_case (bool) – Use camelCase for attribute names. Defaults to False.
Returns:A dictionary representation of the instance.
Return type:Dict[str, Any]
class cognite.client.data_classes.data_modeling.views.ViewApply(space: str, external_id: str, version: str, description: str = None, name: str = None, filter: Filter | None = None, implements: list[ViewId] = None, properties: dict[str, MappedApplyPropertyDefinition | ConnectionDefinition] = None, **_)

Bases: cognite.client.data_classes.data_modeling.views.ViewCore

A group of properties. Write only version.

Parameters:
  • space (str) – The workspace for the view, a unique identifier for the space.
  • external_id (str) – Combined with the space is the unique identifier of the view.
  • description (str) – Textual description of the view
  • name (str) – Human readable name for the view.
  • filter (dict) – A filter Domain Specific Language (DSL) used to create advanced filter queries.
  • implements (list) – References to the views from where this view will inherit properties and edges.
  • version (str) – DMS version.
dump(camel_case: bool = False) → dict[str, Any]

Dump the instance into a json serializable Python data type.

Parameters:camel_case (bool) – Use camelCase for attribute names. Defaults to False.
Returns:A dictionary representation of the instance.
Return type:Dict[str, Any]
class cognite.client.data_classes.data_modeling.views.ViewApplyList(resources: Collection[Any], cognite_client: CogniteClient = None)

Bases: cognite.client.data_classes._base.CogniteResourceList

class cognite.client.data_classes.data_modeling.views.ViewDirectRelation(source: 'Optional[ViewId]' = None)

Bases: cognite.client.data_classes.data_modeling.data_types.DirectRelation

class cognite.client.data_classes.data_modeling.views.ViewFilter(space: Optional[str] = None, include_inherited_properties: bool = True, all_versions: bool = False, include_global: bool = False)

Bases: cognite.client.data_classes._base.CogniteFilter

Represent the filer arguments for the list endpoint.

Parameters:
  • space (str | None) – The space to query
  • include_inherited_properties (bool) – Whether to include properties inherited from views this view implements.
  • all_versions (bool) – Whether to return all versions. If false, only the newest version is returned, which is determined based on the ‘createdTime’ field.
  • include_global (bool) – Whether to include global views.
class cognite.client.data_classes.data_modeling.views.ViewList(resources: Collection[Any], cognite_client: CogniteClient = None)

Bases: cognite.client.data_classes._base.CogniteResourceList

to_view_apply() → cognite.client.data_classes.data_modeling.views.ViewApplyList

Convert to a view an apply list.

Returns:The view apply list.
Return type:ViewApplyList
class cognite.client.data_classes.data_modeling.views.ViewPropertyDefinition

Bases: abc.ABC

Containers

Retrieve containers by id(s)

ContainersAPI.retrieve(ids: ContainerIdentifier | Sequence[ContainerIdentifier]) → Container | ContainerList | None

Retrieve one or more container by id(s).

Parameters:ids (ContainerId | Sequence[ContainerId]) – Identifier for container(s).
Returns:Requested container or None if it does not exist.
Return type:Optional[Container]

Examples

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> res = c.data_modeling.containers.retrieve(('mySpace', 'myContainer'))

Fetch using the DataModelingId:

>>> from cognite.client import CogniteClient
>>> from cognite.client.data_modeling import DataModelingId
>>> c = CogniteClient()
>>> res = c.data_modeling.containers.retrieve(DataModelingId(space='mySpace', external_id='myContainer'))

List containers

ContainersAPI.list(space: str | None = None, limit: int = 10, include_global: bool = False) → ContainerList

List containers

Parameters:
  • space (int, optional) – The space to query
  • limit (int, optional) – Maximum number of containers to return. Default to 10. Set to -1, float(“inf”) or None to return all items.
  • include_global (bool, optional) – Whether the global containers should be returned.
Returns:

List of requested containers

Return type:

ContainerList

Examples

List containers and limit to 5:

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> container_list = c.data_modeling.containers.list(limit=5)

Iterate over containers:

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> for container in c.data_modeling.containers:
...     container # do something with the container

Iterate over chunks of containers to reduce memory load:

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> for container_list in c.data_modeling.containers(chunk_size=10):
...     container_list # do something with the containers

Apply containers

ContainersAPI.apply(container: ContainerApply | Sequence[ContainerApply]) → Container | ContainerList

Add or update (upsert) containers.

Parameters:(container (container) – ContainerApply | Sequence[ContainerApply]): Container or containers of containers to create or update.
Returns:Created container(s)
Return type:Container | ContainerList

Examples

Create new containers:

>>> from cognite.client import CogniteClient
>>> import cognite.client.data_classes.data_modeling as models
>>> c = CogniteClient()
>>> containers = [models.Container(space="mySpace",properties={"name": models.ContainerPropertyIdentifier(type=models.TextType, name="name")})]
>>> res = c.data_modeling.containers.create(containers)

Delete containers

ContainersAPI.delete(id: ContainerIdentifier | Sequence[ContainerIdentifier]) → list[DataModelingId]

Delete one or more containers

Parameters:id (ContainerId | Sequence[ContainerId) – The container identifier(s).
Returns:The container(s) which has been deleted. Empty list if nothing was deleted.

Examples

Delete containers by id:

>>> from cognite.client import CogniteClient
>>> c = CogniteClient()
>>> c.data_modeling.containers.delete(("mySpace", "myContainer"))

Containers data classes

class cognite.client.data_classes.data_modeling.containers.ConstraintIdentifier

Bases: abc.ABC

class cognite.client.data_classes.data_modeling.containers.Container(space: str, external_id: str, properties: dict[str, ContainerPropertyIdentifier], is_global: bool, last_updated_time: int, created_time: int, description: str = None, name: str = None, used_for: Literal[('node', 'edge', 'all')] = 'node', constraints: dict[str, ConstraintIdentifier] = None, indexes: dict[str, IndexIdentifier] = None)

Bases: cognite.client.data_classes.data_modeling.containers.ContainerCore

Represent the physical storage of data. This is the read format of the container

Parameters:
  • space (str) – The workspace for the view, a unique identifier for the space.
  • external_id (str) – Combined with the space is the unique identifier of the view.
  • description (str) – Textual description of the view
  • name (str) – Human readable name for the view.
  • is_global (bool) – Whether this is a global container, i.e., one of the out-of-the-box models.
  • used_for (Literal['node', 'edge', 'all']) – Should this operation apply to nodes, edges or both.
  • properties (dict[str, ContainerPropertyIdentifier]) – We index the property by a local unique identifier.
  • constraints (dict[str, ConstraintIdentifier]) – Set of constraints to apply to the container
  • indexes (dict[str, IndexIdentifier]) – Set of indexes to apply to the container.
  • last_updated_time (int) – The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.
  • created_time (int) – The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.
class cognite.client.data_classes.data_modeling.containers.ContainerApply(space: str, external_id: str, properties: dict[str, ContainerPropertyIdentifier], description: str = None, name: str = None, used_for: Literal[('node', 'edge', 'all')] = None, constraints: dict[str, ConstraintIdentifier] = None, indexes: dict[str, IndexIdentifier] = None, **_)

Bases: cognite.client.data_classes.data_modeling.containers.ContainerCore

Represent the physical storage of data. This is the write format of the container

Parameters:
  • space (str) – The workspace for the view, a unique identifier for the space.
  • external_id (str) – Combined with the space is the unique identifier of the view.
  • description (str) – Textual description of the view
  • name (str) – Human readable name for the view.
  • used_for (Literal['node', 'edge', 'all']) – Should this operation apply to nodes, edges or both.
  • properties (dict[str, ContainerPropertyIdentifier]) – We index the property by a local unique identifier.
  • constraints (dict[str, ConstraintIdentifier]) – Set of constraints to apply to the container
  • indexes (dict[str, IndexIdentifier]) – Set of indexes to apply to the container.
class cognite.client.data_classes.data_modeling.containers.ContainerApplyList(resources: Collection[Any], cognite_client: CogniteClient = None)

Bases: cognite.client.data_classes._base.CogniteResourceList

as_apply() → cognite.client.data_classes.data_modeling.containers.ContainerApplyList

Convert to a container an apply list.

Returns:The container apply list.
Return type:ContainerApplyList
class cognite.client.data_classes.data_modeling.containers.ContainerCore(space: str, external_id: str, properties: dict[str, ContainerPropertyIdentifier], description: str = None, name: str = None, used_for: Literal[('node', 'edge', 'all')] = None, constraints: dict[str, ConstraintIdentifier] = None, indexes: dict[str, IndexIdentifier] = None, **_)

Bases: cognite.client.data_classes.data_modeling._core.DataModelingResource

Represent the physical storage of data. This is the base class for the read and write version.

Parameters:
  • space (str) – The workspace for the view, a unique identifier for the space.
  • external_id (str) – Combined with the space is the unique identifier of the view.
  • description (str) – Textual description of the view
  • name (str) – Human readable name for the view.
  • used_for (Literal['node', 'edge', 'all']) – Should this operation apply to nodes, edges or both.
  • properties (dict[str, ContainerPropertyIdentifier]) – We index the property by a local unique identifier.
  • constraints (dict[str, ConstraintIdentifier]) – Set of constraints to apply to the container
  • indexes (dict[str, IndexIdentifier]) – Set of indexes to apply to the container.
dump(camel_case: bool = False) → dict[str, Any]

Dump the instance into a json serializable Python data type.

Parameters:camel_case (bool) – Use camelCase for attribute names. Defaults to False.
Returns:A dictionary representation of the instance.
Return type:Dict[str, Any]
class cognite.client.data_classes.data_modeling.containers.ContainerDirectRelation(container: 'Optional[ContainerId]' = None)

Bases: cognite.client.data_classes.data_modeling.data_types.DirectRelation

class cognite.client.data_classes.data_modeling.containers.ContainerFilter(space: Optional[str] = None, include_global: bool = False)

Bases: cognite.client.data_classes._base.CogniteFilter

Represent the filter arguments for the list endpoint.

Parameters:
  • space (str) – The space to query
  • include_global (bool) – Whether the global containers should be included.
class cognite.client.data_classes.data_modeling.containers.ContainerList(resources: Collection[Any], cognite_client: CogniteClient = None)

Bases: cognite.client.data_classes._base.CogniteResourceList

class cognite.client.data_classes.data_modeling.containers.ContainerPropertyIdentifier(type: 'PropertyType | ContainerDirectRelation', nullable: 'bool' = True, auto_increment: 'bool' = False, name: 'Optional[str]' = None, default_value: 'str | int | dict | None' = None, description: 'str | None' = None)

Bases: object

class cognite.client.data_classes.data_modeling.containers.IndexIdentifier(properties: 'list[str]', index_type: "Literal['btree'] | str" = 'btree')

Bases: object

class cognite.client.data_classes.data_modeling.containers.RequiresConstraintDefinition(require: 'ContainerId')

Bases: cognite.client.data_classes.data_modeling.containers.ConstraintIdentifier

class cognite.client.data_classes.data_modeling.containers.UniquenessConstraintDefinition(properties: 'list[str]')

Bases: cognite.client.data_classes.data_modeling.containers.ConstraintIdentifier