Impact 2024: The Industrial Data and AI Conference for and by Users | Nominate Speakers Now for a Ch...
Thanks for the call @Jason Dressel . Now we got it to work using the dictionary style filter: filter_with_sdmId = { "and": [ { "equals": { "property": [ "node", "space" ], "value": "xxx_Space" } }, { "prefix": { "property": [ "node", "externalId" ], "value": "xxxID" } }, { "equals": { "property": [ "xxx_Space", prop_view[0].as_id().as_source_identifier(), "workflow", ], "value": "xxx" } } ] }This syntax is not easy to find out through the API document as mentioned in the call. Hopefully
@Jason Dressel You can use xwsdm in slb_simuations for testing. We would like to query the property instances with Prefix filter on externalID(for example, ‘df023726-a8e9-43a2-8dfc-00578daf93a4’) and Equal filter on workflow(for example, ‘measured’) Regards,Xiaofeng
Thanks @Jason Dressel The filtering on the externalId works.Could you also show me how to convert the code below to the dictionary format:filters.Prefix(prop_view[0].as_id().as_property_ref("workflow"),"xxx")Also it would be very helpful if you can let me know where I can find the how to compose the filters. Below is the example from the API document. and I could not make any meaning filter based on that sample. Is there any other documents with more detailed examples?filter": {"and": [{"in": {"property": ["tag"],"values": [10011,10011]}},{"range": {"property": ["weight"],"gte": 0}}]}Regards,Xiaofeng
Hi Jason,filters is a build in object in Cognite pythonSDK:import cognite.client.data_classes.filters as filtersI am trying to filter instances, so the next step I did is:filter_with_sdmId = filters.Prefix(prop_view[0].as_id().as_property_ref("workflow"),"xxx")prop_timeseries_instances = client.data_modeling.instances.list(instance_type='node', sources=prop_view, limit=None, filter=filter_with_sdmId)The code above works well, but I don’t know how to do filtering on externalId, instead of “workflow” property.The external_id for a viewId is the name of the view, which doesn’t help in our case:Our externalId of the instances looks like “XXXX:{instanceName}”, and I would like to find out all the instances with the “XXXX” as prefix in their externalId. -Xiaofeng
I was creating the instances. Probably it is only edges has dependency. So the nodes need to be created first and then the edges? I have more than 2000 instances(including nodes and edges) for a model and would like to find out what is the best way to create them in FDM. Probably first nodes and then edges? Looks like for direction relations there is no dependency so we can insert those instances in any order.Regards,Xiaofeng
Yes, it is already fixed. Thanks!
Aha, I see. So a one to one relation or “Direct” relation does not need an Edge. Now I am able to create a “Direct” relation between those two instances following your suggestion. Thanks a lot!
Hi Jason, Thanks for your reply. As you may see, I created an instance for SimulationModel and also an instance for Simulator and would like to create a direct relation between those two instances. I tried to use “SimulationModel.simulator” and “SimulationModel.Simulator” or any string as the “externalId” of the “type” when creating the edge but seems no matter what I used a new edge was created successfully.Request:{ "items": [ { "instanceType": "node", "space": "XiaofengTest", "externalId": "externalId:simmodel1", "sources": [ { "source": { "type": "view", "space": "XiaofengTest", "externalId": "SimulationModel", "version": "1" }, "properties": { "modelName": "firstSimulationModelName", "modelId": "xxx-xxx-xxx-xxx-xxx"
Hi,Thanks for confirming this is an known issue. I just tried to switch to use the API to post an edge instead. I am able to ingest nodes but could not ingest an edge through the API. To ingest an edge it requires a “type” field, which needs an “externalId” field. Do you know where I can find the “externalId” for the edge?
Hi Carin,No worries. We are able to download it using a private computer. Thanks for your help.Xiaofeng
Thanks for the reply. Will use String type for now.
Hi David, Thanks for the info. I was using node v14.20 following the instructions when downloading the CLI tool. After upgrading the node I am now able to run the datamodel publish. I still got an error message “The field type 'TimeSeries' is not present when resolving type 'Property' [@36:1]” but I raised the question in a separate thread.Maybe the prerequisite should be updated for the CDF CLI:
Hi Thomas,Thanks for your quick reply. I guess this link is probably forbidden in SLB. We are able to download it using a private computer.
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.