-
Notifications
You must be signed in to change notification settings - Fork 17
Graph Analytics page #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Graph Analytics page #59
Conversation
4cd2fc4
to
a9e43cb
Compare
@@ -1,3 +1,72 @@ | |||
== Setup Instructions | |||
== Graph Analytics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
== Graph Analytics | |
== Introduction |
There was a problem hiding this comment.
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.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=== Using the Graph Analytics Cypher API | |
== Graph Analytics with Cypher |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=== 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WITH gds.aura.api.credentials($clientId, $clientSecret) AS credentials | |
WITH gds.aura.api.credentials("<Aura API Client ID>", "<Aura API Client Secret>") AS credentials |
There was a problem hiding this comment.
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).
|
||
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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]. |
No description provided.