Improved property selection in Data Modelling

  • 5 April 2024
  • 2 replies
  • 83 views

Userlevel 1

Hi all!

The Cognite Data Modelling product team are looking to make an improvement to how properties from views selected in data modelling graph queries are included in the result data set.

The documented and desired behaviour is that only view properties that are explicitly selected in the query will be included in the data output. However, there is a known issue with property selection where in some cases a query would return more properties per view than initially selected.

The issue manifests such that properties selected on one view will also be included in the result properties of another view in the query. This behaviour only appears in specific cases: the selection should be in the same table expression, the selection should use two or more views that share some container properties, and one or more shared properties (that is, properties mapped to the same container property) should be selected in one of the views but not in the other.

As such, the issue does not cause a data leak or expose data that are not already accessible. The only impact is that a view’s results may contain properties that are not selected for that view - but are selected in the same query through another view.

As an example, consider a data model with two views, A and B, where both views map the same container property C. For a query with one table expression that selects properties from both view A and B, but where only source with view A selects property C while view source B does not. The result set then would contain property C for view B as well while not implicitly selected. The most common case like this would be where two views implement another, leading to a shared container holding the implemented view’s properties.

The change we are looking for to make will correct this behaviour such that results will only contain properties explicitly selected for each view, bringing the implementation back in line with the specified behaviour.

We recognise that the change to selected properties in query output may cause regressions, and are publishing this notice to help mitigate these. We still expect the overall impact to be minor, and to retain the current behaviour you only need to add the required properties to the set of properties selected in a query for the relevant view.

This change is tentatively scheduled for deployment on April 15th 2024.

Don’t hesitate to reach out to us if you have questions or concerns about this change.

Thanks,

-Anders D Morken,
for the CDF Data Modeling product team


2 replies

Userlevel 3
Badge

Based on your example, what about the scenario where B implements A? If I select A.x I would expect to see in the results the x property for nodes where the B view has data (since by inheritance these nodes also have data for A view). 

Userlevel 1

@Juan Alvarado The scenario where you have a view B that implements A, the current behavior is that property x will be included in the output for both views now if it is selected for just one of the views in the query - and we are changing this so that it will only be included for the view where it is selected. Meaning if you select property a from the A view and property x from the B view, the query output will include only property a from the A view and property x from the B view, while currently you will get property a and x from the A view and property x from the B view.

Thanks,

-AndersM

Reply