@Sebastian, Joshua
As per my understanding of the query, you need to create a digital twins graph out of CSV files extracted from P&ID diagram. Correct me if I'm wrong.
One way to get this data into Azure Digital Twins is to write a code to interpret the CSV file into commands to create twins and relationships. The following code sample illustrates reading the data from the CSV file and creating a twin graph in Azure Digital Twins.
Example:
// Method to ingest data from the CSV file
public static List<List<string>> ReadData()
{
string path = "<path-to>/filename.csv";
string[] lines = System.IO.File.ReadAllLines(path);
List<List<string>> data = new List<List<string>>();
int count = 0;
foreach (string line in lines)
{
if (count++ == 0)
continue;
List<string> cols = new List<string>();
data.Add(cols);
string[] columns = line.Split(',');
foreach (string column in columns)
{
cols.Add(column);
}
}
return data;
}
// Method to create the digital twins client
private static DigitalTwinsClient createDTClient()
{
string adtInstanceUrl = "https://<your-instance-hostname>";
var credentials = new DefaultAzureCredential();
DigitalTwinsClient client = new DigitalTwinsClient(new Uri(adtInstanceUrl), credentials);
return client;
}
I would suggest you, go through the Create graph from a CSV file documentation sample and see if it helps.
Do let us know if you have any further queries.
----------------------------------------------------------------------------------------------------------------------------------------
If an answer is helpful, please "Accept answer" or "Up-Vote" for the same which might be beneficial to other community members reading this thread.