0

we are planning to migrate our db to Azure cosmos graph db. we are using this bulk import tool.

nowhere it mentioned Json input format.

Whats the Json format for bulk import to Azure cosmos graph db

https://github.com/Azure-Samples/azure-cosmosdb-graph-bulkexecutor-dotnet-getting-started

azure bulk import image

Appreciate any help.

Curiosa Globunznik
  • 3,129
  • 1
  • 16
  • 24
satish a
  • 1
  • 2
  • My Edges are like this g.V('6065').addE('s1').property('startDate', '2014-10-14').property('endDate', '2014-10-15').property('notes', 'test-false').property('code', 'US').property('lastUpdateBy', 'initialLoad').property('lastUpdateDate', '10/18/19, 15:21:03 CDT').property('ay-flag', 'GY-false').to(g.V('111')) Whats the equivalent JSON ? – satish a Oct 19 '19 at 02:37
  • where are you exporting the data from ? – AlexDrenea Oct 22 '19 at 18:34
  • Hi Alex, I am exporting from DB2. But I have created the edge queries. I can convert my queries to JSON. But whats the format of the JSON? My Edge creation queries are like this. g.V('6065').addE('s1').property('startDate', '2014-10-14').property('endDate', '2014-10-15').property('notes', 'test-false').property('code', 'US').property('lastUpdateBy', 'initialLoad').property('lastUpdateDate', '10/18/19, 15:21:03 CDT').property('ay-flag', 'GY-false').to(g.V('111')) – satish a Oct 22 '19 at 22:26
  • got it! check my answer below – AlexDrenea Oct 23 '19 at 02:41

1 Answers1

0

You actually don't need to build the gremlin queries to insert your edges. In CosmosDB, everything is regarded as a JSON document (even the vertices and edges in a graph collection).

The format of the required JSON isn't officially published and can change at any time but can be discovered though inspection of the SDKs.

I wrote about it here a while ago and it is still valid today.

AlexDrenea
  • 7,981
  • 1
  • 32
  • 49
  • Thanks Alex. I need JSON format for bulk data loading. For regular operations, we are using Gremlin queries that you suggested. Appreciate any help if we can get the JSON format for Bulk data loading https://github.com/Azure-Samples/azure-cosmosdb-graph-bulkexecutor-dotnet-getting-started – satish a Oct 23 '19 at 20:13
  • in my article I show the JSON representation of an edge and vertice. You can use that format for the bulk insert (i.e. create a file that has a collection of those JSON documents – AlexDrenea Oct 24 '19 at 13:42
  • Hi Alex, it's creating vertex, but Not edges. – satish a Oct 27 '19 at 15:31