Skip to main content
Question

mismatch in instance filter in data model filter and other places (transformation, rest api and graphql api)

  • January 31, 2025
  • 4 replies
  • 42 views

We wanted to use view filter to implement a new view in a datamodel with a subset of data. we wanted to filter on a property with external id “WELL”
 


we tried this in a few models, and we get only 70 instances, but when we try to query instances with same filter in transformations sql query, graphql query or rest api endpoint for filtering instances we get 71.
even in data modeling ui, when same filter is applied on original model, it shows 71 instances but one fo them shows up as empty
 



UPDATE:
the one that was missing in data model UI is because that well instance doesn’t exist in that space (only 70 wella in that right space). but when we query the same data model instances from rest api , it gives that well from different space as well (71 wells). it gives well instance along with WELL type from other space which actually does not exist

4 replies

  • Author
  • Seasoned
  • January 31, 2025

cc: ​@Snehal Jagtap 


Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img+8
  • Seasoned Practitioner
  • February 3, 2025

@Sangavi M can you please share the SQL code and the API request to compare?


  • Author
  • Seasoned
  • February 4, 2025


sQL:
 

select
*
from
cdf_data_models(
"sdm_examples",
"SDM_model_All_entities_with_well_Timeseries_and_scalar_data",
"1",
"SDMEntity"
)
where
entityType.externalId = 'WELL'

api end point: /models/instances/list


 

{
"includeTyping": false,
"sources": [
{
"source": {
"type": "view",
"space": "sdm_examples",
"externalId": "SDMEntity",
"version": "d87edb8c602c9e"
}
}
],
"limit": 1000,
"filter": {
"nested": {
"scope": [
"sdm_examples",
"SDMEntity/d87edb8c602c9e",
"entityType"
],
"filter": {
"equals": {
"property": [
"node",
"externalId"
],
"value": "WELL"
}
}
}
}
}

 


Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img+8
  • Seasoned Practitioner
  • February 12, 2025

@Arild Eide any idea regarding this?