Skip to main content
Solved

Data modeling query format and error in data modeling event trigger

  • February 28, 2026
  • 4 replies
  • 63 views

RAMBOURG Pierre
Committed

Hello experts,

I’m looking to work with data workflows.

I’m looking to trigger on node with a specific attribute (direct relation to another view) empty.
I’m trying to work with the UI but I struggle with the Data modeling query validation.

I don’t understand why the validation fails and what is the expected format for the query : JSON seems to be the expected format as seen here : 

But documentation uses YAML : https://docs.cognite.com/cdf/dm/dm_concepts/dm_querying#graph-query-examples

I’m a bit lost and I need your help.
 

And my query : 

{
"with":[
{
"ts":{
"nodes":{
"filter":{
"exists":{
"property":[
"nameTranslations"
]
}
}
},
"limit":1000
}
}
],
"select":[
{
"ts":{
"sources":[
{
"source":{
"type":"view",
"space":"MaMaTa_Core_Views",
"externalId":"MamataTimeSeries",
"version":1
},
"properties":[
"*"
]
}
]
}
}
]
}

Many thanks,

Regards,

Pierre

Best answer by Arild Eide

Hi ​@RAMBOURG Pierre 

 

Please see example query below

  • The exists filter takes a fully qualified property identifier - space, view/view_version, property
  • We use the not filter to negate the exists filter
  • The hasData filter selects nodes with data in MamataTimeSeries view
{
"with": {
"ts": {
"limit": 100,
"nodes": {
"filter": {
"and": [
{
"not": {
"exists": {
"property": [
SPACE,
"MamataTimeSeries/1",
"nameTranslations"
]
}
}
},
{
"hasData": [
{
"type": "view",
"space": SPACE,
"externalId": "MamataTimeSeries",
"version": "1"
}
]
}
]
}
}
}
},
"select": {
"ts": {
"sources": [
{
"source": {
"type": "view",
"space": SPACE,
"externalId": "MamataTimeSeries",
"version": "1"
},
"properties": [
"*"
]
}
]
}
}
}

 

Hope this helps

 

Regards,

 

Arild Eide

4 replies

Arild  Eide
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • Answer
  • March 2, 2026

Hi ​@RAMBOURG Pierre 

 

Please see example query below

  • The exists filter takes a fully qualified property identifier - space, view/view_version, property
  • We use the not filter to negate the exists filter
  • The hasData filter selects nodes with data in MamataTimeSeries view
{
"with": {
"ts": {
"limit": 100,
"nodes": {
"filter": {
"and": [
{
"not": {
"exists": {
"property": [
SPACE,
"MamataTimeSeries/1",
"nameTranslations"
]
}
}
},
{
"hasData": [
{
"type": "view",
"space": SPACE,
"externalId": "MamataTimeSeries",
"version": "1"
}
]
}
]
}
}
}
},
"select": {
"ts": {
"sources": [
{
"source": {
"type": "view",
"space": SPACE,
"externalId": "MamataTimeSeries",
"version": "1"
},
"properties": [
"*"
]
}
]
}
}
}

 

Hope this helps

 

Regards,

 

Arild Eide


RAMBOURG Pierre
Committed

Hello ​@Arild Eide , thank you for your comprehensive response. I managed to get the query to work as desired, which is great. I didn't realize that a complete identifier was required, but now it's very clear!

 

I have one more question: is hasData a “nice to have,” “mandatory,” or does it have a specific function that complements the other filter?

 

Thanks,

Pierre Rambourg

 

 


Arild  Eide
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • March 4, 2026

Hi ​@RAMBOURG Pierre 

That is a fair question, I should have mentioned in my initial note. 

The hasData filter accepts views or containers and selects instances that have data in the mentioned containers or in the containers referred to by the views you provide to the filter, as described in this article.

Without hasData both instance of MamataTimeSeries that do not have nameTranslations set AND any other instances (that do not even have the property) will satisfy the filter. So in this case you should apply both hasData and the exists.

 

Regards,

 

Arild Eide 


RAMBOURG Pierre
Committed

@Arild Eide Alright thank you for your feedback, I understand why you use this filter ! I’m smarter than yesterday :)

Have a nice day,

Regards,

Pierre Rambourg