Hi there,
We would like to be able to annotate instances that do not extend CogniteAsset, nor CogniteFile and visualize that in “Preview” in Search UI. Our context is purely data modeling.
So we would like to have a view, that extends CogniteDescriable and to be able to annotate it towards a CogniteFile.
Currently we are achieving partically that, by having an edge, (pseudo code below)
ANNOTATION_TYPE = "diagrams.InstanceLink"
type_node = NodeApply(space=REFERENCE_SPACE, external_id=ANNOTATION_TYPE)
edge = EdgeApply(
space=EDGE_INSTANCE_SPACE,
external_id="annotation_<file_ext_id>__<entity_ext_id>",
type=DirectRelationReference(space=REFERENCE_SPACE, external_id=ANNOTATION_TYPE),
start_node=DirectRelationReference(space=FILE_SPACE, external_id=FILE_EXTERNAL_ID),
end_node=DirectRelationReference(space=ENTITY_SPACE, external_id=ENTITY_EXTERNAL_ID),
sources=[
NodeOrEdgeData(
source=ViewId("cdf_cdm", "CogniteDiagramAnnotation", "v1"),
properties={
"startNodePageNumber": 1, # 1-based page index
"startNodeXMin": x_min, # (center_x - half_size) / page_width_px
"startNodeXMax": x_max, # (center_x + half_size) / page_width_px
"startNodeYMin": y_min, # (center_y - half_size) / page_height_px
"startNodeYMax": y_max, # (center_y + half_size) / page_height_px
},
)
],
)
And it works partically
The annotation is visible on the file preview, however the bounding box is just gray, nothing happens when you press it and no specific “info box” appears on top of it.
Also on the right part, where is the list of all annotations, we have found out that this list filter is hardcoded to deriveables of CogniteAsset or CogniteFile, in our case our custom View is neither CogniteAsset nor CogniteFile
So I would like to ask a feature request, to display and visualize all of the annotations, even if they come from custom views, and not only the derivables of CogniteAsset or CogniteFile.
Basically, if there is an annotation to it, I would expect that:
- bounding box will be coloured
- clicking on the bounding box will display the view name, instance name and instance description
- on the right panel the view will be filterable and listable (in Document preview in Search UI)
I am part of data engineering team in AkerBP, so please do try to contact me for demos and examples, via AkerBP’s internal communication channels.
Check the
documentation
Ask the
Community
Take a look
at
Academy
Cognite
Status
Page
Contact
Cognite Support
