How to import graph in azure digital twins through python SDK or APIs?

Gorthi Sai Sri Sindhuja 60 Reputation points
2023-10-03T04:36:58.2266667+00:00

Hello,

Is there a way to import graph in digital twins using python SDK or APIs.

I'm usually uploading models with the help of JSON files and then creating twins and relationships.

But there are some 1000 models, which is resulting in 1000 JSON files. We found out that we can import graph with single JSON file. So, could you help us with this?

Azure Digital Twins
Azure Digital Twins
An Azure platform that is used to create digital representations of real-world things, places, business processes, and people.
221 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AshokPeddakotla-MSFT 28,306 Reputation points
    2023-10-03T08:14:20.54+00:00

    Gorthi Sai Sri Sindhuja Gorthi Sai Sri Sindhuja Greetings!

    Is there a way to import graph in digital twins using python SDK or APIs.

    You can try using the Jobs API to upload multiple models, twins, and relationships to your instance in a single API call, effectively creating the graph all at once.

    But there are some 1000 models, which is resulting in 1000 JSON files. We found out that we can import graph with single JSON file. So, could you help us with this?

    Please see Bulk import with the Jobs API This method requires the use of Azure Blob Storage, as well as write permissions in your Azure Digital Twins instance for graph elements (models, twins, and relationships) and bulk jobs.

    To import resources in bulk, you can try by creating an NDJSON file containing the details of your resources.

    Also, see Azure Digital Twins APIs and SDKs for more details.

    Let us know if that helps or have any further queries.