From 6f254f87633731505a83f6e573a9f2589c56cda5 Mon Sep 17 00:00:00 2001 From: Anders Albert <60234212+doctrino@users.noreply.github.com> Date: Sat, 9 Nov 2024 22:09:14 +0100 Subject: [PATCH] [PYG-274] Tutorial (#351) * docs: include in pygen docs * build: bump --- cognite/pygen/_version.py | 2 +- docs-dev/docs_query.ipynb | 3901 ------------- docs/docs-dev/docs_query.ipynb | 5022 +++++++++++++++++ docs/quickstart/cdf_streamlit.md | 2 +- examples/cognite_core/_api_client.py | 4 +- examples/equipment_unit/_api_client.py | 4 +- examples/omni/_api_client.py | 4 +- examples/omni_multi/_api_client.py | 4 +- examples/omni_sub/_api_client.py | 4 +- .../scenario_instance/client/_api_client.py | 4 +- examples/windmill/_api_client.py | 4 +- mkdocs.yml | 3 +- pyproject.toml | 2 +- 13 files changed, 5041 insertions(+), 3919 deletions(-) delete mode 100644 docs-dev/docs_query.ipynb create mode 100644 docs/docs-dev/docs_query.ipynb diff --git a/cognite/pygen/_version.py b/cognite/pygen/_version.py index 113b560e7..085bda964 100644 --- a/cognite/pygen/_version.py +++ b/cognite/pygen/_version.py @@ -1 +1 @@ -__version__ = "0.99.44" +__version__ = "0.99.45" diff --git a/docs-dev/docs_query.ipynb b/docs-dev/docs_query.ipynb deleted file mode 100644 index d96be302e..000000000 --- a/docs-dev/docs_query.ipynb +++ /dev/null @@ -1,3901 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "97698baf-35d1-422f-a962-1e28ad07bdb6", - "metadata": {}, - "source": [ - "# Querying Data Modeling\n", - "\n", - "This tutorial demonstrates how to query a data model in Cognite Data Fuction (CDF) with Python \n", - "\n", - "**Prerequisites**\n", - "\n", - "* Installed `cognite-sdk`\n", - "* Setup a service principal to connect to CDF.\n", - "* Use `cognite-toolkit` quickstart to setup configuration and populated the `CogniteCore` Model [Toolkit quickstart](https://docs.cognite.com/cdf/deploy/cdf_toolkit/references/packages/quickstart)" - ] - }, - { - "cell_type": "markdown", - "id": "6268a78f-e8de-482f-832b-20d28333a3b1", - "metadata": {}, - "source": [ - "## Setting up a cognite client" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "3d0b28eb-87fe-453e-9cad-a7f5d8c3fb90", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-09T13:13:17.005946Z", - "start_time": "2024-11-09T13:13:16.981218Z" - } - }, - "outputs": [], - "source": [ - "import os\n", - "\n", - "from cognite.client import CogniteClient\n", - "from dotenv import load_dotenv\n", - "\n", - "load_dotenv(\"../.env\")\n", - "\n", - "client = CogniteClient.default_oauth_client_credentials(\n", - " project=os.environ[\"CDF_PROJECT\"],\n", - " cdf_cluster=os.environ[\"CDF_CLUSTER\"],\n", - " tenant_id=os.environ[\"IDP_TENANT_ID\"],\n", - " client_id=os.environ[\"IDP_CLIENT_ID\"],\n", - " client_secret=os.environ[\"IDP_CLIENT_SECRET\"],\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "308cb4ec-826a-496e-ae32-2762658ace18", - "metadata": { - "jp-MarkdownHeadingCollapsed": true - }, - "source": [ - "## Querying across a direct relation" - ] - }, - { - "cell_type": "markdown", - "id": "6af59c70-5e20-4563-bda5-f1d0eb62ca2d", - "metadata": {}, - "source": [ - "First, we will query across a direct relation. For example, we can get the `parent` starting from `CogniteAsset`" - ] - }, - { - "cell_type": "code", - "execution_count": 27, - "id": "2db7c273-c079-4ce7-8ae1-08dbb9f334ac", - "metadata": {}, - "outputs": [], - "source": [ - "from cognite.client import data_modeling as dm\n", - "from cognite.client.data_classes import filters\n", - "\n", - "asset_view = dm.ViewId(\"cdf_cdm\", \"CogniteAsset\", \"v1\")\n", - "# The instance space with the instance demo data\n", - "data_space = \"springfield_instances\"" - ] - }, - { - "cell_type": "code", - "execution_count": 28, - "id": "4829284b-429c-4bf2-b4ce-f64d7e848bc1", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-09T13:23:47.333397Z", - "start_time": "2024-11-09T13:23:47.167740Z" - } - }, - "outputs": [], - "source": [ - "query = dm.query.Query(\n", - " with_={\n", - " \"asset\": dm.query.NodeResultSetExpression(\n", - " limit=10,\n", - " filter=filters.And(filters.HasData(views=[asset_view]), filters.Equals([\"node\", \"space\"], data_space)),\n", - " ),\n", - " \"parent\": dm.query.NodeResultSetExpression(\n", - " from_=\"asset\", through=dm.PropertyId(source=asset_view, property=\"parent\")\n", - " ),\n", - " },\n", - " select={\n", - " \"asset\": dm.query.Select(sources=[dm.query.SourceSelector(source=asset_view, properties=[\"*\"])]),\n", - " \"parent\": dm.query.Select(sources=[dm.query.SourceSelector(source=asset_view, properties=[\"*\"])]),\n", - " },\n", - ")\n", - "\n", - "result = client.data_modeling.instances.query(query)" - ] - }, - { - "cell_type": "code", - "execution_count": 25, - "id": "38fb49fa-3cff-4fa8-9797-3b134e0f60e3", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-09T13:23:47.767980Z", - "start_time": "2024-11-09T13:23:47.739654Z" - } - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typepathrootpathLastUpdatedTimenamedescriptionsourceIdsourceUpdatedUserparent
0springfield_instancesWMT:23-2ND STAGE COMP DRY GAS SEAL SYS-PH22024-11-08 14:20:21.6332024-11-08 14:20:20.316node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-08T14:20:21.633609+00:0023-2ND STAGE COMP DRY GAS SEAL SYS-PH2ND STAGE COMP DRY GAS SEAL SYS ON PH6825468137NaN
1springfield_instancesWMT:23090032024-11-09 13:17:39.2832024-11-08 14:20:20.316node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:00230900GAS COMPRESSION AND RE-INJECTION ON PH6817608137NaN
2springfield_instancesWMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH22024-11-08 14:20:28.0942024-11-08 14:20:27.925node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-08T14:20:28.094598+00:0023-1ST STAGE COMP DRY GAS SEAL SYS-PH1ST STAGE COMP DRY GAS SEAL SYS ON PH6825408137NaN
3springfield_instancesWMT:23-2ND STAGE COMPRESSION-PH42024-11-09 13:17:39.2832024-11-08 14:20:27.925node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-2ND STAGE COMPRESSION-PH2ND STAGE COMPRESSION ON PH6817948137{'space': 'springfield_instances', 'externalId...
4springfield_instancesWMT:23-2ND STAGE COMPRESSOR-PH42024-11-09 13:17:39.2832024-11-08 14:20:28.103node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-2ND STAGE COMPRESSOR-PH2ND STAGE COMPRESSOR ON PH6818258137{'space': 'springfield_instances', 'externalId...
5springfield_instancesWMT:23-1ST STAGE COMPRESSOR-PH42024-11-09 13:17:39.2832024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-1ST STAGE COMPRESSOR-PH1ST STAGE COMPRESSOR ON PH6818248137{'space': 'springfield_instances', 'externalId...
6springfield_instancesWMT:23-1ST STAGE COMP LUBE OIL SYS-PH22024-11-08 14:21:07.5072024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-08T14:21:07.507048+00:0023-1ST STAGE COMP LUBE OIL SYS-PH1ST STAGE COMP LUBE OIL SYS ON PH6825448137NaN
7springfield_instancesWMT:23-1ST STAGE COMP ENCLOSURE-PH22024-11-08 14:21:07.5072024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-08T14:21:07.507048+00:0023-1ST STAGE COMP ENCLOSURE-PH1ST STAGE COMP ENCLOSURE ON PH6825428137NaN
8springfield_instancesWMT:23-1ST STAGE COMPRESSION-PH42024-11-09 13:17:39.2832024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-1ST STAGE COMPRESSION-PH1ST STAGE COMPRESSION ON PH6817928137{'space': 'springfield_instances', 'externalId...
\n", - "
" - ], - "text/plain": [ - " space external_id version \\\n", - "0 springfield_instances WMT:23-2ND STAGE COMP DRY GAS SEAL SYS-PH 2 \n", - "1 springfield_instances WMT:230900 3 \n", - "2 springfield_instances WMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH 2 \n", - "3 springfield_instances WMT:23-2ND STAGE COMPRESSION-PH 4 \n", - "4 springfield_instances WMT:23-2ND STAGE COMPRESSOR-PH 4 \n", - "5 springfield_instances WMT:23-1ST STAGE COMPRESSOR-PH 4 \n", - "6 springfield_instances WMT:23-1ST STAGE COMP LUBE OIL SYS-PH 2 \n", - "7 springfield_instances WMT:23-1ST STAGE COMP ENCLOSURE-PH 2 \n", - "8 springfield_instances WMT:23-1ST STAGE COMPRESSION-PH 4 \n", - "\n", - " last_updated_time created_time instance_type \\\n", - "0 2024-11-08 14:20:21.633 2024-11-08 14:20:20.316 node \n", - "1 2024-11-09 13:17:39.283 2024-11-08 14:20:20.316 node \n", - "2 2024-11-08 14:20:28.094 2024-11-08 14:20:27.925 node \n", - "3 2024-11-09 13:17:39.283 2024-11-08 14:20:27.925 node \n", - "4 2024-11-09 13:17:39.283 2024-11-08 14:20:28.103 node \n", - "5 2024-11-09 13:17:39.283 2024-11-08 14:21:06.876 node \n", - "6 2024-11-08 14:21:07.507 2024-11-08 14:21:06.876 node \n", - "7 2024-11-08 14:21:07.507 2024-11-08 14:21:06.876 node \n", - "8 2024-11-09 13:17:39.283 2024-11-08 14:21:06.876 node \n", - "\n", - " path \\\n", - "0 [{'space': 'springfield_instances', 'externalI... \n", - "1 [{'space': 'springfield_instances', 'externalI... \n", - "2 [{'space': 'springfield_instances', 'externalI... \n", - "3 [{'space': 'springfield_instances', 'externalI... \n", - "4 [{'space': 'springfield_instances', 'externalI... \n", - "5 [{'space': 'springfield_instances', 'externalI... \n", - "6 [{'space': 'springfield_instances', 'externalI... \n", - "7 [{'space': 'springfield_instances', 'externalI... \n", - "8 [{'space': 'springfield_instances', 'externalI... \n", - "\n", - " root \\\n", - "0 {'space': 'springfield_instances', 'externalId... \n", - "1 {'space': 'springfield_instances', 'externalId... \n", - "2 {'space': 'springfield_instances', 'externalId... \n", - "3 {'space': 'springfield_instances', 'externalId... \n", - "4 {'space': 'springfield_instances', 'externalId... \n", - "5 {'space': 'springfield_instances', 'externalId... \n", - "6 {'space': 'springfield_instances', 'externalId... \n", - "7 {'space': 'springfield_instances', 'externalId... \n", - "8 {'space': 'springfield_instances', 'externalId... \n", - "\n", - " pathLastUpdatedTime name \\\n", - "0 2024-11-08T14:20:21.633609+00:00 23-2ND STAGE COMP DRY GAS SEAL SYS-PH \n", - "1 2024-11-09T13:17:39.28327+00:00 230900 \n", - "2 2024-11-08T14:20:28.094598+00:00 23-1ST STAGE COMP DRY GAS SEAL SYS-PH \n", - "3 2024-11-09T13:17:39.28327+00:00 23-2ND STAGE COMPRESSION-PH \n", - "4 2024-11-09T13:17:39.28327+00:00 23-2ND STAGE COMPRESSOR-PH \n", - "5 2024-11-09T13:17:39.28327+00:00 23-1ST STAGE COMPRESSOR-PH \n", - "6 2024-11-08T14:21:07.507048+00:00 23-1ST STAGE COMP LUBE OIL SYS-PH \n", - "7 2024-11-08T14:21:07.507048+00:00 23-1ST STAGE COMP ENCLOSURE-PH \n", - "8 2024-11-09T13:17:39.28327+00:00 23-1ST STAGE COMPRESSION-PH \n", - "\n", - " description sourceId sourceUpdatedUser \\\n", - "0 2ND STAGE COMP DRY GAS SEAL SYS ON PH 682546 8137 \n", - "1 GAS COMPRESSION AND RE-INJECTION ON PH 681760 8137 \n", - "2 1ST STAGE COMP DRY GAS SEAL SYS ON PH 682540 8137 \n", - "3 2ND STAGE COMPRESSION ON PH 681794 8137 \n", - "4 2ND STAGE COMPRESSOR ON PH 681825 8137 \n", - "5 1ST STAGE COMPRESSOR ON PH 681824 8137 \n", - "6 1ST STAGE COMP LUBE OIL SYS ON PH 682544 8137 \n", - "7 1ST STAGE COMP ENCLOSURE ON PH 682542 8137 \n", - "8 1ST STAGE COMPRESSION ON PH 681792 8137 \n", - "\n", - " parent \n", - "0 NaN \n", - "1 NaN \n", - "2 NaN \n", - "3 {'space': 'springfield_instances', 'externalId... \n", - "4 {'space': 'springfield_instances', 'externalId... \n", - "5 {'space': 'springfield_instances', 'externalId... \n", - "6 NaN \n", - "7 NaN \n", - "8 {'space': 'springfield_instances', 'externalId... " - ] - }, - "execution_count": 25, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df = result[\"asset\"].to_pandas(expand_properties=True)\n", - "df" - ] - }, - { - "cell_type": "code", - "execution_count": 26, - "id": "400c57d2-754e-4c52-92ec-03dc0e9123d7", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-09T13:23:48.546916Z", - "start_time": "2024-11-09T13:23:48.536611Z" - } - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typepathrootpathLastUpdatedTimenamedescriptionsourceIdsourceUpdatedUserparent
0springfield_instancesWMT:23090032024-11-09 13:17:39.2832024-11-08 14:20:20.316node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:00230900GAS COMPRESSION AND RE-INJECTION ON PH6817608137NaN
1springfield_instancesWMT:23-2ND STAGE COMPRESSION-PH42024-11-09 13:17:39.2832024-11-08 14:20:27.925node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-2ND STAGE COMPRESSION-PH2ND STAGE COMPRESSION ON PH6817948137{'space': 'springfield_instances', 'externalId...
2springfield_instancesWMT:23-1ST STAGE COMPRESSION-PH42024-11-09 13:17:39.2832024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-1ST STAGE COMPRESSION-PH1ST STAGE COMPRESSION ON PH6817928137{'space': 'springfield_instances', 'externalId...
\n", - "
" - ], - "text/plain": [ - "NodeListWithCursor([,\n", - " ,\n", - " ])" - ] - }, - "execution_count": 26, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "result[\"parent\"]" - ] - }, - { - "cell_type": "markdown", - "id": "1ef1f8db-e525-4b2f-bf47-dabe93abaf2a", - "metadata": {}, - "source": [ - "## Quering across reverse direct relation of single relation" - ] - }, - { - "cell_type": "markdown", - "id": "c8d8bf72-4907-4064-a509-a9437f9f82f4", - "metadata": {}, - "source": [ - "We can for example query across the `children` in `CogniteAsset`. The `children` property is a reverse direct relation of `parent`, so we query in `inwards` direction towards parent" - ] - }, - { - "cell_type": "code", - "execution_count": 31, - "id": "75db7a18-99fe-4656-86a3-d33c9c4acb75", - "metadata": {}, - "outputs": [], - "source": [ - "query = dm.query.Query(\n", - " with_={\n", - " \"asset\": dm.query.NodeResultSetExpression(\n", - " limit=10,\n", - " filter=filters.And(filters.HasData(views=[asset_view]), filters.Equals([\"node\", \"space\"], data_space)),\n", - " ),\n", - " \"children\": dm.query.NodeResultSetExpression(\n", - " from_=\"asset\", through=dm.PropertyId(source=asset_view, property=\"parent\"), direction=\"inwards\"\n", - " ),\n", - " },\n", - " select={\n", - " \"asset\": dm.query.Select(sources=[dm.query.SourceSelector(source=asset_view, properties=[\"*\"])]),\n", - " \"children\": dm.query.Select(sources=[dm.query.SourceSelector(source=asset_view, properties=[\"*\"])]),\n", - " },\n", - ")\n", - "\n", - "result = client.data_modeling.instances.query(query)" - ] - }, - { - "cell_type": "code", - "execution_count": 34, - "id": "b53e0aff-ac57-4c02-a9a7-b40f1a844dff", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typepathrootpathLastUpdatedTimenamedescriptionsourceIdsourceUpdatedUserparent
0springfield_instancesWMT:23-2ND STAGE COMP DRY GAS SEAL SYS-PH22024-11-08 14:20:21.6332024-11-08 14:20:20.316node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-08T14:20:21.633609+00:0023-2ND STAGE COMP DRY GAS SEAL SYS-PH2ND STAGE COMP DRY GAS SEAL SYS ON PH6825468137NaN
1springfield_instancesWMT:23090032024-11-09 13:17:39.2832024-11-08 14:20:20.316node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:00230900GAS COMPRESSION AND RE-INJECTION ON PH6817608137NaN
2springfield_instancesWMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH22024-11-08 14:20:28.0942024-11-08 14:20:27.925node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-08T14:20:28.094598+00:0023-1ST STAGE COMP DRY GAS SEAL SYS-PH1ST STAGE COMP DRY GAS SEAL SYS ON PH6825408137NaN
3springfield_instancesWMT:23-2ND STAGE COMPRESSION-PH42024-11-09 13:17:39.2832024-11-08 14:20:27.925node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-2ND STAGE COMPRESSION-PH2ND STAGE COMPRESSION ON PH6817948137{'space': 'springfield_instances', 'externalId...
4springfield_instancesWMT:23-2ND STAGE COMPRESSOR-PH42024-11-09 13:17:39.2832024-11-08 14:20:28.103node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-2ND STAGE COMPRESSOR-PH2ND STAGE COMPRESSOR ON PH6818258137{'space': 'springfield_instances', 'externalId...
5springfield_instancesWMT:23-1ST STAGE COMPRESSOR-PH42024-11-09 13:17:39.2832024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-1ST STAGE COMPRESSOR-PH1ST STAGE COMPRESSOR ON PH6818248137{'space': 'springfield_instances', 'externalId...
6springfield_instancesWMT:23-1ST STAGE COMP LUBE OIL SYS-PH22024-11-08 14:21:07.5072024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-08T14:21:07.507048+00:0023-1ST STAGE COMP LUBE OIL SYS-PH1ST STAGE COMP LUBE OIL SYS ON PH6825448137NaN
7springfield_instancesWMT:23-1ST STAGE COMP ENCLOSURE-PH22024-11-08 14:21:07.5072024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-08T14:21:07.507048+00:0023-1ST STAGE COMP ENCLOSURE-PH1ST STAGE COMP ENCLOSURE ON PH6825428137NaN
8springfield_instancesWMT:23-1ST STAGE COMPRESSION-PH42024-11-09 13:17:39.2832024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-1ST STAGE COMPRESSION-PH1ST STAGE COMPRESSION ON PH6817928137{'space': 'springfield_instances', 'externalId...
\n", - "
" - ], - "text/plain": [ - "NodeListWithCursor([,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ])" - ] - }, - "execution_count": 34, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "result[\"asset\"]" - ] - }, - { - "cell_type": "code", - "execution_count": 35, - "id": "b16d7ff4-9f74-475d-981c-8b197f182878", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typepathrootparentpathLastUpdatedTimenamedescriptionsourceIdsourceUpdatedUser
0springfield_instancesWMT:23-2ND STAGE COMPRESSION-PH42024-11-09 13:17:39.2832024-11-08 14:20:27.925node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-2ND STAGE COMPRESSION-PH2ND STAGE COMPRESSION ON PH6817948137
1springfield_instancesWMT:23-2ND STAGE COMPRESSOR-PH42024-11-09 13:17:39.2832024-11-08 14:20:28.103node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-2ND STAGE COMPRESSOR-PH2ND STAGE COMPRESSOR ON PH6818258137
2springfield_instancesWMT:23-1ST STAGE COMPRESSOR-PH42024-11-09 13:17:39.2832024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-1ST STAGE COMPRESSOR-PH1ST STAGE COMPRESSOR ON PH6818248137
3springfield_instancesWMT:23-1ST STAGE COMPRESSION-PH42024-11-09 13:17:39.2832024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-1ST STAGE COMPRESSION-PH1ST STAGE COMPRESSION ON PH6817928137
\n", - "
" - ], - "text/plain": [ - "NodeListWithCursor([,\n", - " ,\n", - " ,\n", - " ])" - ] - }, - "execution_count": 35, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "result[\"children\"]" - ] - }, - { - "cell_type": "markdown", - "id": "bd779189-a9ee-4a54-8a3e-c9b0634929b2", - "metadata": {}, - "source": [ - "## Querying across reverse direct relation of listable relation" - ] - }, - { - "cell_type": "markdown", - "id": "c8b73be4-04f0-4b82-a9f8-364de5e087b4", - "metadata": {}, - "source": [ - "We want all activities connected to equipment. The property `activities` in `CogniteEquipment` is a reverse direct relation of `equipment` in `CogniteActivity`. \n", - "The `/query` enpoint does not support querying accross a reverse direct relation of listable relation. Instead, we will first lookup `CogniteEquipment` and the after we have retrieved the equipment items,\n", - "we will use `/search` to lookup activities that are connected to the equipment we found." - ] - }, - { - "cell_type": "code", - "execution_count": 42, - "id": "a2a567c8-e21b-4dec-8fb8-1782f0b9d470", - "metadata": {}, - "outputs": [], - "source": [ - "equipment_view = dm.ViewId(\"cdf_cdm\", \"CogniteEquipment\", \"v1\")\n", - "activity_view = dm.ViewId(\"cdf_cdm\", \"CogniteActivity\", \"v1\")" - ] - }, - { - "cell_type": "code", - "execution_count": 58, - "id": "c3d22491-d4a0-4d57-9bb2-03c4434b6daa", - "metadata": {}, - "outputs": [], - "source": [ - "equipment = client.data_modeling.instances.list(limit=100, sources=equipment_view, space=data_space)" - ] - }, - { - "cell_type": "code", - "execution_count": 59, - "id": "7e8712b9-930e-4732-8df5-a9e113962452", - "metadata": {}, - "outputs": [], - "source": [ - "is_equipment = filters.In(activity_view.as_property_ref(\"equipment\"), [item.as_id() for item in equipment])" - ] - }, - { - "cell_type": "code", - "execution_count": 60, - "id": "4070ecce-adcc-4204-8523-74ab36357fd2", - "metadata": {}, - "outputs": [], - "source": [ - "activities = client.data_modeling.instances.search(activity_view, filter=is_equipment, limit=1_000)" - ] - }, - { - "cell_type": "code", - "execution_count": 61, - "id": "8be52c76-3fcc-4d4e-ba65-f20df5e7ed9c", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typeassetsequipmenttimeSeriesnametags
0springfield_instances618699621202269332024-11-09 04:00:55.3282024-11-08 14:20:32.388node[][{'space': 'springfield_instances', 'externalI...[]***-årlig visuell inspeksjon[23-LTX-92529]
1springfield_instances22628430413528532024-11-09 04:00:55.3282024-11-08 14:20:32.968node[][{'space': 'springfield_instances', 'externalI...[]Årlig sampling assessment[23-LTX-92529]
2springfield_instances841340263773196332024-11-09 04:00:55.3282024-11-08 14:20:37.196node[][{'space': 'springfield_instances', 'externalI...[]Årlig sampling assessment[23-LTX-92529]
3springfield_instances702241132917179232024-11-09 04:00:55.3282024-11-08 14:20:48.208node[][{'space': 'springfield_instances', 'externalI...[]Årlig sampling assessment[23-LTX-92529]
4springfield_instances164184305118770932024-11-09 04:00:55.3282024-11-08 14:20:53.101node[][{'space': 'springfield_instances', 'externalI...[]Årlig sampling assessment[23-LTX-92529]
....................................
995springfield_instances669704022184023152024-11-09 13:18:44.0932024-11-08 14:21:02.745node[][{'space': 'springfield_instances', 'externalI...[{'space': 'springfield_instances', 'externalI...[23-PDT-96167]
996springfield_instances797764897384164352024-11-09 13:18:44.0932024-11-08 14:21:02.745node[][{'space': 'springfield_instances', 'externalI...[{'space': 'springfield_instances', 'externalI...*** Monthly monitoring[23-TT-96181-03]
997springfield_instances148381228363641252024-11-09 13:18:44.0932024-11-08 14:21:02.745node[][{'space': 'springfield_instances', 'externalI...[{'space': 'springfield_instances', 'externalI...***-årlig visuell inspeksjon[23-VA-9110-M01]
998springfield_instances651266242712581652024-11-09 13:18:44.1762024-11-08 14:20:36.244node[][{'space': 'springfield_instances', 'externalI...[{'space': 'springfield_instances', 'externalI...IPL/SIF - Funksjonstest av Sikkerhetskritisk I...[23-TT-96181-03]
999springfield_instances84022349052416752024-11-09 13:18:44.1762024-11-08 14:20:36.244node[][{'space': 'springfield_instances', 'externalI...[{'space': 'springfield_instances', 'externalI...Ettersyn av instrumentering[23-PT-96186-03]
\n", - "

1000 rows × 11 columns

\n", - "
" - ], - "text/plain": [ - "NodeList([,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ])" - ] - }, - "execution_count": 61, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "activities" - ] - }, - { - "cell_type": "code", - "execution_count": 62, - "id": "35f354f5-b30b-4474-bf30-e10f90a1c59a", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typenamedescriptionfilesmanufacturerserialNumbersourceIdsourceUpdatedUserasset
0springfield_instancesWMT:23-YAH-96119-0112024-11-08 14:20:20.3652024-11-08 14:20:20.365node23-YAH-96119-01VRD - PH 1STSTGGEAR 2 JOURNBRG NDE : VIBRATION...[]168610000000002936597004911001NaN
1springfield_instancesWMT:23-TAH-96113-0312024-11-08 14:20:20.3652024-11-08 14:20:20.365node23-TAH-96113-03VRD - PH 1STSTGGEAR 2 JOURNBRG NDE : TEMPERATU...[]168610000000002849376961131001NaN
2springfield_instancesWMT:23-PCV-9616322024-11-09 04:00:43.8982024-11-08 14:20:20.365node23-PCV-96163VRD - PH 1STSTG COMP DRY GAS SEAL SYSTEM[]168610000000002298116732871001{'space': 'springfield_instances', 'externalId...
3springfield_instancesWMT:23-TE-96114-0112024-11-08 14:20:20.3652024-11-08 14:20:20.365node23-TE-96114-01VRD - PH 1STSTGGEAR 2 JOURNBRG DE[]168610000000006823513464238137NaN
4springfield_instancesWMT:23-HV-96191-0312024-11-08 14:20:20.3652024-11-08 14:20:20.365node23-HV-96191-03VRD - PH 1STSTGLUBEOIL PSV OUT[]168610000000007168823460259802NaN
.............................................
95springfield_instancesWMT:23-YXY-92526-0312024-11-08 14:20:25.5872024-11-08 14:20:25.587node23-YXY-92526-03VRD - PH 1STSTGSUCTSCRUB B/D[]168610000000007166433470468137NaN
96springfield_instancesWMT:45-TT-9250812024-11-08 14:20:25.5872024-11-08 14:20:25.587node45-TT-92508VRD - PH 1STSTGSUCTCLR COOLMED OUT[]168610000000007104153503629802NaN
97springfield_instancesWMT:23-FG-96180-0112024-11-08 14:20:25.5872024-11-08 14:20:25.587node23-FG-96180-01VRD - PH 1STSTG LUBE OIL FILTER[]168610000000007060343457449802NaN
98springfield_instancesWMT:23-FY-9254312024-11-08 14:20:25.5872024-11-08 14:20:25.587node23-FY-92543VRD - PH 1STSTGCOMP ANTI-SURGE[]168610000000007054233458898137NaN
99springfield_instancesWMT:23-PDT-9614012024-11-08 14:20:25.5872024-11-08 14:20:25.587node23-PDT-96140VRD - INLET AIR PRESSURE DIFFERENTIAL TRANSMITTER[]132710000000009302265265051001NaN
\n", - "

100 rows × 14 columns

\n", - "
" - ], - "text/plain": [ - "NodeList([,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ])" - ] - }, - "execution_count": 62, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "equipment" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "dc0d804e-0cc2-46d4-aacd-852a5cdf4979", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "markdown", - "id": "0940bde6-592b-4744-b27e-7de844372e3e", - "metadata": {}, - "source": [ - "## Quering across edge" - ] - }, - { - "cell_type": "markdown", - "id": "8636130c-ac6e-48a2-9cb5-1d76f3e73996", - "metadata": {}, - "source": [ - "The are no edges in the `CogniteCore` model except for `CogniteAnnotations`. We will use this to find all assets connected to a file.\n" - ] - }, - { - "cell_type": "code", - "execution_count": 64, - "id": "8d4d91fe-b848-46d6-9469-3eb296ef22a2", - "metadata": {}, - "outputs": [], - "source": [ - "file_view = dm.ViewId(\"cdf_cdm\", \"CogniteFile\", \"v1\")\n", - "annotation_view = dm.ViewId(\"cdf_cdm\", \"CogniteDiagramAnnotation\", \"v1\")" - ] - }, - { - "cell_type": "code", - "execution_count": 70, - "id": "5b89b35a-555d-47b4-a449-8509f959c3de", - "metadata": {}, - "outputs": [], - "source": [ - "query = dm.query.Query(\n", - " with_={\n", - " \"file\": dm.query.NodeResultSetExpression(\n", - " limit=10,\n", - " filter=filters.And(filters.HasData(views=[file_view]), filters.Equals([\"node\", \"space\"], data_space)),\n", - " ),\n", - " \"annotation\": dm.query.EdgeResultSetExpression(\n", - " from_=\"file\", direction=\"outwards\", filter=filters.HasData(views=[annotation_view])\n", - " ),\n", - " \"asset\": dm.query.NodeResultSetExpression(from_=\"annotation\", filter=filters.HasData(views=[asset_view])),\n", - " },\n", - " select={\n", - " \"file\": dm.query.Select(sources=[dm.query.SourceSelector(source=file_view, properties=[\"*\"])]),\n", - " \"annotation\": dm.query.Select(sources=[dm.query.SourceSelector(source=annotation_view, properties=[\"*\"])]),\n", - " \"asset\": dm.query.Select(sources=[dm.query.SourceSelector(source=asset_view, properties=[\"*\"])]),\n", - " },\n", - ")\n", - "\n", - "result = client.data_modeling.instances.query(query)" - ] - }, - { - "cell_type": "code", - "execution_count": 72, - "id": "47553d13-3c08-4cc2-81ef-43758acbfa12", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typenameassetsmimeTypeisUploadeduploadedTime
0springfield_instancesVAL_PH-25578-P-4110006-001.pdf62024-11-09 12:59:09.1042024-11-08 14:13:43.301nodePH-25578-P-4110006-001.pdf[]application/pdfTrue2024-11-09T12:59:08.963+00:00
1springfield_instancesVAL_PH-25578-P-4110010-001.pdf62024-11-09 12:59:09.2522024-11-08 14:13:43.301nodePH-25578-P-4110010-001.pdf[]application/pdfTrue2024-11-09T12:59:09.221+00:00
2springfield_instancesVAL_PH-25578-P-4110119-001.pdf62024-11-09 12:59:09.5212024-11-08 14:13:43.301nodePH-25578-P-4110119-001.pdf[]application/pdfTrue2024-11-09T12:59:09.493+00:00
3springfield_instancesVAL_PH-ME-P-0003-001.pdf62024-11-09 12:59:10.3242024-11-08 14:13:43.301nodePH-ME-P-0003-001.pdf[]application/pdfTrue2024-11-09T12:59:09.781+00:00
4springfield_instancesVAL_PH-ME-P-0004-001.pdf62024-11-09 12:59:10.0352024-11-08 14:13:43.301nodePH-ME-P-0004-001.pdf[]application/pdfTrue2024-11-09T12:59:10.007+00:00
5springfield_instancesVAL_PH-ME-P-0151-001.pdf62024-11-09 12:59:10.4722024-11-08 14:13:43.301nodePH-ME-P-0151-001.pdf[]application/pdfTrue2024-11-09T12:59:10.446+00:00
6springfield_instancesVAL_PH-ME-P-0152-001.pdf62024-11-09 12:59:10.7332024-11-08 14:13:43.301nodePH-ME-P-0152-001.pdf[]application/pdfTrue2024-11-09T12:59:10.707+00:00
7springfield_instancesVAL_PH-ME-P-0153-001.pdf62024-11-09 12:59:10.9782024-11-08 14:13:43.301nodePH-ME-P-0153-001.pdf[]application/pdfTrue2024-11-09T12:59:10.947+00:00
8springfield_instancesVAL_PH-ME-P-0156-001.pdf62024-11-09 12:59:11.3052024-11-08 14:13:43.301nodePH-ME-P-0156-001.pdf[]application/pdfTrue2024-11-09T12:59:11.277+00:00
9springfield_instancesVAL_PH-ME-P-0156-002.pdf62024-11-09 12:59:11.6062024-11-08 14:13:43.301nodePH-ME-P-0156-002.pdf[]application/pdfTrue2024-11-09T12:59:11.562+00:00
\n", - "
" - ], - "text/plain": [ - "NodeListWithCursor([,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ])" - ] - }, - "execution_count": 72, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "result[\"file\"]" - ] - }, - { - "cell_type": "code", - "execution_count": 74, - "id": "0a7d43a9-5158-420b-85fe-8e1b7151db4c", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typepropertiestypestart_nodeend_node
0springfield_instancesspringfield_instances:VAL_PH-25578-P-4110006-0...22024-11-09 13:19:46.7862024-11-09 04:03:32.334edge{'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...
1springfield_instancesspringfield_instances:VAL_PH-25578-P-4110006-0...22024-11-09 13:19:46.7862024-11-09 04:03:32.334edge{'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...
2springfield_instancesspringfield_instances:VAL_PH-25578-P-4110006-0...22024-11-09 13:19:46.7862024-11-09 04:03:32.334edge{'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...
3springfield_instancesspringfield_instances:VAL_PH-25578-P-4110006-0...22024-11-09 13:19:46.7862024-11-09 04:03:32.334edge{'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...
4springfield_instancesspringfield_instances:VAL_PH-25578-P-4110006-0...22024-11-09 13:19:46.7862024-11-09 04:03:32.334edge{'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...
\n", - "
" - ], - "text/plain": [ - " space external_id \\\n", - "0 springfield_instances springfield_instances:VAL_PH-25578-P-4110006-0... \n", - "1 springfield_instances springfield_instances:VAL_PH-25578-P-4110006-0... \n", - "2 springfield_instances springfield_instances:VAL_PH-25578-P-4110006-0... \n", - "3 springfield_instances springfield_instances:VAL_PH-25578-P-4110006-0... \n", - "4 springfield_instances springfield_instances:VAL_PH-25578-P-4110006-0... \n", - "\n", - " version last_updated_time created_time instance_type \\\n", - "0 2 2024-11-09 13:19:46.786 2024-11-09 04:03:32.334 edge \n", - "1 2 2024-11-09 13:19:46.786 2024-11-09 04:03:32.334 edge \n", - "2 2 2024-11-09 13:19:46.786 2024-11-09 04:03:32.334 edge \n", - "3 2 2024-11-09 13:19:46.786 2024-11-09 04:03:32.334 edge \n", - "4 2 2024-11-09 13:19:46.786 2024-11-09 04:03:32.334 edge \n", - "\n", - " properties \\\n", - "0 {'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'... \n", - "1 {'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'... \n", - "2 {'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'... \n", - "3 {'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'... \n", - "4 {'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'... \n", - "\n", - " type \\\n", - "0 {'space': 'springfield_instances', 'external_i... \n", - "1 {'space': 'springfield_instances', 'external_i... \n", - "2 {'space': 'springfield_instances', 'external_i... \n", - "3 {'space': 'springfield_instances', 'external_i... \n", - "4 {'space': 'springfield_instances', 'external_i... \n", - "\n", - " start_node \\\n", - "0 {'space': 'springfield_instances', 'external_i... \n", - "1 {'space': 'springfield_instances', 'external_i... \n", - "2 {'space': 'springfield_instances', 'external_i... \n", - "3 {'space': 'springfield_instances', 'external_i... \n", - "4 {'space': 'springfield_instances', 'external_i... \n", - "\n", - " end_node \n", - "0 {'space': 'springfield_instances', 'external_i... \n", - "1 {'space': 'springfield_instances', 'external_i... \n", - "2 {'space': 'springfield_instances', 'external_i... \n", - "3 {'space': 'springfield_instances', 'external_i... \n", - "4 {'space': 'springfield_instances', 'external_i... " - ] - }, - "execution_count": 74, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "result[\"annotation\"].to_pandas().head()" - ] - }, - { - "cell_type": "code", - "execution_count": 75, - "id": "ab76174e-7d2b-4e8e-b38b-5c558465bd6a", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typepathrootparentpathLastUpdatedTimenamedescriptionsourceIdsourceUpdatedUser
0springfield_instancesWMT:23-2ND STAGE COMPRESSOR-PH42024-11-09 13:17:39.2832024-11-08 14:20:28.103node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-2ND STAGE COMPRESSOR-PH2ND STAGE COMPRESSOR ON PH6818258137
1springfield_instancesWMT:23-1ST STAGE COMPRESSOR-PH42024-11-09 13:17:39.2832024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-1ST STAGE COMPRESSOR-PH1ST STAGE COMPRESSOR ON PH6818248137
2springfield_instancesWMT:23-1ST STAGE COMP LUBE OIL SYS-PH22024-11-08 14:21:07.5072024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...NaN2024-11-08T14:21:07.507048+00:0023-1ST STAGE COMP LUBE OIL SYS-PH1ST STAGE COMP LUBE OIL SYS ON PH6825448137
\n", - "
" - ], - "text/plain": [ - "NodeListWithCursor([,\n", - " ,\n", - " ])" - ] - }, - "execution_count": 75, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "result[\"asset\"]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "5e9e841e-3245-4345-be00-c49f4145b8a7", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "879bd08bec12e3d0", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "markdown", - "id": "9756b95d716eb59", - "metadata": {}, - "source": [ - "## Using pygen to query\n", - "\n", - "`pygen` is a code generator that generates Python code tailored to your data model." - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "24e32802a16755a3", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-09T13:24:36.057885Z", - "start_time": "2024-11-09T13:24:30.626534Z" - } - }, - "outputs": [], - "source": [ - "from cognite.pygen import generate_sdk_notebook" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "42fc517e-26e7-4bb6-96de-a9114f58cd6f", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-09T13:28:13.528432Z", - "start_time": "2024-11-09T13:28:06.611839Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Successfully retrieved data model(s) ('cdf_cdm', 'CogniteCore', 'v1')\n", - "Cleaned temporary directory C:\\Users\\ANDERS~1\\AppData\\Local\\Temp\\pygen\\cdf_cdm_CogniteCore_v1\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\AndersAlbert\\Projects\\internal\\pygen\\cognite\\pygen\\_core\\generators.py:407: UserWarning: Field(s) name in view ViewId(space='cdf_cdm', external_id='Cognite360ImageCollection', version='v1') has potential conflict with protected Pydantic namespace 'model_'\n", - " sdk[data_classes_dir / f\"_{file_name}.py\"] = api.generate_data_class_file()\n", - "C:\\Users\\AndersAlbert\\Projects\\internal\\pygen\\cognite\\pygen\\_core\\generators.py:407: UserWarning: Field(s) name in view ViewId(space='cdf_cdm', external_id='Cognite360ImageModel', version='v1') has potential conflict with protected Pydantic namespace 'model_'\n", - " sdk[data_classes_dir / f\"_{file_name}.py\"] = api.generate_data_class_file()\n", - "C:\\Users\\AndersAlbert\\Projects\\internal\\pygen\\cognite\\pygen\\_core\\generators.py:407: UserWarning: Field(s) name in view ViewId(space='cdf_cdm', external_id='Cognite3DModel', version='v1') has potential conflict with protected Pydantic namespace 'model_'\n", - " sdk[data_classes_dir / f\"_{file_name}.py\"] = api.generate_data_class_file()\n", - "C:\\Users\\AndersAlbert\\Projects\\internal\\pygen\\cognite\\pygen\\_core\\generators.py:407: UserWarning: Field(s) in view ViewId(space='cdf_cdm', external_id='Cognite3DRevision', version='v1') has potential conflict with protected Pydantic namespace 'model_'\n", - " sdk[data_classes_dir / f\"_{file_name}.py\"] = api.generate_data_class_file()\n", - "C:\\Users\\AndersAlbert\\Projects\\internal\\pygen\\cognite\\pygen\\_core\\generators.py:407: UserWarning: Field(s) name in view ViewId(space='cdf_cdm', external_id='CogniteCADModel', version='v1') has potential conflict with protected Pydantic namespace 'model_'\n", - " sdk[data_classes_dir / f\"_{file_name}.py\"] = api.generate_data_class_file()\n", - "C:\\Users\\AndersAlbert\\Projects\\internal\\pygen\\cognite\\pygen\\_core\\generators.py:407: UserWarning: Field(s) name in view ViewId(space='cdf_cdm', external_id='CogniteCADNode', version='v1') has potential conflict with protected Pydantic namespace 'model_'\n", - " sdk[data_classes_dir / f\"_{file_name}.py\"] = api.generate_data_class_file()\n", - "C:\\Users\\AndersAlbert\\Projects\\internal\\pygen\\cognite\\pygen\\_core\\generators.py:407: UserWarning: Field(s) in view ViewId(space='cdf_cdm', external_id='CogniteCADRevision', version='v1') has potential conflict with protected Pydantic namespace 'model_'\n", - " sdk[data_classes_dir / f\"_{file_name}.py\"] = api.generate_data_class_file()\n", - "C:\\Users\\AndersAlbert\\Projects\\internal\\pygen\\cognite\\pygen\\_core\\generators.py:407: UserWarning: Field(s) name in view ViewId(space='cdf_cdm', external_id='CognitePointCloudModel', version='v1') has potential conflict with protected Pydantic namespace 'model_'\n", - " sdk[data_classes_dir / f\"_{file_name}.py\"] = api.generate_data_class_file()\n", - "C:\\Users\\AndersAlbert\\Projects\\internal\\pygen\\cognite\\pygen\\_core\\generators.py:407: UserWarning: Field(s) in view ViewId(space='cdf_cdm', external_id='CognitePointCloudRevision', version='v1') has potential conflict with protected Pydantic namespace 'model_'\n", - " sdk[data_classes_dir / f\"_{file_name}.py\"] = api.generate_data_class_file()\n", - "C:\\Users\\AndersAlbert\\Projects\\internal\\pygen\\cognite\\pygen\\_core\\generators.py:407: UserWarning: Field(s) name in view ViewId(space='cdf_cdm', external_id='CognitePointCloudVolume', version='v1') has potential conflict with protected Pydantic namespace 'model_'\n", - " sdk[data_classes_dir / f\"_{file_name}.py\"] = api.generate_data_class_file()\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing SDK to C:\\Users\\ANDERS~1\\AppData\\Local\\Temp\\pygen\\cdf_cdm_CogniteCore_v1\\cognite_core\n", - "Done!\n", - "Added C:\\Users\\ANDERS~1\\AppData\\Local\\Temp\\pygen\\cdf_cdm_CogniteCore_v1 to sys.path to enable import\n", - "Imported cognite_core\n", - "You can now use the generated SDK in the current Python session.\n", - "The data classes are available by importing, for example, `from cognite_core.data_classes import CogniteDescribableWrite`\n" - ] - } - ], - "source": [ - "pygen = generate_sdk_notebook((\"cdf_cdm\", \"CogniteCore\", \"v1\"), client, default_instance_space=data_space)" - ] - }, - { - "cell_type": "markdown", - "id": "f62b610c-dc8f-493c-951c-e091e209b017", - "metadata": {}, - "source": [ - "`pygen` hides the implementation details, the following query gets all `CogniteAsset` with everything that is connected to them. Including `children` and `parent` as we queryied above." - ] - }, - { - "cell_type": "code", - "execution_count": 76, - "id": "9eea446a596c4ecd", - "metadata": { - "ExecuteTime": { - "end_time": "2024-11-09T13:36:24.036087Z", - "start_time": "2024-11-09T13:36:23.515977Z" - } - }, - "outputs": [], - "source": [ - "assets = pygen.cognite_asset.list(space=data_space, retrieve_connections=\"full\")" - ] - }, - { - "cell_type": "code", - "execution_count": 79, - "id": "3a586743a85ae92c", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
spaceexternal_idsource_idsource_contextsourcesource_created_timesource_updated_timesource_created_usersource_updated_username...path_last_updated_timeasset_classasset_typefileschildrenequipmentactivitiestime_seriesnode_typedata_record
0springfield_instancesWMT:23-2ND STAGE COMP DRY GAS SEAL SYS-PH682546NoneNoneNoneNoneNone813723-2ND STAGE COMP DRY GAS SEAL SYS-PH...2024-11-08 14:20:21.633609+00:00NoneNoneNoneNone[{'space': 'springfield_instances', 'external_...NoneNoneNone{'version': 2, 'last_updated_time': 2024-11-08...
1springfield_instancesWMT:230900681760NoneNoneNoneNoneNone8137230900...2024-11-09 13:17:39.283270+00:00NoneNoneNone[{'space': 'springfield_instances', 'external_...[{'space': 'springfield_instances', 'external_...NoneNoneNone{'version': 3, 'last_updated_time': 2024-11-09...
2springfield_instancesWMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH682540NoneNoneNoneNoneNone813723-1ST STAGE COMP DRY GAS SEAL SYS-PH...2024-11-08 14:20:28.094598+00:00NoneNoneNoneNone[{'space': 'springfield_instances', 'external_...NoneNoneNone{'version': 2, 'last_updated_time': 2024-11-08...
3springfield_instancesWMT:23-2ND STAGE COMPRESSION-PH681794NoneNoneNoneNoneNone813723-2ND STAGE COMPRESSION-PH...2024-11-09 13:17:39.283270+00:00NoneNoneNone[{'space': 'springfield_instances', 'external_...NoneNoneNoneNone{'version': 4, 'last_updated_time': 2024-11-09...
4springfield_instancesWMT:23-2ND STAGE COMPRESSOR-PH681825NoneNoneNoneNoneNone813723-2ND STAGE COMPRESSOR-PH...2024-11-09 13:17:39.283270+00:00NoneNoneNoneNone[{'space': 'springfield_instances', 'external_...NoneNoneNone{'version': 4, 'last_updated_time': 2024-11-09...
5springfield_instancesWMT:23-1ST STAGE COMPRESSOR-PH681824NoneNoneNoneNoneNone813723-1ST STAGE COMPRESSOR-PH...2024-11-09 13:17:39.283270+00:00NoneNoneNoneNone[{'space': 'springfield_instances', 'external_...NoneNoneNone{'version': 4, 'last_updated_time': 2024-11-09...
6springfield_instancesWMT:23-1ST STAGE COMP LUBE OIL SYS-PH682544NoneNoneNoneNoneNone813723-1ST STAGE COMP LUBE OIL SYS-PH...2024-11-08 14:21:07.507048+00:00NoneNoneNoneNone[{'space': 'springfield_instances', 'external_...NoneNoneNone{'version': 2, 'last_updated_time': 2024-11-08...
7springfield_instancesWMT:23-1ST STAGE COMP ENCLOSURE-PH682542NoneNoneNoneNoneNone813723-1ST STAGE COMP ENCLOSURE-PH...2024-11-08 14:21:07.507048+00:00NoneNoneNoneNone[{'space': 'springfield_instances', 'external_...NoneNoneNone{'version': 2, 'last_updated_time': 2024-11-08...
8springfield_instancesWMT:23-1ST STAGE COMPRESSION-PH681792NoneNoneNoneNoneNone813723-1ST STAGE COMPRESSION-PH...2024-11-09 13:17:39.283270+00:00NoneNoneNone[{'space': 'springfield_instances', 'external_...[{'space': 'springfield_instances', 'external_...NoneNoneNone{'version': 4, 'last_updated_time': 2024-11-09...
\n", - "

9 rows × 27 columns

\n", - "
" - ], - "text/plain": [ - "CogniteAssetList([CogniteAsset(space='springfield_instances', external_id='WMT:23-2ND STAGE COMP DRY GAS SEAL SYS-PH', data_record=DataRecord(version=2, last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 21, 633000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 316000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='682546', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-2ND STAGE COMP DRY GAS SEAL SYS-PH', description='2ND STAGE COMP DRY GAS SEAL SYS ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 21, 633609, tzinfo=TzInfo(UTC))),\n", - " CogniteAsset(space='springfield_instances', external_id='WMT:230900', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 316000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681760', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='230900', description='GAS COMPRESSION AND RE-INJECTION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", - " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH', data_record=DataRecord(version=2, last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 28, 94000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 27, 925000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='682540', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMP DRY GAS SEAL SYS-PH', description='1ST STAGE COMP DRY GAS SEAL SYS ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 28, 94598, tzinfo=TzInfo(UTC))),\n", - " CogniteAsset(space='springfield_instances', external_id='WMT:23-2ND STAGE COMPRESSION-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 27, 925000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681794', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-2ND STAGE COMPRESSION-PH', description='2ND STAGE COMPRESSION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", - " CogniteAsset(space='springfield_instances', external_id='WMT:23-2ND STAGE COMPRESSOR-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 28, 103000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681825', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-2ND STAGE COMPRESSOR-PH', description='2ND STAGE COMPRESSOR ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", - " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMPRESSOR-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 6, 876000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681824', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMPRESSOR-PH', description='1ST STAGE COMPRESSOR ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", - " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMP LUBE OIL SYS-PH', data_record=DataRecord(version=2, last_updated_time=datetime.datetime(2024, 11, 8, 14, 21, 7, 507000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 6, 876000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='682544', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMP LUBE OIL SYS-PH', description='1ST STAGE COMP LUBE OIL SYS ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 8, 14, 21, 7, 507048, tzinfo=TzInfo(UTC))),\n", - " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMP ENCLOSURE-PH', data_record=DataRecord(version=2, last_updated_time=datetime.datetime(2024, 11, 8, 14, 21, 7, 507000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 6, 876000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='682542', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMP ENCLOSURE-PH', description='1ST STAGE COMP ENCLOSURE ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 8, 14, 21, 7, 507048, tzinfo=TzInfo(UTC))),\n", - " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMPRESSION-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 6, 876000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681792', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMPRESSION-PH', description='1ST STAGE COMPRESSION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC)))])" - ] - }, - "execution_count": 79, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "assets" - ] - }, - { - "cell_type": "code", - "execution_count": 81, - "id": "f7bee710-7689-4348-91a2-2fd6dbc58e7c", - "metadata": {}, - "outputs": [], - "source": [ - "equipments = pygen.cognite_equipment.list(space=data_space, retrieve_connections=\"full\", limit=100)" - ] - }, - { - "cell_type": "code", - "execution_count": 82, - "id": "6f56f6ed-5b9c-471e-a109-9d6ef0b78404", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typenamedescriptionfilesmanufacturerserialNumbersourceIdsourceUpdatedUserasset
0springfield_instancesWMT:23-YAH-96119-0112024-11-08 14:20:20.3652024-11-08 14:20:20.365node23-YAH-96119-01VRD - PH 1STSTGGEAR 2 JOURNBRG NDE : VIBRATION...[]168610000000002936597004911001NaN
1springfield_instancesWMT:23-TAH-96113-0312024-11-08 14:20:20.3652024-11-08 14:20:20.365node23-TAH-96113-03VRD - PH 1STSTGGEAR 2 JOURNBRG NDE : TEMPERATU...[]168610000000002849376961131001NaN
2springfield_instancesWMT:23-PCV-9616322024-11-09 04:00:43.8982024-11-08 14:20:20.365node23-PCV-96163VRD - PH 1STSTG COMP DRY GAS SEAL SYSTEM[]168610000000002298116732871001{'space': 'springfield_instances', 'externalId...
3springfield_instancesWMT:23-TE-96114-0112024-11-08 14:20:20.3652024-11-08 14:20:20.365node23-TE-96114-01VRD - PH 1STSTGGEAR 2 JOURNBRG DE[]168610000000006823513464238137NaN
4springfield_instancesWMT:23-HV-96191-0312024-11-08 14:20:20.3652024-11-08 14:20:20.365node23-HV-96191-03VRD - PH 1STSTGLUBEOIL PSV OUT[]168610000000007168823460259802NaN
.............................................
95springfield_instancesWMT:23-YXY-92526-0312024-11-08 14:20:25.5872024-11-08 14:20:25.587node23-YXY-92526-03VRD - PH 1STSTGSUCTSCRUB B/D[]168610000000007166433470468137NaN
96springfield_instancesWMT:45-TT-9250812024-11-08 14:20:25.5872024-11-08 14:20:25.587node45-TT-92508VRD - PH 1STSTGSUCTCLR COOLMED OUT[]168610000000007104153503629802NaN
97springfield_instancesWMT:23-FG-96180-0112024-11-08 14:20:25.5872024-11-08 14:20:25.587node23-FG-96180-01VRD - PH 1STSTG LUBE OIL FILTER[]168610000000007060343457449802NaN
98springfield_instancesWMT:23-FY-9254312024-11-08 14:20:25.5872024-11-08 14:20:25.587node23-FY-92543VRD - PH 1STSTGCOMP ANTI-SURGE[]168610000000007054233458898137NaN
99springfield_instancesWMT:23-PDT-9614012024-11-08 14:20:25.5872024-11-08 14:20:25.587node23-PDT-96140VRD - INLET AIR PRESSURE DIFFERENTIAL TRANSMITTER[]132710000000009302265265051001NaN
\n", - "

100 rows × 14 columns

\n", - "
" - ], - "text/plain": [ - "NodeList([,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ])" - ] - }, - "execution_count": 82, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "equipment" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "68a510dd-140b-47b4-a52e-46bc2969a1be", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.11" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/docs/docs-dev/docs_query.ipynb b/docs/docs-dev/docs_query.ipynb new file mode 100644 index 000000000..be833df1a --- /dev/null +++ b/docs/docs-dev/docs_query.ipynb @@ -0,0 +1,5022 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "97698baf-35d1-422f-a962-1e28ad07bdb6", + "metadata": {}, + "source": [ + "# Querying Data Modeling\n", + "\n", + "This tutorial demonstrates how to query a data model in Cognite Data Fuction (CDF) with Python \n", + "\n", + "**Prerequisites**\n", + "\n", + "* Installed `cognite-sdk`\n", + "* Setup a service principal to connect to CDF.\n", + "* Use `cognite-toolkit` quickstart to setup configuration and populated the `CogniteCore` Model [Toolkit quickstart](https://docs.cognite.com/cdf/deploy/cdf_toolkit/references/packages/quickstart)" + ] + }, + { + "cell_type": "markdown", + "id": "6268a78f-e8de-482f-832b-20d28333a3b1", + "metadata": {}, + "source": [ + "## Setting up a cognite client" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "3d0b28eb-87fe-453e-9cad-a7f5d8c3fb90", + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-09T13:13:17.005946Z", + "start_time": "2024-11-09T13:13:16.981218Z" + } + }, + "outputs": [], + "source": [ + "import os\n", + "\n", + "from cognite.client import CogniteClient\n", + "from dotenv import load_dotenv\n", + "\n", + "load_dotenv(\"../.env\")\n", + "\n", + "client = CogniteClient.default_oauth_client_credentials(\n", + " project=os.environ[\"CDF_PROJECT\"],\n", + " cdf_cluster=os.environ[\"CDF_CLUSTER\"],\n", + " tenant_id=os.environ[\"IDP_TENANT_ID\"],\n", + " client_id=os.environ[\"IDP_CLIENT_ID\"],\n", + " client_secret=os.environ[\"IDP_CLIENT_SECRET\"],\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "308cb4ec-826a-496e-ae32-2762658ace18", + "metadata": {}, + "source": [ + "## Querying across a direct relation" + ] + }, + { + "cell_type": "markdown", + "id": "6af59c70-5e20-4563-bda5-f1d0eb62ca2d", + "metadata": {}, + "source": [ + "First, we will query across a direct relation. For example, we can get the `parent` starting from `CogniteAsset`" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "2db7c273-c079-4ce7-8ae1-08dbb9f334ac", + "metadata": {}, + "outputs": [], + "source": [ + "from cognite.client import data_modeling as dm\n", + "from cognite.client.data_classes import filters\n", + "\n", + "asset_view = dm.ViewId(\"cdf_cdm\", \"CogniteAsset\", \"v1\")\n", + "# The instance space with the instance demo data\n", + "data_space = \"springfield_instances\"" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "4829284b-429c-4bf2-b4ce-f64d7e848bc1", + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-09T13:23:47.333397Z", + "start_time": "2024-11-09T13:23:47.167740Z" + } + }, + "outputs": [], + "source": [ + "query = dm.query.Query(\n", + " with_={\n", + " \"asset\": dm.query.NodeResultSetExpression(\n", + " limit=10,\n", + " filter=filters.And(filters.HasData(views=[asset_view]), filters.Equals([\"node\", \"space\"], data_space)),\n", + " ),\n", + " \"parent\": dm.query.NodeResultSetExpression(\n", + " from_=\"asset\", through=dm.PropertyId(source=asset_view, property=\"parent\")\n", + " ),\n", + " },\n", + " select={\n", + " \"asset\": dm.query.Select(sources=[dm.query.SourceSelector(source=asset_view, properties=[\"*\"])]),\n", + " \"parent\": dm.query.Select(sources=[dm.query.SourceSelector(source=asset_view, properties=[\"*\"])]),\n", + " },\n", + ")\n", + "\n", + "result = client.data_modeling.instances.query(query)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "38fb49fa-3cff-4fa8-9797-3b134e0f60e3", + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-09T13:23:47.767980Z", + "start_time": "2024-11-09T13:23:47.739654Z" + } + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typepathrootpathLastUpdatedTimenamedescriptionsourceIdsourceUpdatedUserparent
0springfield_instancesWMT:23-2ND STAGE COMP DRY GAS SEAL SYS-PH22024-11-08 14:20:21.6332024-11-08 14:20:20.316node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-08T14:20:21.633609+00:0023-2ND STAGE COMP DRY GAS SEAL SYS-PH2ND STAGE COMP DRY GAS SEAL SYS ON PH6825468137NaN
1springfield_instancesWMT:23090032024-11-09 13:17:39.2832024-11-08 14:20:20.316node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:00230900GAS COMPRESSION AND RE-INJECTION ON PH6817608137NaN
2springfield_instancesWMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH22024-11-08 14:20:28.0942024-11-08 14:20:27.925node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-08T14:20:28.094598+00:0023-1ST STAGE COMP DRY GAS SEAL SYS-PH1ST STAGE COMP DRY GAS SEAL SYS ON PH6825408137NaN
3springfield_instancesWMT:23-2ND STAGE COMPRESSION-PH42024-11-09 13:17:39.2832024-11-08 14:20:27.925node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-2ND STAGE COMPRESSION-PH2ND STAGE COMPRESSION ON PH6817948137{'space': 'springfield_instances', 'externalId...
4springfield_instancesWMT:23-2ND STAGE COMPRESSOR-PH42024-11-09 13:17:39.2832024-11-08 14:20:28.103node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-2ND STAGE COMPRESSOR-PH2ND STAGE COMPRESSOR ON PH6818258137{'space': 'springfield_instances', 'externalId...
5springfield_instancesWMT:23-1ST STAGE COMPRESSOR-PH42024-11-09 13:17:39.2832024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-1ST STAGE COMPRESSOR-PH1ST STAGE COMPRESSOR ON PH6818248137{'space': 'springfield_instances', 'externalId...
6springfield_instancesWMT:23-1ST STAGE COMP LUBE OIL SYS-PH22024-11-08 14:21:07.5072024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-08T14:21:07.507048+00:0023-1ST STAGE COMP LUBE OIL SYS-PH1ST STAGE COMP LUBE OIL SYS ON PH6825448137NaN
7springfield_instancesWMT:23-1ST STAGE COMP ENCLOSURE-PH22024-11-08 14:21:07.5072024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-08T14:21:07.507048+00:0023-1ST STAGE COMP ENCLOSURE-PH1ST STAGE COMP ENCLOSURE ON PH6825428137NaN
8springfield_instancesWMT:23-1ST STAGE COMPRESSION-PH42024-11-09 13:17:39.2832024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-1ST STAGE COMPRESSION-PH1ST STAGE COMPRESSION ON PH6817928137{'space': 'springfield_instances', 'externalId...
\n", + "
" + ], + "text/plain": [ + " space external_id version \\\n", + "0 springfield_instances WMT:23-2ND STAGE COMP DRY GAS SEAL SYS-PH 2 \n", + "1 springfield_instances WMT:230900 3 \n", + "2 springfield_instances WMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH 2 \n", + "3 springfield_instances WMT:23-2ND STAGE COMPRESSION-PH 4 \n", + "4 springfield_instances WMT:23-2ND STAGE COMPRESSOR-PH 4 \n", + "5 springfield_instances WMT:23-1ST STAGE COMPRESSOR-PH 4 \n", + "6 springfield_instances WMT:23-1ST STAGE COMP LUBE OIL SYS-PH 2 \n", + "7 springfield_instances WMT:23-1ST STAGE COMP ENCLOSURE-PH 2 \n", + "8 springfield_instances WMT:23-1ST STAGE COMPRESSION-PH 4 \n", + "\n", + " last_updated_time created_time instance_type \\\n", + "0 2024-11-08 14:20:21.633 2024-11-08 14:20:20.316 node \n", + "1 2024-11-09 13:17:39.283 2024-11-08 14:20:20.316 node \n", + "2 2024-11-08 14:20:28.094 2024-11-08 14:20:27.925 node \n", + "3 2024-11-09 13:17:39.283 2024-11-08 14:20:27.925 node \n", + "4 2024-11-09 13:17:39.283 2024-11-08 14:20:28.103 node \n", + "5 2024-11-09 13:17:39.283 2024-11-08 14:21:06.876 node \n", + "6 2024-11-08 14:21:07.507 2024-11-08 14:21:06.876 node \n", + "7 2024-11-08 14:21:07.507 2024-11-08 14:21:06.876 node \n", + "8 2024-11-09 13:17:39.283 2024-11-08 14:21:06.876 node \n", + "\n", + " path \\\n", + "0 [{'space': 'springfield_instances', 'externalI... \n", + "1 [{'space': 'springfield_instances', 'externalI... \n", + "2 [{'space': 'springfield_instances', 'externalI... \n", + "3 [{'space': 'springfield_instances', 'externalI... \n", + "4 [{'space': 'springfield_instances', 'externalI... \n", + "5 [{'space': 'springfield_instances', 'externalI... \n", + "6 [{'space': 'springfield_instances', 'externalI... \n", + "7 [{'space': 'springfield_instances', 'externalI... \n", + "8 [{'space': 'springfield_instances', 'externalI... \n", + "\n", + " root \\\n", + "0 {'space': 'springfield_instances', 'externalId... \n", + "1 {'space': 'springfield_instances', 'externalId... \n", + "2 {'space': 'springfield_instances', 'externalId... \n", + "3 {'space': 'springfield_instances', 'externalId... \n", + "4 {'space': 'springfield_instances', 'externalId... \n", + "5 {'space': 'springfield_instances', 'externalId... \n", + "6 {'space': 'springfield_instances', 'externalId... \n", + "7 {'space': 'springfield_instances', 'externalId... \n", + "8 {'space': 'springfield_instances', 'externalId... \n", + "\n", + " pathLastUpdatedTime name \\\n", + "0 2024-11-08T14:20:21.633609+00:00 23-2ND STAGE COMP DRY GAS SEAL SYS-PH \n", + "1 2024-11-09T13:17:39.28327+00:00 230900 \n", + "2 2024-11-08T14:20:28.094598+00:00 23-1ST STAGE COMP DRY GAS SEAL SYS-PH \n", + "3 2024-11-09T13:17:39.28327+00:00 23-2ND STAGE COMPRESSION-PH \n", + "4 2024-11-09T13:17:39.28327+00:00 23-2ND STAGE COMPRESSOR-PH \n", + "5 2024-11-09T13:17:39.28327+00:00 23-1ST STAGE COMPRESSOR-PH \n", + "6 2024-11-08T14:21:07.507048+00:00 23-1ST STAGE COMP LUBE OIL SYS-PH \n", + "7 2024-11-08T14:21:07.507048+00:00 23-1ST STAGE COMP ENCLOSURE-PH \n", + "8 2024-11-09T13:17:39.28327+00:00 23-1ST STAGE COMPRESSION-PH \n", + "\n", + " description sourceId sourceUpdatedUser \\\n", + "0 2ND STAGE COMP DRY GAS SEAL SYS ON PH 682546 8137 \n", + "1 GAS COMPRESSION AND RE-INJECTION ON PH 681760 8137 \n", + "2 1ST STAGE COMP DRY GAS SEAL SYS ON PH 682540 8137 \n", + "3 2ND STAGE COMPRESSION ON PH 681794 8137 \n", + "4 2ND STAGE COMPRESSOR ON PH 681825 8137 \n", + "5 1ST STAGE COMPRESSOR ON PH 681824 8137 \n", + "6 1ST STAGE COMP LUBE OIL SYS ON PH 682544 8137 \n", + "7 1ST STAGE COMP ENCLOSURE ON PH 682542 8137 \n", + "8 1ST STAGE COMPRESSION ON PH 681792 8137 \n", + "\n", + " parent \n", + "0 NaN \n", + "1 NaN \n", + "2 NaN \n", + "3 {'space': 'springfield_instances', 'externalId... \n", + "4 {'space': 'springfield_instances', 'externalId... \n", + "5 {'space': 'springfield_instances', 'externalId... \n", + "6 NaN \n", + "7 NaN \n", + "8 {'space': 'springfield_instances', 'externalId... " + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df = result[\"asset\"].to_pandas(expand_properties=True)\n", + "df" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "400c57d2-754e-4c52-92ec-03dc0e9123d7", + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-09T13:23:48.546916Z", + "start_time": "2024-11-09T13:23:48.536611Z" + } + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typepathrootpathLastUpdatedTimenamedescriptionsourceIdsourceUpdatedUserparent
0springfield_instancesWMT:23090032024-11-09 13:17:39.2832024-11-08 14:20:20.316node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:00230900GAS COMPRESSION AND RE-INJECTION ON PH6817608137NaN
1springfield_instancesWMT:23-2ND STAGE COMPRESSION-PH42024-11-09 13:17:39.2832024-11-08 14:20:27.925node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-2ND STAGE COMPRESSION-PH2ND STAGE COMPRESSION ON PH6817948137{'space': 'springfield_instances', 'externalId...
2springfield_instancesWMT:23-1ST STAGE COMPRESSION-PH42024-11-09 13:17:39.2832024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-1ST STAGE COMPRESSION-PH1ST STAGE COMPRESSION ON PH6817928137{'space': 'springfield_instances', 'externalId...
\n", + "
" + ], + "text/plain": [ + "NodeListWithCursor([,\n", + " ,\n", + " ])" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "result[\"parent\"]" + ] + }, + { + "cell_type": "markdown", + "id": "1ef1f8db-e525-4b2f-bf47-dabe93abaf2a", + "metadata": {}, + "source": [ + "## Quering across reverse direct relation of single relation" + ] + }, + { + "cell_type": "markdown", + "id": "c8d8bf72-4907-4064-a509-a9437f9f82f4", + "metadata": {}, + "source": [ + "We can for example query across the `children` in `CogniteAsset`. The `children` property is a reverse direct relation of `parent`, so we query in `inwards` direction towards parent" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "75db7a18-99fe-4656-86a3-d33c9c4acb75", + "metadata": {}, + "outputs": [], + "source": [ + "query = dm.query.Query(\n", + " with_={\n", + " \"asset\": dm.query.NodeResultSetExpression(\n", + " limit=10,\n", + " filter=filters.And(filters.HasData(views=[asset_view]), filters.Equals([\"node\", \"space\"], data_space)),\n", + " ),\n", + " \"children\": dm.query.NodeResultSetExpression(\n", + " from_=\"asset\", through=dm.PropertyId(source=asset_view, property=\"parent\"), direction=\"inwards\"\n", + " ),\n", + " },\n", + " select={\n", + " \"asset\": dm.query.Select(sources=[dm.query.SourceSelector(source=asset_view, properties=[\"*\"])]),\n", + " \"children\": dm.query.Select(sources=[dm.query.SourceSelector(source=asset_view, properties=[\"*\"])]),\n", + " },\n", + ")\n", + "\n", + "result = client.data_modeling.instances.query(query)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "b53e0aff-ac57-4c02-a9a7-b40f1a844dff", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typepathrootpathLastUpdatedTimenamedescriptionsourceIdsourceUpdatedUserparent
0springfield_instancesWMT:23-2ND STAGE COMP DRY GAS SEAL SYS-PH22024-11-08 14:20:21.6332024-11-08 14:20:20.316node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-08T14:20:21.633609+00:0023-2ND STAGE COMP DRY GAS SEAL SYS-PH2ND STAGE COMP DRY GAS SEAL SYS ON PH6825468137NaN
1springfield_instancesWMT:23090032024-11-09 13:17:39.2832024-11-08 14:20:20.316node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:00230900GAS COMPRESSION AND RE-INJECTION ON PH6817608137NaN
2springfield_instancesWMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH22024-11-08 14:20:28.0942024-11-08 14:20:27.925node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-08T14:20:28.094598+00:0023-1ST STAGE COMP DRY GAS SEAL SYS-PH1ST STAGE COMP DRY GAS SEAL SYS ON PH6825408137NaN
3springfield_instancesWMT:23-2ND STAGE COMPRESSION-PH42024-11-09 13:17:39.2832024-11-08 14:20:27.925node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-2ND STAGE COMPRESSION-PH2ND STAGE COMPRESSION ON PH6817948137{'space': 'springfield_instances', 'externalId...
4springfield_instancesWMT:23-2ND STAGE COMPRESSOR-PH42024-11-09 13:17:39.2832024-11-08 14:20:28.103node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-2ND STAGE COMPRESSOR-PH2ND STAGE COMPRESSOR ON PH6818258137{'space': 'springfield_instances', 'externalId...
5springfield_instancesWMT:23-1ST STAGE COMPRESSOR-PH42024-11-09 13:17:39.2832024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-1ST STAGE COMPRESSOR-PH1ST STAGE COMPRESSOR ON PH6818248137{'space': 'springfield_instances', 'externalId...
6springfield_instancesWMT:23-1ST STAGE COMP LUBE OIL SYS-PH22024-11-08 14:21:07.5072024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-08T14:21:07.507048+00:0023-1ST STAGE COMP LUBE OIL SYS-PH1ST STAGE COMP LUBE OIL SYS ON PH6825448137NaN
7springfield_instancesWMT:23-1ST STAGE COMP ENCLOSURE-PH22024-11-08 14:21:07.5072024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-08T14:21:07.507048+00:0023-1ST STAGE COMP ENCLOSURE-PH1ST STAGE COMP ENCLOSURE ON PH6825428137NaN
8springfield_instancesWMT:23-1ST STAGE COMPRESSION-PH42024-11-09 13:17:39.2832024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-1ST STAGE COMPRESSION-PH1ST STAGE COMPRESSION ON PH6817928137{'space': 'springfield_instances', 'externalId...
\n", + "
" + ], + "text/plain": [ + "NodeListWithCursor([,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ])" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "result[\"asset\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "b16d7ff4-9f74-475d-981c-8b197f182878", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typepathrootparentpathLastUpdatedTimenamedescriptionsourceIdsourceUpdatedUser
0springfield_instancesWMT:23-2ND STAGE COMPRESSION-PH42024-11-09 13:17:39.2832024-11-08 14:20:27.925node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-2ND STAGE COMPRESSION-PH2ND STAGE COMPRESSION ON PH6817948137
1springfield_instancesWMT:23-2ND STAGE COMPRESSOR-PH42024-11-09 13:17:39.2832024-11-08 14:20:28.103node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-2ND STAGE COMPRESSOR-PH2ND STAGE COMPRESSOR ON PH6818258137
2springfield_instancesWMT:23-1ST STAGE COMPRESSOR-PH42024-11-09 13:17:39.2832024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-1ST STAGE COMPRESSOR-PH1ST STAGE COMPRESSOR ON PH6818248137
3springfield_instancesWMT:23-1ST STAGE COMPRESSION-PH42024-11-09 13:17:39.2832024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-1ST STAGE COMPRESSION-PH1ST STAGE COMPRESSION ON PH6817928137
\n", + "
" + ], + "text/plain": [ + "NodeListWithCursor([,\n", + " ,\n", + " ,\n", + " ])" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "result[\"children\"]" + ] + }, + { + "cell_type": "markdown", + "id": "bd779189-a9ee-4a54-8a3e-c9b0634929b2", + "metadata": {}, + "source": [ + "## Querying across reverse direct relation of listable relation" + ] + }, + { + "cell_type": "markdown", + "id": "c8b73be4-04f0-4b82-a9f8-364de5e087b4", + "metadata": {}, + "source": [ + "We want all activities connected to equipment. The property `activities` in `CogniteEquipment` is a reverse direct relation of `equipment` in `CogniteActivity`. \n", + "The `/query` enpoint does not support querying accross a reverse direct relation of listable relation. Instead, we will first lookup `CogniteEquipment` and the after we have retrieved the equipment items,\n", + "we will use `/search` to lookup activities that are connected to the equipment we found." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "a2a567c8-e21b-4dec-8fb8-1782f0b9d470", + "metadata": {}, + "outputs": [], + "source": [ + "equipment_view = dm.ViewId(\"cdf_cdm\", \"CogniteEquipment\", \"v1\")\n", + "activity_view = dm.ViewId(\"cdf_cdm\", \"CogniteActivity\", \"v1\")" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "c3d22491-d4a0-4d57-9bb2-03c4434b6daa", + "metadata": {}, + "outputs": [], + "source": [ + "equipment = client.data_modeling.instances.list(limit=100, sources=equipment_view, space=data_space)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "7e8712b9-930e-4732-8df5-a9e113962452", + "metadata": {}, + "outputs": [], + "source": [ + "is_equipment = filters.In(activity_view.as_property_ref(\"equipment\"), [item.as_id() for item in equipment])" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "4070ecce-adcc-4204-8523-74ab36357fd2", + "metadata": {}, + "outputs": [], + "source": [ + "activities = client.data_modeling.instances.search(activity_view, filter=is_equipment, limit=1_000)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "8be52c76-3fcc-4d4e-ba65-f20df5e7ed9c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typeassetsequipmenttimeSeriesnametags
0springfield_instances618699621202269332024-11-09 04:00:55.3282024-11-08 14:20:32.388node[][{'space': 'springfield_instances', 'externalI...[]***-årlig visuell inspeksjon[23-LTX-92529]
1springfield_instances22628430413528532024-11-09 04:00:55.3282024-11-08 14:20:32.968node[][{'space': 'springfield_instances', 'externalI...[]Årlig sampling assessment[23-LTX-92529]
2springfield_instances841340263773196332024-11-09 04:00:55.3282024-11-08 14:20:37.196node[][{'space': 'springfield_instances', 'externalI...[]Årlig sampling assessment[23-LTX-92529]
3springfield_instances702241132917179232024-11-09 04:00:55.3282024-11-08 14:20:48.208node[][{'space': 'springfield_instances', 'externalI...[]Årlig sampling assessment[23-LTX-92529]
4springfield_instances164184305118770932024-11-09 04:00:55.3282024-11-08 14:20:53.101node[][{'space': 'springfield_instances', 'externalI...[]Årlig sampling assessment[23-LTX-92529]
....................................
995springfield_instances669704022184023152024-11-09 13:18:44.0932024-11-08 14:21:02.745node[][{'space': 'springfield_instances', 'externalI...[{'space': 'springfield_instances', 'externalI...[23-PDT-96167]
996springfield_instances797764897384164352024-11-09 13:18:44.0932024-11-08 14:21:02.745node[][{'space': 'springfield_instances', 'externalI...[{'space': 'springfield_instances', 'externalI...*** Monthly monitoring[23-TT-96181-03]
997springfield_instances148381228363641252024-11-09 13:18:44.0932024-11-08 14:21:02.745node[][{'space': 'springfield_instances', 'externalI...[{'space': 'springfield_instances', 'externalI...***-årlig visuell inspeksjon[23-VA-9110-M01]
998springfield_instances651266242712581652024-11-09 13:18:44.1762024-11-08 14:20:36.244node[][{'space': 'springfield_instances', 'externalI...[{'space': 'springfield_instances', 'externalI...IPL/SIF - Funksjonstest av Sikkerhetskritisk I...[23-TT-96181-03]
999springfield_instances84022349052416752024-11-09 13:18:44.1762024-11-08 14:20:36.244node[][{'space': 'springfield_instances', 'externalI...[{'space': 'springfield_instances', 'externalI...Ettersyn av instrumentering[23-PT-96186-03]
\n", + "

1000 rows × 11 columns

\n", + "
" + ], + "text/plain": [ + "NodeList([,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ])" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "activities" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "35f354f5-b30b-4474-bf30-e10f90a1c59a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typenamedescriptionfilesmanufacturerserialNumbersourceIdsourceUpdatedUserasset
0springfield_instancesWMT:23-YAH-96119-0112024-11-08 14:20:20.3652024-11-08 14:20:20.365node23-YAH-96119-01VRD - PH 1STSTGGEAR 2 JOURNBRG NDE : VIBRATION...[]168610000000002936597004911001NaN
1springfield_instancesWMT:23-TAH-96113-0312024-11-08 14:20:20.3652024-11-08 14:20:20.365node23-TAH-96113-03VRD - PH 1STSTGGEAR 2 JOURNBRG NDE : TEMPERATU...[]168610000000002849376961131001NaN
2springfield_instancesWMT:23-PCV-9616322024-11-09 04:00:43.8982024-11-08 14:20:20.365node23-PCV-96163VRD - PH 1STSTG COMP DRY GAS SEAL SYSTEM[]168610000000002298116732871001{'space': 'springfield_instances', 'externalId...
3springfield_instancesWMT:23-TE-96114-0112024-11-08 14:20:20.3652024-11-08 14:20:20.365node23-TE-96114-01VRD - PH 1STSTGGEAR 2 JOURNBRG DE[]168610000000006823513464238137NaN
4springfield_instancesWMT:23-HV-96191-0312024-11-08 14:20:20.3652024-11-08 14:20:20.365node23-HV-96191-03VRD - PH 1STSTGLUBEOIL PSV OUT[]168610000000007168823460259802NaN
.............................................
95springfield_instancesWMT:23-YXY-92526-0312024-11-08 14:20:25.5872024-11-08 14:20:25.587node23-YXY-92526-03VRD - PH 1STSTGSUCTSCRUB B/D[]168610000000007166433470468137NaN
96springfield_instancesWMT:45-TT-9250812024-11-08 14:20:25.5872024-11-08 14:20:25.587node45-TT-92508VRD - PH 1STSTGSUCTCLR COOLMED OUT[]168610000000007104153503629802NaN
97springfield_instancesWMT:23-FG-96180-0112024-11-08 14:20:25.5872024-11-08 14:20:25.587node23-FG-96180-01VRD - PH 1STSTG LUBE OIL FILTER[]168610000000007060343457449802NaN
98springfield_instancesWMT:23-FY-9254312024-11-08 14:20:25.5872024-11-08 14:20:25.587node23-FY-92543VRD - PH 1STSTGCOMP ANTI-SURGE[]168610000000007054233458898137NaN
99springfield_instancesWMT:23-PDT-9614012024-11-08 14:20:25.5872024-11-08 14:20:25.587node23-PDT-96140VRD - INLET AIR PRESSURE DIFFERENTIAL TRANSMITTER[]132710000000009302265265051001NaN
\n", + "

100 rows × 14 columns

\n", + "
" + ], + "text/plain": [ + "NodeList([,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ])" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "equipment" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "dc0d804e-0cc2-46d4-aacd-852a5cdf4979", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "0940bde6-592b-4744-b27e-7de844372e3e", + "metadata": {}, + "source": [ + "## Quering across edge" + ] + }, + { + "cell_type": "markdown", + "id": "8636130c-ac6e-48a2-9cb5-1d76f3e73996", + "metadata": {}, + "source": [ + "We will use thes `CogniteAnnotations` to find all assets connected to a file.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "8d4d91fe-b848-46d6-9469-3eb296ef22a2", + "metadata": {}, + "outputs": [], + "source": [ + "file_view = dm.ViewId(\"cdf_cdm\", \"CogniteFile\", \"v1\")\n", + "annotation_view = dm.ViewId(\"cdf_cdm\", \"CogniteDiagramAnnotation\", \"v1\")" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "5b89b35a-555d-47b4-a449-8509f959c3de", + "metadata": {}, + "outputs": [], + "source": [ + "query = dm.query.Query(\n", + " with_={\n", + " \"file\": dm.query.NodeResultSetExpression(\n", + " limit=10,\n", + " filter=filters.And(filters.HasData(views=[file_view]), filters.Equals([\"node\", \"space\"], data_space)),\n", + " ),\n", + " \"annotation\": dm.query.EdgeResultSetExpression(\n", + " from_=\"file\", direction=\"outwards\", filter=filters.HasData(views=[annotation_view])\n", + " ),\n", + " \"asset\": dm.query.NodeResultSetExpression(from_=\"annotation\", filter=filters.HasData(views=[asset_view])),\n", + " },\n", + " select={\n", + " \"file\": dm.query.Select(sources=[dm.query.SourceSelector(source=file_view, properties=[\"*\"])]),\n", + " \"annotation\": dm.query.Select(sources=[dm.query.SourceSelector(source=annotation_view, properties=[\"*\"])]),\n", + " \"asset\": dm.query.Select(sources=[dm.query.SourceSelector(source=asset_view, properties=[\"*\"])]),\n", + " },\n", + ")\n", + "\n", + "result = client.data_modeling.instances.query(query)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "47553d13-3c08-4cc2-81ef-43758acbfa12", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typenameassetsmimeTypeisUploadeduploadedTime
0springfield_instancesVAL_PH-25578-P-4110006-001.pdf62024-11-09 12:59:09.1042024-11-08 14:13:43.301nodePH-25578-P-4110006-001.pdf[]application/pdfTrue2024-11-09T12:59:08.963+00:00
1springfield_instancesVAL_PH-25578-P-4110010-001.pdf62024-11-09 12:59:09.2522024-11-08 14:13:43.301nodePH-25578-P-4110010-001.pdf[]application/pdfTrue2024-11-09T12:59:09.221+00:00
2springfield_instancesVAL_PH-25578-P-4110119-001.pdf62024-11-09 12:59:09.5212024-11-08 14:13:43.301nodePH-25578-P-4110119-001.pdf[]application/pdfTrue2024-11-09T12:59:09.493+00:00
3springfield_instancesVAL_PH-ME-P-0003-001.pdf62024-11-09 12:59:10.3242024-11-08 14:13:43.301nodePH-ME-P-0003-001.pdf[]application/pdfTrue2024-11-09T12:59:09.781+00:00
4springfield_instancesVAL_PH-ME-P-0004-001.pdf62024-11-09 12:59:10.0352024-11-08 14:13:43.301nodePH-ME-P-0004-001.pdf[]application/pdfTrue2024-11-09T12:59:10.007+00:00
5springfield_instancesVAL_PH-ME-P-0151-001.pdf62024-11-09 12:59:10.4722024-11-08 14:13:43.301nodePH-ME-P-0151-001.pdf[]application/pdfTrue2024-11-09T12:59:10.446+00:00
6springfield_instancesVAL_PH-ME-P-0152-001.pdf62024-11-09 12:59:10.7332024-11-08 14:13:43.301nodePH-ME-P-0152-001.pdf[]application/pdfTrue2024-11-09T12:59:10.707+00:00
7springfield_instancesVAL_PH-ME-P-0153-001.pdf62024-11-09 12:59:10.9782024-11-08 14:13:43.301nodePH-ME-P-0153-001.pdf[]application/pdfTrue2024-11-09T12:59:10.947+00:00
8springfield_instancesVAL_PH-ME-P-0156-001.pdf62024-11-09 12:59:11.3052024-11-08 14:13:43.301nodePH-ME-P-0156-001.pdf[]application/pdfTrue2024-11-09T12:59:11.277+00:00
9springfield_instancesVAL_PH-ME-P-0156-002.pdf62024-11-09 12:59:11.6062024-11-08 14:13:43.301nodePH-ME-P-0156-002.pdf[]application/pdfTrue2024-11-09T12:59:11.562+00:00
\n", + "
" + ], + "text/plain": [ + "NodeListWithCursor([,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ,\n", + " ])" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "result[\"file\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "id": "0a7d43a9-5158-420b-85fe-8e1b7151db4c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typepropertiestypestart_nodeend_node
0springfield_instancesspringfield_instances:VAL_PH-25578-P-4110006-0...22024-11-09 13:19:46.7862024-11-09 04:03:32.334edge{'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...
1springfield_instancesspringfield_instances:VAL_PH-25578-P-4110006-0...22024-11-09 13:19:46.7862024-11-09 04:03:32.334edge{'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...
2springfield_instancesspringfield_instances:VAL_PH-25578-P-4110006-0...22024-11-09 13:19:46.7862024-11-09 04:03:32.334edge{'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...
3springfield_instancesspringfield_instances:VAL_PH-25578-P-4110006-0...22024-11-09 13:19:46.7862024-11-09 04:03:32.334edge{'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...
4springfield_instancesspringfield_instances:VAL_PH-25578-P-4110006-0...22024-11-09 13:19:46.7862024-11-09 04:03:32.334edge{'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...
\n", + "
" + ], + "text/plain": [ + " space external_id \\\n", + "0 springfield_instances springfield_instances:VAL_PH-25578-P-4110006-0... \n", + "1 springfield_instances springfield_instances:VAL_PH-25578-P-4110006-0... \n", + "2 springfield_instances springfield_instances:VAL_PH-25578-P-4110006-0... \n", + "3 springfield_instances springfield_instances:VAL_PH-25578-P-4110006-0... \n", + "4 springfield_instances springfield_instances:VAL_PH-25578-P-4110006-0... \n", + "\n", + " version last_updated_time created_time instance_type \\\n", + "0 2 2024-11-09 13:19:46.786 2024-11-09 04:03:32.334 edge \n", + "1 2 2024-11-09 13:19:46.786 2024-11-09 04:03:32.334 edge \n", + "2 2 2024-11-09 13:19:46.786 2024-11-09 04:03:32.334 edge \n", + "3 2 2024-11-09 13:19:46.786 2024-11-09 04:03:32.334 edge \n", + "4 2 2024-11-09 13:19:46.786 2024-11-09 04:03:32.334 edge \n", + "\n", + " properties \\\n", + "0 {'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'... \n", + "1 {'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'... \n", + "2 {'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'... \n", + "3 {'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'... \n", + "4 {'cdf_cdm': {'CogniteDiagramAnnotation/v1': {'... \n", + "\n", + " type \\\n", + "0 {'space': 'springfield_instances', 'external_i... \n", + "1 {'space': 'springfield_instances', 'external_i... \n", + "2 {'space': 'springfield_instances', 'external_i... \n", + "3 {'space': 'springfield_instances', 'external_i... \n", + "4 {'space': 'springfield_instances', 'external_i... \n", + "\n", + " start_node \\\n", + "0 {'space': 'springfield_instances', 'external_i... \n", + "1 {'space': 'springfield_instances', 'external_i... \n", + "2 {'space': 'springfield_instances', 'external_i... \n", + "3 {'space': 'springfield_instances', 'external_i... \n", + "4 {'space': 'springfield_instances', 'external_i... \n", + "\n", + " end_node \n", + "0 {'space': 'springfield_instances', 'external_i... \n", + "1 {'space': 'springfield_instances', 'external_i... \n", + "2 {'space': 'springfield_instances', 'external_i... \n", + "3 {'space': 'springfield_instances', 'external_i... \n", + "4 {'space': 'springfield_instances', 'external_i... " + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "result[\"annotation\"].to_pandas().head()" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "ab76174e-7d2b-4e8e-b38b-5c558465bd6a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idversionlast_updated_timecreated_timeinstance_typepathrootparentpathLastUpdatedTimenamedescriptionsourceIdsourceUpdatedUser
0springfield_instancesWMT:23-2ND STAGE COMPRESSOR-PH42024-11-09 13:17:39.2832024-11-08 14:20:28.103node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-2ND STAGE COMPRESSOR-PH2ND STAGE COMPRESSOR ON PH6818258137
1springfield_instancesWMT:23-1ST STAGE COMPRESSOR-PH42024-11-09 13:17:39.2832024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...{'space': 'springfield_instances', 'externalId...2024-11-09T13:17:39.28327+00:0023-1ST STAGE COMPRESSOR-PH1ST STAGE COMPRESSOR ON PH6818248137
2springfield_instancesWMT:23-1ST STAGE COMP LUBE OIL SYS-PH22024-11-08 14:21:07.5072024-11-08 14:21:06.876node[{'space': 'springfield_instances', 'externalI...{'space': 'springfield_instances', 'externalId...NaN2024-11-08T14:21:07.507048+00:0023-1ST STAGE COMP LUBE OIL SYS-PH1ST STAGE COMP LUBE OIL SYS ON PH6825448137
\n", + "
" + ], + "text/plain": [ + "NodeListWithCursor([,\n", + " ,\n", + " ])" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "result[\"asset\"]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5e9e841e-3245-4345-be00-c49f4145b8a7", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "879bd08bec12e3d0", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "9756b95d716eb59", + "metadata": {}, + "source": [ + "# Querying with pygen\n", + "\n", + "`pygen` is a code generator that generates Python code tailored to your data model.\n", + "\n", + "**Prerequisites**\n", + "\n", + "* Installed `cognite-pygen`" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "id": "24e32802a16755a3", + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-09T13:24:36.057885Z", + "start_time": "2024-11-09T13:24:30.626534Z" + } + }, + "outputs": [], + "source": [ + "from cognite.pygen import generate_sdk_notebook" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "id": "42fc517e-26e7-4bb6-96de-a9114f58cd6f", + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-09T13:28:13.528432Z", + "start_time": "2024-11-09T13:28:06.611839Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Successfully retrieved data model(s) ('cdf_cdm', 'CogniteCore', 'v1')\n", + "Cleaned temporary directory C:\\Users\\ANDERS~1\\AppData\\Local\\Temp\\pygen\\cdf_cdm_CogniteCore_v1\n", + "Writing SDK to C:\\Users\\ANDERS~1\\AppData\\Local\\Temp\\pygen\\cdf_cdm_CogniteCore_v1\\cognite_core\n", + "Done!\n", + "Added C:\\Users\\ANDERS~1\\AppData\\Local\\Temp\\pygen\\cdf_cdm_CogniteCore_v1 to sys.path to enable import\n", + "Imported cognite_core\n", + "You can now use the generated SDK in the current Python session.\n", + "The data classes are available by importing, for example, `from cognite_core.data_classes import CogniteDescribableWrite`\n" + ] + } + ], + "source": [ + "pygen = generate_sdk_notebook((\"cdf_cdm\", \"CogniteCore\", \"v1\"), client, default_instance_space=data_space)" + ] + }, + { + "cell_type": "markdown", + "id": "f62b610c-dc8f-493c-951c-e091e209b017", + "metadata": {}, + "source": [ + "`pygen` enables you to use your data types diretly" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "id": "9eea446a596c4ecd", + "metadata": { + "ExecuteTime": { + "end_time": "2024-11-09T13:36:24.036087Z", + "start_time": "2024-11-09T13:36:23.515977Z" + } + }, + "outputs": [], + "source": [ + "assets = pygen.cognite_asset.list(space=data_space)" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "3a586743a85ae92c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idsource_idsource_updated_usernamedescriptionparentrootpathpath_last_updated_timedata_record
0springfield_instancesWMT:23-2ND STAGE COMP DRY GAS SEAL SYS-PH682546813723-2ND STAGE COMP DRY GAS SEAL SYS-PH2ND STAGE COMP DRY GAS SEAL SYS ON PHNoneWMT:23-2ND STAGE COMP DRY GAS SEAL SYS-PH[WMT:23-2ND STAGE COMP DRY GAS SEAL SYS-PH]2024-11-08 14:20:21.633609+00:00{'version': 2, 'last_updated_time': 2024-11-08...
1springfield_instancesWMT:2309006817608137230900GAS COMPRESSION AND RE-INJECTION ON PHNoneWMT:230900[WMT:230900]2024-11-09 13:17:39.283270+00:00{'version': 3, 'last_updated_time': 2024-11-09...
2springfield_instancesWMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH682540813723-1ST STAGE COMP DRY GAS SEAL SYS-PH1ST STAGE COMP DRY GAS SEAL SYS ON PHNoneWMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH[WMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH]2024-11-08 14:20:28.094598+00:00{'version': 2, 'last_updated_time': 2024-11-08...
3springfield_instancesWMT:23-2ND STAGE COMPRESSION-PH681794813723-2ND STAGE COMPRESSION-PH2ND STAGE COMPRESSION ON PHWMT:230900WMT:230900[WMT:230900, WMT:23-2ND STAGE COMPRESSION-PH]2024-11-09 13:17:39.283270+00:00{'version': 4, 'last_updated_time': 2024-11-09...
4springfield_instancesWMT:23-2ND STAGE COMPRESSOR-PH681825813723-2ND STAGE COMPRESSOR-PH2ND STAGE COMPRESSOR ON PHWMT:23-2ND STAGE COMPRESSION-PHWMT:230900[WMT:230900, WMT:23-2ND STAGE COMPRESSION-PH, ...2024-11-09 13:17:39.283270+00:00{'version': 4, 'last_updated_time': 2024-11-09...
5springfield_instancesWMT:23-1ST STAGE COMPRESSOR-PH681824813723-1ST STAGE COMPRESSOR-PH1ST STAGE COMPRESSOR ON PHWMT:23-1ST STAGE COMPRESSION-PHWMT:230900[WMT:230900, WMT:23-1ST STAGE COMPRESSION-PH, ...2024-11-09 13:17:39.283270+00:00{'version': 4, 'last_updated_time': 2024-11-09...
6springfield_instancesWMT:23-1ST STAGE COMP LUBE OIL SYS-PH682544813723-1ST STAGE COMP LUBE OIL SYS-PH1ST STAGE COMP LUBE OIL SYS ON PHNoneWMT:23-1ST STAGE COMP LUBE OIL SYS-PH[WMT:23-1ST STAGE COMP LUBE OIL SYS-PH]2024-11-08 14:21:07.507048+00:00{'version': 2, 'last_updated_time': 2024-11-08...
7springfield_instancesWMT:23-1ST STAGE COMP ENCLOSURE-PH682542813723-1ST STAGE COMP ENCLOSURE-PH1ST STAGE COMP ENCLOSURE ON PHNoneWMT:23-1ST STAGE COMP ENCLOSURE-PH[WMT:23-1ST STAGE COMP ENCLOSURE-PH]2024-11-08 14:21:07.507048+00:00{'version': 2, 'last_updated_time': 2024-11-08...
8springfield_instancesWMT:23-1ST STAGE COMPRESSION-PH681792813723-1ST STAGE COMPRESSION-PH1ST STAGE COMPRESSION ON PHWMT:230900WMT:230900[WMT:230900, WMT:23-1ST STAGE COMPRESSION-PH]2024-11-09 13:17:39.283270+00:00{'version': 4, 'last_updated_time': 2024-11-09...
\n", + "
" + ], + "text/plain": [ + "CogniteAssetList([CogniteAsset(space='springfield_instances', external_id='WMT:23-2ND STAGE COMP DRY GAS SEAL SYS-PH', data_record=DataRecord(version=2, last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 21, 633000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 316000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='682546', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-2ND STAGE COMP DRY GAS SEAL SYS-PH', description='2ND STAGE COMP DRY GAS SEAL SYS ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 21, 633609, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:230900', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 316000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681760', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='230900', description='GAS COMPRESSION AND RE-INJECTION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH', data_record=DataRecord(version=2, last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 28, 94000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 27, 925000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='682540', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMP DRY GAS SEAL SYS-PH', description='1ST STAGE COMP DRY GAS SEAL SYS ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 28, 94598, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-2ND STAGE COMPRESSION-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 27, 925000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681794', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-2ND STAGE COMPRESSION-PH', description='2ND STAGE COMPRESSION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-2ND STAGE COMPRESSOR-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 28, 103000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681825', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-2ND STAGE COMPRESSOR-PH', description='2ND STAGE COMPRESSOR ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMPRESSOR-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 6, 876000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681824', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMPRESSOR-PH', description='1ST STAGE COMPRESSOR ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMP LUBE OIL SYS-PH', data_record=DataRecord(version=2, last_updated_time=datetime.datetime(2024, 11, 8, 14, 21, 7, 507000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 6, 876000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='682544', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMP LUBE OIL SYS-PH', description='1ST STAGE COMP LUBE OIL SYS ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 8, 14, 21, 7, 507048, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMP ENCLOSURE-PH', data_record=DataRecord(version=2, last_updated_time=datetime.datetime(2024, 11, 8, 14, 21, 7, 507000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 6, 876000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='682542', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMP ENCLOSURE-PH', description='1ST STAGE COMP ENCLOSURE ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 8, 14, 21, 7, 507048, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMPRESSION-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 6, 876000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681792', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMPRESSION-PH', description='1ST STAGE COMPRESSION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC)))])" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "assets" + ] + }, + { + "cell_type": "markdown", + "id": "ebecf3c7-eea4-44fb-893a-cf2ef98da56c", + "metadata": {}, + "source": [ + "To get the `parent` and `children` as well as all other connections to each asset we can set the parameter `retrieve_connections='full'`" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "id": "ae711297-1fba-41fe-b677-617a3c734bd9", + "metadata": {}, + "outputs": [], + "source": [ + "assets = pygen.cognite_asset.list(space=data_space, retrieve_connections=\"full\")" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "id": "299cfaca-6af9-45bf-b74b-c6ce4c57f725", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idsource_idsource_updated_usernamedescriptionparentrootpathpath_last_updated_timechildrenequipmentdata_record
0springfield_instancesWMT:23-2ND STAGE COMP DRY GAS SEAL SYS-PH682546813723-2ND STAGE COMP DRY GAS SEAL SYS-PH2ND STAGE COMP DRY GAS SEAL SYS ON PHNone{'space': 'springfield_instances', 'external_i...[{'space': 'springfield_instances', 'external_...2024-11-08 14:20:21.633609+00:00None[{'space': 'springfield_instances', 'external_...{'version': 2, 'last_updated_time': 2024-11-08...
1springfield_instancesWMT:2309006817608137230900GAS COMPRESSION AND RE-INJECTION ON PHNone{'space': 'springfield_instances', 'external_i...[{'space': 'springfield_instances', 'external_...2024-11-09 13:17:39.283270+00:00[{'space': 'springfield_instances', 'external_...[{'space': 'springfield_instances', 'external_...{'version': 3, 'last_updated_time': 2024-11-09...
2springfield_instancesWMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH682540813723-1ST STAGE COMP DRY GAS SEAL SYS-PH1ST STAGE COMP DRY GAS SEAL SYS ON PHNone{'space': 'springfield_instances', 'external_i...[{'space': 'springfield_instances', 'external_...2024-11-08 14:20:28.094598+00:00None[{'space': 'springfield_instances', 'external_...{'version': 2, 'last_updated_time': 2024-11-08...
3springfield_instancesWMT:23-2ND STAGE COMPRESSION-PH681794813723-2ND STAGE COMPRESSION-PH2ND STAGE COMPRESSION ON PH{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...[{'space': 'springfield_instances', 'external_...2024-11-09 13:17:39.283270+00:00[{'space': 'springfield_instances', 'external_...None{'version': 4, 'last_updated_time': 2024-11-09...
4springfield_instancesWMT:23-2ND STAGE COMPRESSOR-PH681825813723-2ND STAGE COMPRESSOR-PH2ND STAGE COMPRESSOR ON PH{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...[{'space': 'springfield_instances', 'external_...2024-11-09 13:17:39.283270+00:00None[{'space': 'springfield_instances', 'external_...{'version': 4, 'last_updated_time': 2024-11-09...
5springfield_instancesWMT:23-1ST STAGE COMPRESSOR-PH681824813723-1ST STAGE COMPRESSOR-PH1ST STAGE COMPRESSOR ON PH{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...[{'space': 'springfield_instances', 'external_...2024-11-09 13:17:39.283270+00:00None[{'space': 'springfield_instances', 'external_...{'version': 4, 'last_updated_time': 2024-11-09...
6springfield_instancesWMT:23-1ST STAGE COMP LUBE OIL SYS-PH682544813723-1ST STAGE COMP LUBE OIL SYS-PH1ST STAGE COMP LUBE OIL SYS ON PHNone{'space': 'springfield_instances', 'external_i...[{'space': 'springfield_instances', 'external_...2024-11-08 14:21:07.507048+00:00None[{'space': 'springfield_instances', 'external_...{'version': 2, 'last_updated_time': 2024-11-08...
7springfield_instancesWMT:23-1ST STAGE COMP ENCLOSURE-PH682542813723-1ST STAGE COMP ENCLOSURE-PH1ST STAGE COMP ENCLOSURE ON PHNone{'space': 'springfield_instances', 'external_i...[{'space': 'springfield_instances', 'external_...2024-11-08 14:21:07.507048+00:00None[{'space': 'springfield_instances', 'external_...{'version': 2, 'last_updated_time': 2024-11-08...
8springfield_instancesWMT:23-1ST STAGE COMPRESSION-PH681792813723-1ST STAGE COMPRESSION-PH1ST STAGE COMPRESSION ON PH{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...[{'space': 'springfield_instances', 'external_...2024-11-09 13:17:39.283270+00:00[{'space': 'springfield_instances', 'external_...[{'space': 'springfield_instances', 'external_...{'version': 4, 'last_updated_time': 2024-11-09...
\n", + "
" + ], + "text/plain": [ + "CogniteAssetList([CogniteAsset(space='springfield_instances', external_id='WMT:23-2ND STAGE COMP DRY GAS SEAL SYS-PH', data_record=DataRecord(version=2, last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 21, 633000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 316000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='682546', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-2ND STAGE COMP DRY GAS SEAL SYS-PH', description='2ND STAGE COMP DRY GAS SEAL SYS ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 21, 633609, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:230900', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 316000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681760', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='230900', description='GAS COMPRESSION AND RE-INJECTION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH', data_record=DataRecord(version=2, last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 28, 94000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 27, 925000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='682540', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMP DRY GAS SEAL SYS-PH', description='1ST STAGE COMP DRY GAS SEAL SYS ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 28, 94598, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-2ND STAGE COMPRESSION-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 27, 925000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681794', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-2ND STAGE COMPRESSION-PH', description='2ND STAGE COMPRESSION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-2ND STAGE COMPRESSOR-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 28, 103000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681825', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-2ND STAGE COMPRESSOR-PH', description='2ND STAGE COMPRESSOR ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMPRESSOR-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 6, 876000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681824', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMPRESSOR-PH', description='1ST STAGE COMPRESSOR ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMP LUBE OIL SYS-PH', data_record=DataRecord(version=2, last_updated_time=datetime.datetime(2024, 11, 8, 14, 21, 7, 507000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 6, 876000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='682544', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMP LUBE OIL SYS-PH', description='1ST STAGE COMP LUBE OIL SYS ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 8, 14, 21, 7, 507048, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMP ENCLOSURE-PH', data_record=DataRecord(version=2, last_updated_time=datetime.datetime(2024, 11, 8, 14, 21, 7, 507000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 6, 876000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='682542', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMP ENCLOSURE-PH', description='1ST STAGE COMP ENCLOSURE ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 8, 14, 21, 7, 507048, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMPRESSION-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 6, 876000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681792', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMPRESSION-PH', description='1ST STAGE COMPRESSION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC)))])" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "assets" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "id": "2a87f916-fb3f-400f-aa5b-005fe6d06f9f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idsource_idsource_updated_usernamedescriptionparentrootpathpath_last_updated_timedata_record
0springfield_instancesWMT:2309006817608137230900GAS COMPRESSION AND RE-INJECTION ON PHNoneWMT:230900[WMT:230900]2024-11-09 13:17:39.283270+00:00{'version': 3, 'last_updated_time': 2024-11-09...
1springfield_instancesWMT:23-2ND STAGE COMPRESSION-PH681794813723-2ND STAGE COMPRESSION-PH2ND STAGE COMPRESSION ON PHWMT:230900WMT:230900[WMT:230900, WMT:23-2ND STAGE COMPRESSION-PH]2024-11-09 13:17:39.283270+00:00{'version': 4, 'last_updated_time': 2024-11-09...
2springfield_instancesWMT:23-1ST STAGE COMPRESSION-PH681792813723-1ST STAGE COMPRESSION-PH1ST STAGE COMPRESSION ON PHWMT:230900WMT:230900[WMT:230900, WMT:23-1ST STAGE COMPRESSION-PH]2024-11-09 13:17:39.283270+00:00{'version': 4, 'last_updated_time': 2024-11-09...
3springfield_instancesWMT:2309006817608137230900GAS COMPRESSION AND RE-INJECTION ON PHNoneWMT:230900[WMT:230900]2024-11-09 13:17:39.283270+00:00{'version': 3, 'last_updated_time': 2024-11-09...
\n", + "
" + ], + "text/plain": [ + "CogniteAssetList([CogniteAsset(space='springfield_instances', external_id='WMT:230900', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 316000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681760', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='230900', description='GAS COMPRESSION AND RE-INJECTION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-2ND STAGE COMPRESSION-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 27, 925000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681794', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-2ND STAGE COMPRESSION-PH', description='2ND STAGE COMPRESSION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMPRESSION-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 6, 876000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681792', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMPRESSION-PH', description='1ST STAGE COMPRESSION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:230900', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 316000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681760', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='230900', description='GAS COMPRESSION AND RE-INJECTION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC)))])" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "assets.parent" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "id": "53529abc-1c91-4e1d-abc0-a582eff58057", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idsource_idsource_updated_usernamedescriptionparentrootpathpath_last_updated_timedata_record
0springfield_instancesWMT:23-2ND STAGE COMPRESSION-PH681794813723-2ND STAGE COMPRESSION-PH2ND STAGE COMPRESSION ON PHWMT:230900WMT:230900[WMT:230900, WMT:23-2ND STAGE COMPRESSION-PH]2024-11-09 13:17:39.283270+00:00{'version': 4, 'last_updated_time': 2024-11-09...
1springfield_instancesWMT:23-1ST STAGE COMPRESSION-PH681792813723-1ST STAGE COMPRESSION-PH1ST STAGE COMPRESSION ON PHWMT:230900WMT:230900[WMT:230900, WMT:23-1ST STAGE COMPRESSION-PH]2024-11-09 13:17:39.283270+00:00{'version': 4, 'last_updated_time': 2024-11-09...
2springfield_instancesWMT:23-2ND STAGE COMPRESSOR-PH681825813723-2ND STAGE COMPRESSOR-PH2ND STAGE COMPRESSOR ON PHWMT:23-2ND STAGE COMPRESSION-PHWMT:230900[WMT:230900, WMT:23-2ND STAGE COMPRESSION-PH, ...2024-11-09 13:17:39.283270+00:00{'version': 4, 'last_updated_time': 2024-11-09...
3springfield_instancesWMT:23-1ST STAGE COMPRESSOR-PH681824813723-1ST STAGE COMPRESSOR-PH1ST STAGE COMPRESSOR ON PHWMT:23-1ST STAGE COMPRESSION-PHWMT:230900[WMT:230900, WMT:23-1ST STAGE COMPRESSION-PH, ...2024-11-09 13:17:39.283270+00:00{'version': 4, 'last_updated_time': 2024-11-09...
\n", + "
" + ], + "text/plain": [ + "CogniteAssetList([CogniteAsset(space='springfield_instances', external_id='WMT:23-2ND STAGE COMPRESSION-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 27, 925000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681794', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-2ND STAGE COMPRESSION-PH', description='2ND STAGE COMPRESSION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMPRESSION-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 6, 876000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681792', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMPRESSION-PH', description='1ST STAGE COMPRESSION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-2ND STAGE COMPRESSOR-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 28, 103000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681825', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-2ND STAGE COMPRESSOR-PH', description='2ND STAGE COMPRESSOR ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMPRESSOR-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 6, 876000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681824', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMPRESSOR-PH', description='1ST STAGE COMPRESSOR ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC)))])" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "assets.children" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1004ba53-85d1-4247-b2f4-eeac4d69d0d3", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "b7cb4c26-41ba-47be-8113-6f265ac3f2e7", + "metadata": {}, + "source": [ + "Similarily we can get the `CogniteEquipment`" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "id": "f7bee710-7689-4348-91a2-2fd6dbc58e7c", + "metadata": {}, + "outputs": [], + "source": [ + "equipments = pygen.cognite_equipment.list(space=data_space, retrieve_connections=\"full\", limit=10)" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "id": "6f56f6ed-5b9c-471e-a109-9d6ef0b78404", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idsource_idsource_updated_usernamedescriptionassetserial_numbermanufacturerfilesactivitiestime_seriesdata_record
0springfield_instancesWMT:23-YAH-96119-01700491100123-YAH-96119-01VRD - PH 1STSTGGEAR 2 JOURNBRG NDE : VIBRATION...None10000000002936591686[]NoneNone{'version': 1, 'last_updated_time': 2024-11-08...
1springfield_instancesWMT:23-TAH-96113-03696113100123-TAH-96113-03VRD - PH 1STSTGGEAR 2 JOURNBRG NDE : TEMPERATU...None10000000002849371686[]NoneNone{'version': 1, 'last_updated_time': 2024-11-08...
2springfield_instancesWMT:23-PCV-96163673287100123-PCV-96163VRD - PH 1STSTG COMP DRY GAS SEAL SYSTEM{'space': 'springfield_instances', 'external_i...10000000002298111686[]NoneNone{'version': 2, 'last_updated_time': 2024-11-09...
3springfield_instancesWMT:23-TE-96114-01346423813723-TE-96114-01VRD - PH 1STSTGGEAR 2 JOURNBRG DENone10000000006823511686[][{'space': 'springfield_instances', 'external_...None{'version': 1, 'last_updated_time': 2024-11-08...
4springfield_instancesWMT:23-HV-96191-03346025980223-HV-96191-03VRD - PH 1STSTGLUBEOIL PSV OUTNone10000000007168821686[][{'space': 'springfield_instances', 'external_...None{'version': 1, 'last_updated_time': 2024-11-08...
5springfield_instancesWMT:23-EZSH-92521345680433223-EZSH-92521VRD - PH 1STSTGSUCTSCRUB LIQ OUTNone10000000007084801686[][{'space': 'springfield_instances', 'external_...None{'version': 1, 'last_updated_time': 2024-11-08...
6springfield_instancesWMT:23-TAH-96116-03770204100123-TAH-96116-03VRD - PH 1STSTGGEAR THRUST BRG OUT : TEMPERATU...None10000000001127391686[]NoneNone{'version': 1, 'last_updated_time': 2024-11-08...
7springfield_instancesWMT:23-TE-96147526509100123-TE-96147VRD - COMPRESSOR SEAL GAS HEATER TEMPERATURENone10000000009302301327[]NoneNone{'version': 1, 'last_updated_time': 2024-11-08...
8springfield_instancesWMT:23-PDT-96167650747980223-PDT-96167VRD - PH 1STSTG COMPR BAL PISTON LEAK{'space': 'springfield_instances', 'external_i...10000000001799761686[][{'space': 'springfield_instances', 'external_...[{'space': 'springfield_instances', 'external_...{'version': 2, 'last_updated_time': 2024-11-09...
9springfield_instancesWMT:23-PT-92531-01696236100123-PT-92531-01SOFT TAG VRD - PH 1STSTGCOMP SUCTIONNone10000000002850611686[]NoneNone{'version': 1, 'last_updated_time': 2024-11-08...
\n", + "
" + ], + "text/plain": [ + "CogniteEquipmentList([CogniteEquipment(space='springfield_instances', external_id='WMT:23-YAH-96119-01', data_record=DataRecord(version=1, last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='700491', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='1001', name='23-YAH-96119-01', description='VRD - PH 1STSTGGEAR 2 JOURNBRG NDE : VIBRATION ALARM HIGH', tags=None, aliases=None, serial_number='1000000000293659', manufacturer='1686'),\n", + " CogniteEquipment(space='springfield_instances', external_id='WMT:23-TAH-96113-03', data_record=DataRecord(version=1, last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='696113', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='1001', name='23-TAH-96113-03', description='VRD - PH 1STSTGGEAR 2 JOURNBRG NDE : TEMPERATURE ALARM HIGH', tags=None, aliases=None, serial_number='1000000000284937', manufacturer='1686'),\n", + " CogniteEquipment(space='springfield_instances', external_id='WMT:23-PCV-96163', data_record=DataRecord(version=2, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 43, 898000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='673287', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='1001', name='23-PCV-96163', description='VRD - PH 1STSTG COMP DRY GAS SEAL SYSTEM', tags=None, aliases=None, serial_number='1000000000229811', manufacturer='1686'),\n", + " CogniteEquipment(space='springfield_instances', external_id='WMT:23-TE-96114-01', data_record=DataRecord(version=1, last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='346423', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-TE-96114-01', description='VRD - PH 1STSTGGEAR 2 JOURNBRG DE', tags=None, aliases=None, serial_number='1000000000682351', manufacturer='1686'),\n", + " CogniteEquipment(space='springfield_instances', external_id='WMT:23-HV-96191-03', data_record=DataRecord(version=1, last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='346025', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='9802', name='23-HV-96191-03', description='VRD - PH 1STSTGLUBEOIL PSV OUT', tags=None, aliases=None, serial_number='1000000000716882', manufacturer='1686'),\n", + " CogniteEquipment(space='springfield_instances', external_id='WMT:23-EZSH-92521', data_record=DataRecord(version=1, last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='345680', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='4332', name='23-EZSH-92521', description='VRD - PH 1STSTGSUCTSCRUB LIQ OUT', tags=None, aliases=None, serial_number='1000000000708480', manufacturer='1686'),\n", + " CogniteEquipment(space='springfield_instances', external_id='WMT:23-TAH-96116-03', data_record=DataRecord(version=1, last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='770204', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='1001', name='23-TAH-96116-03', description='VRD - PH 1STSTGGEAR THRUST BRG OUT : TEMPERATURE ALARM HIGH', tags=None, aliases=None, serial_number='1000000000112739', manufacturer='1686'),\n", + " CogniteEquipment(space='springfield_instances', external_id='WMT:23-TE-96147', data_record=DataRecord(version=1, last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='526509', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='1001', name='23-TE-96147', description='VRD - COMPRESSOR SEAL GAS HEATER TEMPERATURE', tags=None, aliases=None, serial_number='1000000000930230', manufacturer='1327'),\n", + " CogniteEquipment(space='springfield_instances', external_id='WMT:23-PDT-96167', data_record=DataRecord(version=2, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 43, 898000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='650747', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='9802', name='23-PDT-96167', description='VRD - PH 1STSTG COMPR BAL PISTON LEAK', tags=None, aliases=None, serial_number='1000000000179976', manufacturer='1686'),\n", + " CogniteEquipment(space='springfield_instances', external_id='WMT:23-PT-92531-01', data_record=DataRecord(version=1, last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 20, 365000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='696236', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='1001', name='23-PT-92531-01', description='SOFT TAG VRD - PH 1STSTGCOMP SUCTION', tags=None, aliases=None, serial_number='1000000000285061', manufacturer='1686')])" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "equipments" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "id": "68a510dd-140b-47b4-a52e-46bc2969a1be", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idsource_idsource_updated_usernamedescriptionrootpathpath_last_updated_timedata_record
0springfield_instancesWMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH682540813723-1ST STAGE COMP DRY GAS SEAL SYS-PH1ST STAGE COMP DRY GAS SEAL SYS ON PHWMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH[WMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH]2024-11-08 14:20:28.094598+00:00{'version': 2, 'last_updated_time': 2024-11-08...
1springfield_instancesWMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH682540813723-1ST STAGE COMP DRY GAS SEAL SYS-PH1ST STAGE COMP DRY GAS SEAL SYS ON PHWMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH[WMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH]2024-11-08 14:20:28.094598+00:00{'version': 2, 'last_updated_time': 2024-11-08...
\n", + "
" + ], + "text/plain": [ + "CogniteAssetList([CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH', data_record=DataRecord(version=2, last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 28, 94000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 27, 925000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='682540', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMP DRY GAS SEAL SYS-PH', description='1ST STAGE COMP DRY GAS SEAL SYS ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 28, 94598, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMP DRY GAS SEAL SYS-PH', data_record=DataRecord(version=2, last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 28, 94000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 27, 925000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='682540', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMP DRY GAS SEAL SYS-PH', description='1ST STAGE COMP DRY GAS SEAL SYS ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 8, 14, 20, 28, 94598, tzinfo=TzInfo(UTC)))])" + ] + }, + "execution_count": 45, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "equipments.asset" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "id": "25c90cd3-b252-4743-baaf-bb83744f2f95", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idnametagsassetsequipmenttime_seriesdata_record
0springfield_instances3285244535393803Årlig ettersyn av instrumentering[23-TE-96114-01][][WMT:23-TE-96114-01][]{'version': 3, 'last_updated_time': 2024-11-09...
1springfield_instances3914808270659650[23-TE-96114-01][][WMT:23-TE-96114-01][]{'version': 3, 'last_updated_time': 2024-11-09...
2springfield_instances124395033859817Årlig sampling assessment[23-TE-96114-01][][WMT:23-TE-96114-01][]{'version': 3, 'last_updated_time': 2024-11-09...
3springfield_instances3073969380122796Årlig sampling assessment[23-TE-96114-01][][WMT:23-TE-96114-01][]{'version': 3, 'last_updated_time': 2024-11-09...
4springfield_instances6742488065156238Årlig ettersyn av instrumentering[23-TE-96114-01][][WMT:23-TE-96114-01][]{'version': 3, 'last_updated_time': 2024-11-09...
...........................
67springfield_instances3625599615521242[23-PDT-96167][][WMT:23-PDT-96167][pi:160649, pi:160649]{'version': 5, 'last_updated_time': 2024-11-09...
68springfield_instances3705032859825529[23-PDT-96167][][WMT:23-PDT-96167][pi:160649, pi:160649]{'version': 5, 'last_updated_time': 2024-11-09...
69springfield_instances6437204238499340[23-PDT-96167][][WMT:23-PDT-96167][pi:160649, pi:160649]{'version': 5, 'last_updated_time': 2024-11-09...
70springfield_instances2697963995334182[23-PDT-96167][][WMT:23-PDT-96167][pi:160649, pi:160649]{'version': 5, 'last_updated_time': 2024-11-09...
71springfield_instances5197041792147432*** ***-PDT-***[23-PDT-96167][][WMT:23-PDT-96167][pi:160649, pi:160649]{'version': 5, 'last_updated_time': 2024-11-09...
\n", + "

72 rows × 8 columns

\n", + "
" + ], + "text/plain": [ + "CogniteActivityList([CogniteActivity(space='springfield_instances', external_id='3285244535393803', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 28, 693000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='3914808270659650', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 31, 73000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='124395033859817', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 31, 73000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig sampling assessment', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='3073969380122796', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 35, 618000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig sampling assessment', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='6742488065156238', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 36, 244000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='8933999992015645', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 36, 579000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig sampling assessment', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='3320010510817842', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 37, 196000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='***-årlig visuell inspeksjon', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='3668410190941194', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 37, 196000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='4479477313749495', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 37, 196000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='5403672611002521', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 38, 465000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='7595924175351767', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 40, 909000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='2333446139980632', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 42, 30000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='4712401043899456', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 44, 190000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='***-årlig visuell inspeksjon', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='1738831458282937', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 45, 265000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='838184720292010', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 47, 856000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='7899306517600148', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 47, 856000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='1422620406083888', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 48, 208000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='4778862215714797', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 53, 101000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig sampling assessment', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='45457457944311', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 53, 101000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='6774536327597254', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 56, 391000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='3394137704020714', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 56, 451000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='388922006422310', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 57, 432000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='5974050731460971', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 58, 390000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='4872773258139196', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 58, 437000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='4861077847018877', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 1, 904000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='7906664206004423', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 5, 828000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='2694820809940854', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 1, 3, 838000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 49, 844000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Sjekke installasjonsmetode for interlock', description=None, tags=['23-HV-96191-03'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='6979244849984565', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 1, 3, 838000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 57, 410000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Sjekke installasjonsmetode for interlock', description=None, tags=['23-HV-96191-03'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='7130155011003683', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 29, 744000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig sampling assessment', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='5685254717316807', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 35, 259000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** MND AUTO. Funksjonstest av ESDV ventil instrumentering ', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='176843131736675', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 35, 259000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** MND AUTO. Funksjonstest av ESDV ventil instrumentering *** Ex', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='716729038587573', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 35, 618000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** MND AUTO. Funksjonstest av ESDV ventil instrumentering ', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='2333914677309191', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 37, 918000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** MND AUTO. Funksjonstest av ESDV ventil instrumentering ', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='4610391062110625', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 42, 30000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** MND AUTO. Funksjonstest av ESDV ventil instrumentering ', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='1241209555451580', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 42, 30000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** MND AUTO. Funksjonstest av ESDV ventil instrumentering ', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='4113496174749609', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 42, 668000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig sampling assessment', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='6261174087609490', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 42, 668000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** MND AUTO. Funksjonstest av ESDV ventil instrumentering ', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='63749392996564', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 44, 190000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** MND AUTO. Funksjonstest av ESDV ventil instrumentering ', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='655915809882189', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 47, 856000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** MND AUTO. Funksjonstest av ESDV ventil instrumentering *** Ex', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='8075306018727493', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 48, 660000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** MND AUTO. Funksjonstest av ESDV ventil instrumentering ', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='1667674567238103', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 51, 892000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig sampling assessment', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='5588488758319492', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 54, 302000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** MND AUTO. Funksjonstest av ESDV ventil instrumentering ', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='2028502192630425', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 54, 302000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** MND AUTO. Funksjonstest av ESDV ventil instrumentering ', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='7077817603354937', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 55, 406000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='***-årlig visuell inspeksjon', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='8372361627197252', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 55, 501000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** MND AUTO. Funksjonstest av ESDV ventil instrumentering ', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='5503320316292724', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 57, 410000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig sampling assessment', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='8696851922258691', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 57, 432000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** MND AUTO. Funksjonstest av ESDV ventil instrumentering ', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='4447849664957633', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 9, 459000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** MND AUTO. Funksjonstest av ESDV ventil instrumentering *** Ex', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='6124514632841945', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 59, 151000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='***-årlig visuell inspeksjon', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='4430991178890038', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 837000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 59, 151000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** MND AUTO. Funksjonstest av ESDV ventil instrumentering *** Ex', description=None, tags=['23-EZSH-92521'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='8377850363851334', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 43, 732000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 28, 693000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='5592202640253924', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 43, 732000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 5, 828000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='1167749400551649', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 44, 93000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 39, 811000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig sampling assessment', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='6812842555407650', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 44, 93000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 40, 187000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** ***-PDT-***', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='2194023744538220', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 44, 93000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 41, 786000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='8750120689913290', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 44, 93000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 41, 786000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig sampling assessment', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='5871536607907494', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 44, 93000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 42, 30000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='3017529609770203', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 44, 93000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 42, 30000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='7462490869062936', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 44, 93000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 42, 668000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='***-årlig visuell inspeksjon', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='6697040221840231', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 44, 93000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 2, 745000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='6180913841162257', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 44, 176000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 37, 196000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='5925917380659464', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 44, 176000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 37, 918000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig sampling assessment', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='1329053545120036', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 44, 482000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 54, 251000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='***-årlig visuell inspeksjon', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='4583250174041912', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 44, 575000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 31, 73000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='5929509278135688', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 44, 575000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 31, 592000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig sampling assessment', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='2719455173683766', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 44, 939000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 59, 321000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='2419388136472507', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 45, 551000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 42, 833000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='3625599615521242', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 45, 551000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 42, 833000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='3705032859825529', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 45, 551000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 42, 833000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='6437204238499340', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 45, 167000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 49, 286000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='2697963995334182', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 45, 551000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 45, 265000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-PDT-96167'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='5197041792147432', data_record=DataRecord(version=5, last_updated_time=datetime.datetime(2024, 11, 9, 13, 18, 45, 551000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 45, 345000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='*** ***-PDT-***', description=None, tags=['23-PDT-96167'], aliases=None)])" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "equipments.activities" + ] + }, + { + "cell_type": "markdown", + "id": "6fc26c5b-227b-4296-90d5-1aad1c00e1b7", + "metadata": {}, + "source": [ + "In addition, you can build up more complex querying with the `.query()` method in `pygen`." + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "id": "342bdab0-9a73-405a-9ac9-4e8c090b6c42", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idsource_idsource_updated_usernamedescriptionparentrootpathpath_last_updated_timedata_record
0springfield_instancesWMT:23-2ND STAGE COMPRESSION-PH681794813723-2ND STAGE COMPRESSION-PH2ND STAGE COMPRESSION ON PHWMT:230900WMT:230900[WMT:230900, WMT:23-2ND STAGE COMPRESSION-PH]2024-11-09 13:17:39.283270+00:00{'version': 4, 'last_updated_time': 2024-11-09...
1springfield_instancesWMT:23-1ST STAGE COMPRESSION-PH681792813723-1ST STAGE COMPRESSION-PH1ST STAGE COMPRESSION ON PHWMT:230900WMT:230900[WMT:230900, WMT:23-1ST STAGE COMPRESSION-PH]2024-11-09 13:17:39.283270+00:00{'version': 4, 'last_updated_time': 2024-11-09...
\n", + "
" + ], + "text/plain": [ + "CogniteAssetList([CogniteAsset(space='springfield_instances', external_id='WMT:23-2ND STAGE COMPRESSION-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 27, 925000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681794', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-2ND STAGE COMPRESSION-PH', description='2ND STAGE COMPRESSION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMPRESSION-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 6, 876000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681792', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMPRESSION-PH', description='1ST STAGE COMPRESSION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC)))])" + ] + }, + "execution_count": 60, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "children_from_parent = pygen.cognite_asset.query().name.equals(\"230900\").children.list_cognite_asset()\n", + "children_from_parent" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "id": "70acd73d-521e-478c-aa66-a8dd6be46e4b", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idsource_idsource_updated_usernamedescriptionparentrootpathpath_last_updated_timedata_record
0springfield_instancesWMT:23-2ND STAGE COMPRESSION-PH681794813723-2ND STAGE COMPRESSION-PH2ND STAGE COMPRESSION ON PH{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...[{'space': 'springfield_instances', 'external_...2024-11-09 13:17:39.283270+00:00{'version': 4, 'last_updated_time': 2024-11-09...
1springfield_instancesWMT:23-1ST STAGE COMPRESSION-PH681792813723-1ST STAGE COMPRESSION-PH1ST STAGE COMPRESSION ON PH{'space': 'springfield_instances', 'external_i...{'space': 'springfield_instances', 'external_i...[{'space': 'springfield_instances', 'external_...2024-11-09 13:17:39.283270+00:00{'version': 4, 'last_updated_time': 2024-11-09...
\n", + "
" + ], + "text/plain": [ + "CogniteAssetList([CogniteAsset(space='springfield_instances', external_id='WMT:23-2ND STAGE COMPRESSION-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 27, 925000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681794', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-2ND STAGE COMPRESSION-PH', description='2ND STAGE COMPRESSION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC))),\n", + " CogniteAsset(space='springfield_instances', external_id='WMT:23-1ST STAGE COMPRESSION-PH', data_record=DataRecord(version=4, last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 6, 876000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, source_id='681792', source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user='8137', name='23-1ST STAGE COMPRESSION-PH', description='1ST STAGE COMPRESSION ON PH', tags=None, aliases=None, path_last_updated_time=datetime.datetime(2024, 11, 9, 13, 17, 39, 283270, tzinfo=TzInfo(UTC)))])" + ] + }, + "execution_count": 61, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "children_by_parent = pygen.cognite_asset.query().parent.name.equals(\"230900\").list_full(limit=-1)\n", + "children_by_parent" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "id": "eff30ffb-664d-4b5f-b21f-2ebe85b35310", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spaceexternal_idnametagsassetsequipmenttime_seriesdata_record
0springfield_instances3285244535393803Årlig ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
1springfield_instances3914808270659650[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
2springfield_instances124395033859817Årlig sampling assessment[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
3springfield_instances3073969380122796Årlig sampling assessment[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
4springfield_instances6742488065156238Årlig ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
5springfield_instances8933999992015645Årlig sampling assessment[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
6springfield_instances3320010510817842***-årlig visuell inspeksjon[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
7springfield_instances3668410190941194Ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
8springfield_instances4479477313749495Ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
9springfield_instances5403672611002521Ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
10springfield_instances7595924175351767Ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
11springfield_instances2333446139980632Ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
12springfield_instances4712401043899456***-årlig visuell inspeksjon[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
13springfield_instances1738831458282937Ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
14springfield_instances838184720292010Årlig ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
15springfield_instances7899306517600148Ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
16springfield_instances1422620406083888Årlig ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
17springfield_instances4778862215714797Årlig sampling assessment[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
18springfield_instances45457457944311Årlig ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
19springfield_instances6774536327597254Årlig ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
20springfield_instances3394137704020714Ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
21springfield_instances388922006422310Årlig ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
22springfield_instances5974050731460971[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
23springfield_instances4872773258139196Ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
24springfield_instances4861077847018877Ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
25springfield_instances7906664206004423Årlig ettersyn av instrumentering[23-TE-96114-01][][{'space': 'springfield_instances', 'external_...[]{'version': 3, 'last_updated_time': 2024-11-09...
\n", + "
" + ], + "text/plain": [ + "CogniteActivityList([CogniteActivity(space='springfield_instances', external_id='3285244535393803', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 28, 693000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='3914808270659650', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 31, 73000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='124395033859817', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 31, 73000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig sampling assessment', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='3073969380122796', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 35, 618000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig sampling assessment', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='6742488065156238', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 36, 244000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='8933999992015645', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 36, 579000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig sampling assessment', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='3320010510817842', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 37, 196000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='***-årlig visuell inspeksjon', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='3668410190941194', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 37, 196000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='4479477313749495', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 37, 196000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='5403672611002521', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 38, 465000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='7595924175351767', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 40, 909000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='2333446139980632', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 42, 30000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='4712401043899456', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 44, 190000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='***-årlig visuell inspeksjon', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='1738831458282937', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 45, 265000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='838184720292010', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 47, 856000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='7899306517600148', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 47, 856000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='1422620406083888', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 48, 208000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='4778862215714797', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 53, 101000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig sampling assessment', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='45457457944311', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 53, 101000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='6774536327597254', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 56, 391000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='3394137704020714', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 56, 451000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='388922006422310', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 57, 432000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='5974050731460971', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 58, 390000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='4872773258139196', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 20, 58, 437000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='4861077847018877', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 1, 904000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None),\n", + " CogniteActivity(space='springfield_instances', external_id='7906664206004423', data_record=DataRecord(version=3, last_updated_time=datetime.datetime(2024, 11, 9, 4, 0, 56, 389000, tzinfo=TzInfo(UTC)), created_time=datetime.datetime(2024, 11, 8, 14, 21, 5, 828000, tzinfo=TzInfo(UTC)), deleted_time=None), node_type=None, start_time=None, end_time=None, scheduled_start_time=None, scheduled_end_time=None, source_id=None, source_context=None, source_created_time=None, source_updated_time=None, source_created_user=None, source_updated_user=None, name='Årlig ettersyn av instrumentering', description=None, tags=['23-TE-96114-01'], aliases=None)])" + ] + }, + "execution_count": 65, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "activities = pygen.cognite_activity.query().equipment.external_id.equals(\"WMT:23-TE-96114-01\").list_full(limit=-1)\n", + "activities" + ] + }, + { + "cell_type": "markdown", + "id": "02ff3eeb-cfe4-43ab-9a42-c756a005f973", + "metadata": {}, + "source": [ + "To learn more about `pygen` see the [Pygen docs](https://cognite-pygen.readthedocs-hosted.com/en/latest/)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4a099d5e-d65d-48bc-85c2-5534c1a66007", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.11" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/docs/quickstart/cdf_streamlit.md b/docs/quickstart/cdf_streamlit.md index fbb32deca..be44349de 100644 --- a/docs/quickstart/cdf_streamlit.md +++ b/docs/quickstart/cdf_streamlit.md @@ -13,7 +13,7 @@ adding `cognite-pygen` to the installed packages under `settings`. pyodide-http==0.2.1 cognite-sdk==7.64.8 pydantic==1.10.7 -cognite-pygen==0.99.44 +cognite-pygen==0.99.45 ``` Note that we also set `pydantic` to a specific version. This is because `pygen` supports both `pydantic` `v1` and `v2`, but diff --git a/examples/cognite_core/_api_client.py b/examples/cognite_core/_api_client.py index cea342a60..9be636a77 100644 --- a/examples/cognite_core/_api_client.py +++ b/examples/cognite_core/_api_client.py @@ -50,7 +50,7 @@ class CogniteCoreClient: CogniteCoreClient Generated with: - pygen = 0.99.44 + pygen = 0.99.45 cognite-sdk = 7.64.8 pydantic = 2.9.2 @@ -68,7 +68,7 @@ def __init__(self, config_or_client: CogniteClient | ClientConfig): else: raise ValueError(f"Expected CogniteClient or ClientConfig, got {type(config_or_client)}") # The client name is used for aggregated logging of Pygen Usage - client.config.client_name = "CognitePygen:0.99.44" + client.config.client_name = "CognitePygen:0.99.45" self._client = client diff --git a/examples/equipment_unit/_api_client.py b/examples/equipment_unit/_api_client.py index 9b3c9cbd9..d90ecc020 100644 --- a/examples/equipment_unit/_api_client.py +++ b/examples/equipment_unit/_api_client.py @@ -23,7 +23,7 @@ class EquipmentUnitClient: EquipmentUnitClient Generated with: - pygen = 0.99.44 + pygen = 0.99.45 cognite-sdk = 7.64.8 pydantic = 2.9.2 @@ -41,7 +41,7 @@ def __init__(self, config_or_client: CogniteClient | ClientConfig): else: raise ValueError(f"Expected CogniteClient or ClientConfig, got {type(config_or_client)}") # The client name is used for aggregated logging of Pygen Usage - client.config.client_name = "CognitePygen:0.99.44" + client.config.client_name = "CognitePygen:0.99.45" self._client = client diff --git a/examples/omni/_api_client.py b/examples/omni/_api_client.py index a4dc4aed0..263414beb 100644 --- a/examples/omni/_api_client.py +++ b/examples/omni/_api_client.py @@ -41,7 +41,7 @@ class OmniClient: OmniClient Generated with: - pygen = 0.99.44 + pygen = 0.99.45 cognite-sdk = 7.64.8 pydantic = 2.9.2 @@ -59,7 +59,7 @@ def __init__(self, config_or_client: CogniteClient | ClientConfig): else: raise ValueError(f"Expected CogniteClient or ClientConfig, got {type(config_or_client)}") # The client name is used for aggregated logging of Pygen Usage - client.config.client_name = "CognitePygen:0.99.44" + client.config.client_name = "CognitePygen:0.99.45" self._client = client diff --git a/examples/omni_multi/_api_client.py b/examples/omni_multi/_api_client.py index 4d766b014..dee9a2454 100644 --- a/examples/omni_multi/_api_client.py +++ b/examples/omni_multi/_api_client.py @@ -111,7 +111,7 @@ class OmniMultiClient: OmniMultiClient Generated with: - pygen = 0.99.44 + pygen = 0.99.45 cognite-sdk = 7.64.8 pydantic = 2.9.2 @@ -125,7 +125,7 @@ def __init__(self, config_or_client: CogniteClient | ClientConfig): else: raise ValueError(f"Expected CogniteClient or ClientConfig, got {type(config_or_client)}") # The client name is used for aggregated logging of Pygen Usage - client.config.client_name = "CognitePygen:0.99.44" + client.config.client_name = "CognitePygen:0.99.45" self.omni_multi_a = OmniMultiAAPIs(client) self.omni_multi_b = OmniMultiBAPIs(client) diff --git a/examples/omni_sub/_api_client.py b/examples/omni_sub/_api_client.py index 8480b93a9..b9f980be8 100644 --- a/examples/omni_sub/_api_client.py +++ b/examples/omni_sub/_api_client.py @@ -23,7 +23,7 @@ class OmniSubClient: OmniSubClient Generated with: - pygen = 0.99.44 + pygen = 0.99.45 cognite-sdk = 7.64.8 pydantic = 2.9.2 @@ -41,7 +41,7 @@ def __init__(self, config_or_client: CogniteClient | ClientConfig): else: raise ValueError(f"Expected CogniteClient or ClientConfig, got {type(config_or_client)}") # The client name is used for aggregated logging of Pygen Usage - client.config.client_name = "CognitePygen:0.99.44" + client.config.client_name = "CognitePygen:0.99.45" self._client = client diff --git a/examples/scenario_instance/client/_api_client.py b/examples/scenario_instance/client/_api_client.py index e5569feab..2cf232d19 100644 --- a/examples/scenario_instance/client/_api_client.py +++ b/examples/scenario_instance/client/_api_client.py @@ -21,7 +21,7 @@ class ScenarioInstanceClient: ScenarioInstanceClient Generated with: - pygen = 0.99.44 + pygen = 0.99.45 cognite-sdk = 7.64.8 pydantic = 2.9.2 @@ -39,7 +39,7 @@ def __init__(self, config_or_client: CogniteClient | ClientConfig): else: raise ValueError(f"Expected CogniteClient or ClientConfig, got {type(config_or_client)}") # The client name is used for aggregated logging of Pygen Usage - client.config.client_name = "CognitePygen:0.99.44" + client.config.client_name = "CognitePygen:0.99.45" self._client = client diff --git a/examples/windmill/_api_client.py b/examples/windmill/_api_client.py index 8b14f6013..3f618990d 100644 --- a/examples/windmill/_api_client.py +++ b/examples/windmill/_api_client.py @@ -31,7 +31,7 @@ class WindmillClient: WindmillClient Generated with: - pygen = 0.99.44 + pygen = 0.99.45 cognite-sdk = 7.64.8 pydantic = 2.9.2 @@ -49,7 +49,7 @@ def __init__(self, config_or_client: CogniteClient | ClientConfig): else: raise ValueError(f"Expected CogniteClient or ClientConfig, got {type(config_or_client)}") # The client name is used for aggregated logging of Pygen Usage - client.config.client_name = "CognitePygen:0.99.44" + client.config.client_name = "CognitePygen:0.99.45" self._client = client diff --git a/mkdocs.yml b/mkdocs.yml index 3f70c56a2..1b590fb96 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -50,7 +50,8 @@ nav: - Windmill Client: example_docs/wind_client.md - Windmill APIs: example_docs/wind_apis.md - Windmill Data Classes: example_docs/wind_data_classes.md - + - Developer Docs: + - Querying: docs-dev/docs_query.ipynb - Reference - Code API: - Pygen: api/api.md - Demo: api/demo.md diff --git a/pyproject.toml b/pyproject.toml index 0a8ebf204..d39117d40 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cognite-pygen" -version = "0.99.44" +version = "0.99.45" description = "Cognite Python SDK Generator" readme = "README.md" authors = ["Cognite "]