Skip to content

Conversation

FlorentinD
Copy link

No description provided.

@FlorentinD FlorentinD force-pushed the graph-analytics-docs branch from 4cd2fc4 to a9e43cb Compare August 4, 2025 09:23
@FlorentinD FlorentinD marked this pull request as ready for review August 4, 2025 09:25
@@ -1,3 +1,72 @@
== Setup Instructions
== Graph Analytics

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
== Graph Analytics
== Introduction

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Graph Analytics" is already the tab name, so this is more specific.

Comment on lines +3 to +7
Graph Analytics is a powerful feature of Neo4j Aura that allows users to run graph algorithms on their graph data. This includes tasks such as community detection, pathfinding, and centrality analysis.

More information about Aura Graph Analytics can be found in the Neo4j link:https://neo4j.com/docs/aura/graph-analytics[documentation].

You only need to have link:https://neo4j.com/docs/aura/api/authentication/[Aura API credentials] ready before you can start using sessions.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Graph Analytics is a powerful feature of Neo4j Aura that allows users to run graph algorithms on their graph data. This includes tasks such as community detection, pathfinding, and centrality analysis.
More information about Aura Graph Analytics can be found in the Neo4j link:https://neo4j.com/docs/aura/graph-analytics[documentation].
You only need to have link:https://neo4j.com/docs/aura/api/authentication/[Aura API credentials] ready before you can start using sessions.
link:https://neo4j.com/docs/aura/graph-analytics[Graph Analytics^] allows you to run graph algorithms on your data, for example to detect communities or shortest paths between nodes.
== Requirements
You must create link:https://neo4j.com/docs/aura/api/authentication/[Aura API credentials] to use Aura Graph Analytics.
Optionally, you can create an example dataset in your Neo4j database using the following Cypher query.
[source, cypher, copy=true]
----
CREATE
(a:User {name: 'Alice', age: 23}),
(b:User {name: 'Bridget', age: 34}),
(c:User {name: 'Charles', age: 45}),
(d:User {name: 'Dana', age: 56}),
(e:User {name: 'Eve', age: 67}),
(f:User {name: 'Fawad', age: 78}),
(a)-[:LINK {weight: 0.5}]->(b),
(b)-[:LINK {weight: 0.2}]->(a),
(a)-[:LINK {weight: 4}]->(c),
(c)-[:LINK {weight: 2}]->(e),
(e)-[:LINK {weight: 1.1}]->(d),
(e)-[:LINK {weight: -2}]->(f);
----


You only need to have link:https://neo4j.com/docs/aura/api/authentication/[Aura API credentials] ready before you can start using sessions.

=== Using the Graph Analytics Cypher API

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
=== Using the Graph Analytics Cypher API
== Graph Analytics with Cypher

Comment on lines +11 to +14
The Graph Analytics Cypher API provides a straightforward way to execute graph algorithms directly within your Neo4j database using Cypher queries.
You can use the `gds.aura.api.credentials` function to provide your credentials in your Cypher queries.

Assuming you have data in your Neo4j Aura database, the first step is to project a graph into Aura Graph Analytics.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The Graph Analytics Cypher API provides a straightforward way to execute graph algorithms directly within your Neo4j database using Cypher queries.
You can use the `gds.aura.api.credentials` function to provide your credentials in your Cypher queries.
Assuming you have data in your Neo4j Aura database, the first step is to project a graph into Aura Graph Analytics.
Assuming you already have some data in your AuraDB instance, the first step is to create a remote in-memory graph within an Aura Graph Analytics session using a _remote projection_.


Assuming you have data in your Neo4j Aura database, the first step is to project a graph into Aura Graph Analytics.

.Projecting a graph to a GDS Session:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.Projecting a graph to a GDS Session:

For more information about the Cypher API such as writing back results to the database, refer to the link:https://neo4j.com/docs/graph-data-science/current/aura-graph-analytics/cypher[Graph Data Science documentation].


=== Using the Python Client

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
=== Using the Python Client
== Graph Analytics with the Python client

=== Using the Python Client

To use the Graph Analytics features in Neo4j Aura with Python, you need to install the `graphdatascience` package.
Compared to the Cypher API, the Python client offers the option to run algorithms against non-neo4j data sources, such as Pandas DataFrames.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Compared to the Cypher API, the Python client offers the option to run algorithms against non-neo4j data sources, such as Pandas DataFrames.
Compared to the Cypher API, the Python client offers the option to run algorithms on data from non-Neo4j data sources such as Pandas DataFrames.

Comment on lines +56 to +68
import os

from graphdatascience.session import AuraAPICredentials, GdsSessions

# you can also use AuraAPICredentials.from_env() to load credentials from environment variables
api_credentials = AuraAPICredentials(
client_id=os.environ["CLIENT_ID"],
client_secret=os.environ["CLIENT_SECRET"],
# If your account is a member of several project, you must also specify the project ID to use
project_id=os.environ.get("PROJECT_ID", None),
)

sessions = GdsSessions(api_credentials=api_credentials)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import os
from graphdatascience.session import AuraAPICredentials, GdsSessions
# you can also use AuraAPICredentials.from_env() to load credentials from environment variables
api_credentials = AuraAPICredentials(
client_id=os.environ["CLIENT_ID"],
client_secret=os.environ["CLIENT_SECRET"],
# If your account is a member of several project, you must also specify the project ID to use
project_id=os.environ.get("PROJECT_ID", None),
)
sessions = GdsSessions(api_credentials=api_credentials)
from graphdatascience.session import GdsSessions, AuraAPICredentials
CLIENT_ID = "<Aura API Client ID>"
CLIENT_SECRET = "<Aura API Client Secret>"
PROJECT_ID = None
# Create a new GdsSessions object
sessions = GdsSessions(api_credentials=AuraAPICredentials(CLIENT_ID, CLIENT_SECRET, PROJECT_ID))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to add the examples for how to create a session and run an algorithm.

.Run an algorithm on the projected graph:
[source, cypher, copy=true]
----
WITH gds.aura.api.credentials($clientId, $clientSecret) AS credentials

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
WITH gds.aura.api.credentials($clientId, $clientSecret) AS credentials
WITH gds.aura.api.credentials("<Aura API Client ID>", "<Aura API Client Secret>") AS credentials

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We agreed to make auth examples easier by using placeholders rather than query parameters (same for the client examples).

Comment on lines +71 to +72

For more details, explore our client link:https://neo4j.com/docs/graph-data-science-client/current/graph-analytics-serverless/[docs] and the tutorials on link:https://neo4j.com/docs/graph-data-science-client/current/tutorials/graph-analytics-serverless/[attached], and link:https://neo4j.com/docs/graph-data-science-client/current/tutorials/graph-analytics-serverless-standalone/[standalone] sessions).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For more details, explore our client link:https://neo4j.com/docs/graph-data-science-client/current/graph-analytics-serverless/[docs] and the tutorials on link:https://neo4j.com/docs/graph-data-science-client/current/tutorials/graph-analytics-serverless/[attached], and link:https://neo4j.com/docs/graph-data-science-client/current/tutorials/graph-analytics-serverless-standalone/[standalone] sessions).
For more details, see the Python client link:https://neo4j.com/docs/graph-data-science-client/current/graph-analytics-serverless/[docs] and the link:https://neo4j.com/docs/graph-data-science-client/current/tutorials/graph-analytics-serverless/[tutorial for AuraDB].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants