Skip to main content
Closed

Feature request - graphql filter support for timeseries type in FDM

Related products:Data Modeling
  • June 12, 2023
  • 11 replies
  • 269 views

Hi Team!

Right now graphql support for fetching FDM Data doesn't offer any filters for type "TimeSeries". Since Timeseries type usually has a lot of datapoints associated with it in any given model, fetching data through graphql api from it without any filter is extremely time consuming , especaially when you dont need all datapoints/timeseries from it. For example, right now when we want to fetch information only for non string timeseries, there is no way other than fetching all Timeseries associated and remove the ones that has "isString" property as false which slows down some parts of our appplication.

So if we can get graphql filter support for timeseries type, we will be able to optimise things in our side.

Thanks & Regards,
Sangavi M

11 replies

Forum|alt.badge.img

Hi @Sangavi M, and thanks for this insight!

 

So you’re looking for a way to limit the returned data point payload (using a filter) in the GraphQL interface?

Any particular filter(ing) you’re looking for? Data point value range? Time range? 


Forum|alt.badge.img

Or are we talking about filtering on the properties of the time series itself?


  • Author
  • Seasoned ⭐️⭐️⭐️
  • June 12, 2023

Hi @Thomas Sjølshagen ,

Thanks for the reply. Im loooking to filter based on IsString property of timeseries for my particular use case.


AndersM
Expert ⭐️⭐️⭐️⭐️
  • Expert ⭐️⭐️⭐️⭐️
  • June 29, 2023

Hi Sangavi,

Edit: Last response was probably wrong.

Currently, if you need to work with time series extensively, consider the time series REST API, either directly (https://developer.cognite.com/api/#tag/Time-series/operation/listTimeSeries) or via an SDK such as the Python SDK - https://cognite-sdk-python.readthedocs-hosted.com/en/latest/core_data_model.html#list-time-series

Thanks,

-AndersM


Anita Hæhre
Expert ⭐️⭐️⭐️⭐️
Forum|alt.badge.img+3
  • Head of Community
  • July 6, 2023

Hi @Sangavi M hope you’re doing well. I wanted to check to see if the responses from @Thomas Sjølshagen and @AndersM were helpful in addressing your needs? If you have any further questions or needs do let us know 🚀


AndersM
Expert ⭐️⭐️⭐️⭐️
  • Expert ⭐️⭐️⭐️⭐️
  • August 31, 2023

Hi again,

We have ongoing development work on improving the representation of time series data in data modeling, While I cannot yet commit to a release date for this I believe we will have an improvement that may fill in some of the described requirements in an upcoming CDF release. Don’t hold your breath just yet, though, if you need this urgently then using the existing time series API is the recommended workaround.

Thanks,

-AndersM


Anita Hæhre
Expert ⭐️⭐️⭐️⭐️
Forum|alt.badge.img+3
  • Head of Community
  • August 31, 2023
Gathering InterestPlanned for development

Anita Hæhre
Expert ⭐️⭐️⭐️⭐️
Forum|alt.badge.img+3
  • Head of Community
  • August 31, 2023

 @Sangavi M happy to announce this work has been prioritized and that our team is currently in the scoping and design phase. Thanks for sharing your idea! 


  • Seasoned ⭐️⭐️⭐️
  • April 28, 2025

Hey guys, I was about to post a similar question before I found this, ​@Anita Hæhre is this feature still in the making or is timeseries property filtering supported as of now? 


Arild  Eide
Expert ⭐️⭐️⭐️⭐️
Forum|alt.badge.img
  • Expert ⭐️⭐️⭐️⭐️
  • April 30, 2025

Hi all 

At the time ​@Sangavi M raised this question the way to refer time series and files in Data Modeling was by using the types TimeSeries and File:

   type MyType {
      time_series: TimeSeries
      file: File
   }
When creating instances of MyType the properties time_series and file would hold externalId references. As ​@Sangavi M rightly mentions, this setup does not allow filtering by properties of the time series. (Unless one would add an additional property for filetring purposes (eg isStep: boolean) and make sure to consistently set this property.
 
In September 2024 The Cognite Core Model was released and made available in all CDF projects. It provides the types CogniteTimeSeries and CogniteFile as well as many others, listed in this article.  The CogniteTimeSeries has properties isStep, type, assets and many others.
 
Instances of CogniteTimeSeries can be queried and filtered like any other type in Data Modeling. The json request to instances/query accepts a filter like this:
 
        "filter": {
          "equals": {
            "property": ["cdf_cdm", "CogniteTimeSeries/v1", "type"],
            "value": "numeric"
          }
 
That will return only numeric Time Series.
 
Do note that it is not possible to obtain time series data points through GraphQL for CogniteTimeSeries, so you will fetch data points from the time series API using the space and externalId of the CogniteTimeSeries node described here.
 
Also, Pygen is offering an ergonomic way of working with time series.
 
Hope this was useful.
 
Thanks
 
Arild Eide
 
 
 

  • Seasoned ⭐️⭐️⭐️
  • April 30, 2025

Aha, yes that makes sense. Thank you ​@Arild Eide.