Skip to main content
Solved

Working with cdf demo project

  • May 3, 2025
  • 28 replies
  • 324 views

Hi Cognite Team,
I'm building a React dashboard using Cognite Data Fusion for my portfolio and would like to know if there are any demo projects available for working with CDF data.

Best answer by Mithila Jayalath

Hi ​@Haris vk,

I am working on a development project and want to explore the full asset data. Many assets in the publicdata project have time series, but they lack 3D models.

Can you please let me know what sort of help that you need from our end?

Also, regarding  Fusion.cognite.com , do I need access to the publicdata project there to explore it?

You should have access to the publicdata project. You can login to the project via https://publicdata.fusion.cognite.com/

28 replies

Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img+8

Check out the Open Industrial Data (OID) project. You can find more information about the project here.


  • Author
  • Committed
  • May 7, 2025

hi ​@Mithila Jayalath 

Are there any documents or guides available for accessing public data from the Open Industrial Data (OID) project?

I’ve created a React dashboard to display the data, and I’m using FastAPI on the backend to access the API. For authentication, I initially generated a secret ID from the OID dashboard for a JavaScript SPA. However, I believe authentication is now handled through the Azure AD portal.

Could you please guide me on how to correctly authenticate and access the OID API using Azure AD?

Here’s the code I’m currently using for authentication:
import { CogniteClient, ClientOptions } from "@cognite/sdk";

export const getCDFClient = (
  clientId: string,
  clientSecret: string,
  cluster: string,
  project: string
): CogniteClient => {
  const baseUrl = `https://${cluster}.cognitedata.com`;
  const tenantId = "48d5043c-cf70-4c49-881c-c638f5796997";

  const options: ClientOptions = {
    appId: "cdf-dashboard",
    baseUrl,
    project,
    getToken: async () => {
      try {
        const formBody = new URLSearchParams();
        formBody.append("client_id", clientId);
        formBody.append("client_secret", clientSecret);
        formBody.append("grant_type", "client_credentials");
        formBody.append("scope", "https://api.cognitedata.com/.default");

        const response = await fetch(
          `https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/token`,
          {
            method: "POST",
            headers: {
              "Content-Type": "application/x-www-form-urlencoded",
            },
            body: formBody.toString(),
          }
        );

        if (!response.ok) {
          const errorText = await response.text();
          throw new Error(`OIDC Auth failed: ${response.status} - ${errorText}`);
        }

        const data = await response.json();
        return data.access_token;
      } catch (error) {
        console.error("Failed to obtain OIDC access token:", error);
        throw error;
      }
    },
  };

  return new CogniteClient(options);
};

export const OID_PROJECT = "publicdata";
export const OID_CLUSTER = "api";
export const OID_ROOT_ASSET_ID = 6687602007296940;


Thank you


Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img+8

@Haris vk Please find the sample authentication codes here. If you observe any errors, please let me know.


  • Author
  • Committed
  • May 7, 2025

hi ​@Mithila Jayalath  Thanks for the guidance. I have completely moved authentication to my FastAPI project. On the frontend, I just pass the client ID, tenant ID, and secret ID, which I generated using the OIDC widget for the Python SDK. Now, in FastAPI, I use the Cognito Python SDK for authentication. It's working fine now.


Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img+8

@Haris vk thank you for the update. I’ll mark this question as resolved.


  • Author
  • Committed
  • May 9, 2025

HI ​@Mithila Jayalath again, 


 

Why is get_time_series() returning no data for a valid asset ID using the Cognite Python SDK?


I'm learning to use the Cognite Python SDK with FastAPI. I can successfully retrieve children assets from a known root asset ID (6687602007296940 — from the OID test data for Valhall). Here's the route that works:


@router.get("/assets/{asset_id}/children", response_model=AssetList)
async def get_children_assets(...):
    ...
However, when I try to retrieve time series data for this same asset using:


@router.get("/timeseries", response_model=TimeSeriesList)
async def get_time_series(asset_id: Optional[int] = Query(None), ...):
    client = get_cognite_client(...)
    ts_list = get_timeseries(client, asset_id)
    return {"items": [ts.dump() for ts in ts_list]}
I get no results — the list is empty. The asset is definitely valid and exists:


{
  "id": 4650652196144007,
  "name": "VAL",
  "root_id": 6687602007296940,
  "parent_id": 6687602007296940,
  "description": "Valhall platform"
}
I’m using the publicdata project with the OID dataset. Any idea why get_time_series() doesn’t return anything?

Things I’ve tried:

Verified asset ID is valid

Checked for time series manually in the Cognite Data Fusion UI (still learning how)

Used the same client config (publicdata, OID) for both asset and time series endpoints


Anders  Albert
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • May 9, 2025

Why is get_time_series() returning no data for a valid asset ID using the Cognite Python SDK?

The most common reason for this is that the service principal you identified with (either interactive - identified as yourself, or client ID/secret identified as a service principal from for example Azure, AWS,Google) do not have access to the time series. 


  • Author
  • Committed
  • May 9, 2025

Hi @anders alber

 

So how can I get acess time series sdk for oid project for learning.


Anders  Albert
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • May 9, 2025

First, I would check that is the problem by checking your token, for example, something like this

from pprint import pprint
from cognite.client.data_classes.capabilities import TimeSeriesAcl
my_token = client.iam.token.inspect()

#Alternative print the entire token
# pprint(my_token.dump())

timeseries_access = [project_capability.capability for project_capability in my_token.capabilities if isinstance(project_capability.capability, TimeSeriesAcl)]

For my case I have access to all TimeSeries in the entire project. Note you might only have access to TimeSeries in certain dataset:

If you lack access you need to add the missing TimeSeries capability to the group associated with your service principal. For example, I am using a service principal from EntraID (Azure) with group id ‘cb93285a-b545-4d6c-abc0-d77faf11ff5e’. This is connected to ‘myGroup’ in CDF which needs to have the TimeSeries capability

 


  • Author
  • Committed
  • August 12, 2025

Hi ​@Anders Albert ,

I’m trying to use the OID Project public data, pick any asset, and display that asset’s data.

Since authentication is already working, what steps do I need to take next to access the data?


  • Author
  • Committed
  • August 15, 2025

Hi @Mithila Jayalath,

My current steps are as follows:

I created a secret for the Python SDK using the Cognite OIDC widget.

I used the following details:

Tenant ID: 48d5043c-cf70-4c49-881c-c638f5796997

Client ID: 1b90ede3-271e-401b-81a0-a4d52bea3273

Project: Public data

Cluster API: [Cluster API URL]

I used the following function:

def get_cognite_client(credentials):
    return CogniteClient(
        ClientConfig(
            project=credentials.project,
            client_name="cdf-dashboard",
            base_url=f"https://{credentials.cluster}.cognitedata.com",
            credentials=OAuthClientCredentials(
                token_url=f"https://login.microsoftonline.com/{credentials.tenant_id}/oauth2/v2.0/token",
                client_id=credentials.client_id,
                client_secret=credentials.client_secret,
                scopes=[f"https://{credentials.cluster}.cognitedata.com/.default"]
            )
        )
    )


However, when I use this Cognite client, I cannot retrieve the asset list — even though authentication is successful and returns a valid response.

Could you please help me resolve this?

thanks


Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img+8

@Haris vk can you kindly change the project name from Public data to publicdata and check again?


  • Author
  • Committed
  • August 18, 2025

Hi ​@Mithila Jayalath ,

Right now, my client authentication is working, and I was able to list some assets in the publicdata project.

However, none of the assets contain complete or meaningful data — for example, an asset might have time series and events, but not a 3D model.

I am working on a development project and want to explore the full asset data. Many assets in the publicdata project have time series, but they lack 3D models.

Could you please help me with this?

Also, regarding  Fusion.cognite.com  , do I need access to the publicdata project there to explore it? 


Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img+8
  • Seasoned Practitioner
  • Answer
  • August 18, 2025

Hi ​@Haris vk,

I am working on a development project and want to explore the full asset data. Many assets in the publicdata project have time series, but they lack 3D models.

Can you please let me know what sort of help that you need from our end?

Also, regarding  Fusion.cognite.com , do I need access to the publicdata project there to explore it?

You should have access to the publicdata project. You can login to the project via https://publicdata.fusion.cognite.com/


  • Author
  • Committed
  • August 18, 2025

Hi  ​@Mithila Jayalath , in https://publicdata.fusion.cognite.com/ we can access it using a personal Microsoft account. But in my case, it requires MFA access, and the Authenticator code is not working.

thanks


  • Author
  • Committed
  • August 18, 2025

Hi ​@Mithila Jayalath 

 

Thanks for the clarification. Yes, I would like to explore the full asset data, including the 3D models, if available. Currently, I can see time series data for many assets, but not the corresponding 3D models. Could you confirm if 3D models are available in the publicdata project, or if they are limited to specific assets only?

Regarding access: I am able to log in to https://publicdata.fusion.cognite.com/ with my Microsoft account. However, my account seems to require MFA, and the Authenticator code is not working as expected. Could you please guide me on how to resolve this and ensure proper access to the publicdata project?

Thanks,
Haris


Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img+8

I checked in the publicdata project. Only three 3D models are available in the project and they are linked only to few specific assests. I hope this answers your question.

I have reset your MFA. Can you please check whether if you are able to re-register to MFA and login to the CDF project. 


  • Author
  • Committed
  • August 18, 2025

Hi ​@Mithila Jayalath ,
Yes, I also get only 3 3D models available. They are linked to specific assets, but those assets do not have any time series or events, right?


  • Author
  • Committed
  • August 18, 2025

Hi ​@Mithila Jayalath ,
Yes, MFA was enabled successfully and I logged into CDF Fusion Public Data.


Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img+8

Yes, I also get only 3 3D models available. They are linked to specific assets, but those assets do not have any time series or events, right?

I just randomly checked. Some assets linked to a 3D model do have timeseries, events linked to them. Check this asset as an example.

ID: 5787085828571389

Name: T-90


  • Author
  • Committed
  • August 20, 2025

Hi ​@Mithila Jayalath ,

Could you please enable Canvas and the new Atlas AI feature in the publicdata Fusion project?

I’m currently working on R&D and would like to explore these features in order to build an external application using the Cognite SDK.

Thanks!


  • Author
  • Committed
  • August 28, 2025

Hi ​@Mithila Jayalath 


I have worked with the Asset API, Time Series, Events, P&ID diagrams, and Asset Annotations.

Now I need to work with 3D models. I found that Cognite provides a 3D Viewer engine for rendering, but instead of using that, I would like to obtain the 3D model as a .glb file so I can render it using an external package.

Could you please help me with this?


Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img+8

@Haris vk what sort of a help do you need here? 


  • Author
  • Committed
  • August 28, 2025

hi ​@Mithila Jayalath Could you please check if there’s a model available in .glb format?
If not, do you have any option to upload a model with a .glb extension to the public data, so that we can fetch and render it using an external package?

Thanks


Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img+8

@Haris vk I checked the available models in the publicdata project, They are not in .glb format.

If not, do you have any option to upload a model with a .glb extension to the public data, so that we can fetch and render it using an external package?

Currenlty it’s not possible to upload any models to the publicdata project. If you are interested in getting access to a standbox project, you will have to contact us through this form:  https://www.cognite.com/en/contact.