Azure Cosmos Db Create Graph Database Manually

JJ Sharma 1 Reputation point

Graph databases sounds very interesting and I want to experiment a little with it.

So, how do I manually add data to a graph database through Azure Portal GUI. In the Azure Portal GUI, there's an option to add New Vertex. But I can't seem to find an option to add Edges (relationships) between the Vertices?

(I've reviewed the practice exercise to import sample graph data via Git directory, but I'm more keen to build/create (not import) a small graph DB through the portal GUI).

Any guidance would be much appreciated.

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,433 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Oury Ba-MSFT 16,076 Reputation points Microsoft Employee

    Hi @JJ Sharma Thank you for posting your question on Microsoft Q&A and for using Azure services.

    My understanding is that you are trying to manually add data and vertex in Azure Cosmos DB using the Azure Portal. Please let me know if my understanding is not correct.
    Please follow the instructions below to achieve that.

    The Gremlin Console is an interactive terminal offered by the Apache TinkerPop and this terminal is used to interact with the graph data. To learn more, see the quickstart doc on how to use the Gremlin console. You can also perform these operations using Gremlin drivers in the platform of your choice (Java, Node.js, Python, or .NET). The following examples show how to run queries against this graph data using the Gremlin Console.

    In Azure Cosmos DB, you can create containers to store graph elements (vertices and edges). To see your graph, go to Data Explorer and find the 'graphdb' database.

    Download and run your Gremlin Console app. To use Gremlin Console on Windows, you need to install Java Runtime, minimum requires Java 8 but it is preferable to use Java 11). See Quickstart: Create, query, and traverse an Azure Cosmos DB graph database using the Gremlin console

    The following Gremlin statement inserts the "Thomas" vertex into the graph:
    :> g.addV('person').property('id', 'thomas.1').property('firstName', 'Thomas').property('lastName', 'Andersen').property('age', 44)

    Since you want to experiment Graph database I will suggest going through the below docs from Microsoft

    Introduction to Gremlin API in Azure Cosmos DB
    Tutorial: Query Azure Cosmos DB Gremlin API by using Gremlin
    Get Started Create, query, and traverse using the Gremlin console
    Import Graph DataLearn Bulk ingestion data using BulkExecutor
    Optimize your QueriesLearn how to evaluate your Gremlin queries