Skip to main content
Committed ⭐️⭐️⭐️
July 2, 2025
Question

Data modeling transformations

  • July 2, 2025
  • 14 replies
  • 157 views

hello guys,

 

I wonder how do you populate data model directly from the dataset? so i have ingested all my timeseries data into my dataset and then i want to run transformations using this dataset as a source but how do i get the actual values from the data points and can you filter just to extract certain timeseries data? this is the query i am running at the moment:

 select
  cast(`externalId` as STRING) as externalId,
  cast(`name` as STRING) as name,
  cast(`description` as STRING) as description
from
  `_cdf`.`timeseries`;

 

what i want really is to import all my timeseries data from my dataset into my data model and then continue building. 

14 replies

Gaetan  Helness
MVP ⭐️⭐️⭐️⭐️⭐️
MVP ⭐️⭐️⭐️⭐️⭐️
July 4, 2025

I would recommend using Search to view the data, the SQL query you wrote is only valid for (legacy) CDF time series so will not return anything. 

Do you see your time series in Search? (you might need to edit the location/data model selection)

Committed ⭐️⭐️⭐️
July 4, 2025

so what is the differenc between legacy cdf timeseries and non legacy?

yes, i can see all mine data points using seach but why cant i get those using graphql query?

Lead Product Manager
July 4, 2025

so what is the differenc between legacy cdf timeseries and non legacy?

Legacy time series are time series created and updated/maintained using the Time Series API. They are typically identified using an (optional, but recommended) external ID.

Non-legacy are time series created initially in data modeling as an instance of a derived CogniteTimeSeries Core Data Model type.

These can be “seen” and read (partially) using the “legacy” Time Series API by using the instance ID - instanceId -  (which maps to the space ID and mandatory External ID of the CogniteTimeSeries instance in the data modeling service.

We’re working on tooling to support migrating a specific Time Series from the legacy Time Series API to become a CogniteTimeSeries instance in Data Modeling.

For either model, the actual data point CRUD and querying is done using the Time Series API endpoints for data points.

 

Committed ⭐️⭐️⭐️
July 4, 2025

Hi,

this is great and thank you for the explanation:)

the way i understood i have non legacy timeseries that i have linked to my data model but with the above sql query i have only transformed meta data and not data points which is why i cannot get any values when i use graphql explore. So using below sql query how can transform externalid, name and value into my data model: 

SELECT
    CAST(SUBSTRING_INDEX(`externalId`, '/', -1) AS STRING) AS externalId,
    CAST(`externalId` AS STRING) AS name,
    CAST(`description` AS STRING) AS description
FROM
    `_cdf`.`timeseries`
WHERE
    `externalId` LIKE 'AcmeManufacturing/PlantA/ProductionFloor/Line1/MachineA/%'
       AND `dataSetId` = 6070405924869548;

in my dataset where i have stored all my topics as timeseries i also have asset hierachy of the actual plant so i should be able to link timeseries data and my asset hierachy to my data model instances/containers which are factory-line1-machine1-mes data-erp data etc..