Skip to content

Commit a8485db

Browse files
FlorentinDnvitucci
andcommitted
Apply wording suggestions
Co-authored-by: Nicola Vitucci <[email protected]>
1 parent c67c78d commit a8485db

6 files changed

+128
-259
lines changed

doc/modules/ROOT/pages/tutorials/graph-analytics-serverless-self-managed.adoc

Lines changed: 37 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ example].
2525

2626
== Prerequisites
2727

28-
This notebook requires having a Neo4j instance instance available and
29-
that the Graph Analytics Serverless
28+
This notebook requires having a Neo4j instance available and that the
29+
Graph Analytics Serverless
3030
https://neo4j.com/docs/aura/graph-analytics/#aura-gds-serverless[feature]
3131
is enabled for your Neo4j Aura project.
3232

33-
We also need to have the `graphdatascience` Python library installed,
33+
You also need to have the `graphdatascience` Python library installed,
3434
version `1.15` or later.
3535

3636
[source, python, role=no-test]
@@ -40,12 +40,9 @@ version `1.15` or later.
4040

4141
== Aura API credentials
4242

43-
A GDS Session is managed via the Aura API. In order to use the Aura API,
44-
we need to have https://neo4j.com/docs/aura/api/authentication[Aura API
45-
credentials].
46-
47-
Using these credentials, we can create our `GdsSessions` object, which
48-
is the main entry point for managing GDS Sessions.
43+
The entry point for managing GDS Sessions is the `GdsSessions` object,
44+
which requires creating
45+
https://neo4j.com/docs/aura/api/authentication[Aura API credentials].
4946

5047
[source, python, role=no-test]
5148
----
@@ -64,24 +61,18 @@ sessions = GdsSessions(api_credentials=AuraAPICredentials(client_id, client_secr
6461

6562
== Creating a new session
6663

67-
A new session is created by calling `sessions.get++_++or++_++create()`.
68-
As the data source, we assume that a self-managed Neo4j DBMS instance
69-
has been set up and is accessible. We need to pass the database address,
70-
user name and password to the `DbmsConnectionInfo` class.
64+
A new session is created by calling `sessions.get++_++or++_++create()`
65+
with the following parameters: ++*++ A session name, which lets you
66+
reconnect to an existing session by calling `get++_++or++_++create`
67+
again. ++*++ The `DbmsConnectionInfo` containing the address, user name
68+
and password for an accessible self-manged Neo4j DBMS instance ++*++ The
69+
session memory. ++*++ The cloud location. ++*++ A time-to-live (TTL),
70+
which ensures that the session is automatically deleted after being
71+
unused for the set time, to avoid incurring costs.
7172

72-
We also need to specify the session `memory` and `cloud++_++location`.
73-
Please refer to the API reference
73+
See the API reference
7474
https://neo4j.com/docs/graph-data-science-client/current/api/sessions/gds_sessions/#graphdatascience.session.gds_sessions.GdsSessions.get_or_create[documentation]
75-
or the manual for a full list options.
76-
77-
Finally, we need to give our session a name. We will call ours
78-
`people-and-fruits-sm'. It is possible to reconnect to an existing session by calling`get++_++or++_++create++`++
79-
with the same session name and configuration.
80-
81-
We will also set a time-to-live (TTL) for the session. This ensures that
82-
our session is automatically deleted after being unused for 30 minutes.
83-
This is a good practice to avoid incurring costs should we forget to
84-
delete the session ourselves.
75+
or the manual for more details on the parameters.
8576

8677
[source, python, role=no-test]
8778
----
@@ -121,7 +112,7 @@ db_connection = DbmsConnectionInfo(
121112
122113
# Create a GDS session!
123114
gds = sessions.get_or_create(
124-
# we give it a representative name
115+
# give it a representative name
125116
session_name="people-and-fruits-sm",
126117
memory=memory,
127118
db_connection=db_connection,
@@ -132,8 +123,8 @@ gds = sessions.get_or_create(
132123

133124
== Listing sessions
134125

135-
Now that we have created a session, let’s list all our sessions to see
136-
what that looks like
126+
You can use `sessions.list()` to see the details for each created
127+
session.
137128

138129
[source, python, role=no-test]
139130
----
@@ -147,10 +138,10 @@ DataFrame(gds_sessions)
147138

148139
== Adding a dataset
149140

150-
We assume that the configured Neo4j database instance is empty. We will
151-
add our dataset using standard Cypher.
141+
We assume that the configured Neo4j database instance is empty. You will
142+
add the dataset using standard Cypher.
152143

153-
In a more realistic scenario, this step is already done, and we would
144+
In a more realistic scenario, this step is already done, and you would
154145
just connect to the existing database.
155146

156147
[source, python, role=no-test]
@@ -201,15 +192,15 @@ gds.run_cypher("MATCH (n) RETURN count(n) AS nodeCount")
201192

202193
== Projecting Graphs
203194

204-
Now that we have imported a graph to our database, we can project it
205-
into our GDS Session. We do that by using the `gds.graph.project()`
195+
Now that you have imported a graph to the database, you can project it
196+
into our GDS Session. You do that by using the `gds.graph.project()`
206197
endpoint.
207198

208-
The remote projection query that we are using selects all `Person` nodes
209-
and their `LIKES` relationships, and all `Fruit` nodes and their `LIKES`
210-
relationships. Additionally, we project node properties for illustrative
211-
purposes. We can use these node properties as input to algorithms,
212-
although we do not do that in this notebook.
199+
The remote projection query that you are using selects all `Person`
200+
nodes and their `LIKES` relationships, and all `Fruit` nodes and their
201+
`LIKES` relationships. Additionally, node properties are projected for
202+
illustrative purposes. You can use these node properties as input to
203+
algorithms, although it is note done in this notebook.
213204

214205
[source, python, role=no-test]
215206
----
@@ -246,12 +237,8 @@ str(G)
246237

247238
== Running Algorithms
248239

249-
We can now run algorithms on the projected graph. This is done using the
250-
standard GDS Python Client API. There are many other tutorials covering
251-
some interesting things we can do at this step, so we will keep it
252-
rather brief here.
253-
254-
We will simply run PageRank and FastRP on the graph.
240+
You can run algorithms on the constructed graph using the standard GDS
241+
Python Client API. See the other tutorials for more examples.
255242

256243
[source, python, role=no-test]
257244
----
@@ -289,15 +276,15 @@ the PageRank and FastRP algorithms to the Neo4j database.
289276
gds.graph.nodeProperties.write(G, ["pagerank", "fastRP"])
290277
----
291278

292-
Of course, we can just use `.write` modes as well. Let’s run Louvain in
279+
Of course, you can just use `.write` modes as well. Let’s run Louvain in
293280
write mode to show:
294281

295282
[source, python, role=no-test]
296283
----
297284
gds.louvain.write(G, writeProperty="louvain")
298285
----
299286

300-
We can now use the `gds.run++_++cypher()` method to query the updated
287+
You can now use the `gds.run++_++cypher()` method to query the updated
301288
graph. Note that the `run++_++cypher()` method will run the query on the
302289
Neo4j database.
303290

@@ -314,10 +301,10 @@ gds.run_cypher(
314301

315302
== Deleting the session
316303

317-
Now that we have finished our analysis, we can delete the session. The
318-
results that we produced were written back to our Neo4j database, and
319-
will not be lost. If we computed additional things that we did not write
320-
back, those will be lost.
304+
Now that you have finished the analysis, you can delete the session. The
305+
results that you produced were written back to our Neo4j database, and
306+
will not be lost. If you computed additional things that you did not
307+
write back, those will be lost.
321308

322309
Deleting the session will release all resources associated with it, and
323310
stop incurring costs.
@@ -339,9 +326,3 @@ sessions.list()
339326
# Lastly, let's clean up the database
340327
gds.run_cypher("MATCH (n:Person|Fruit) DETACH DELETE n")
341328
----
342-
343-
== Conclusion
344-
345-
And we’re done! We have created a GDS Session, projected a graph, run
346-
some algorithms, written back the results, and deleted the session. This
347-
is a simple example, but it shows the main steps of using GDS Sessions.

doc/modules/ROOT/pages/tutorials/graph-analytics-serverless-standalone.adoc

Lines changed: 22 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// DO NOT EDIT - AsciiDoc file generated automatically
22

3-
= Graph Analytics Serverless for any data source
3+
= Graph Analytics Serverless for non-Neo4j data sources
44

55

66
https://colab.research.google.com/github/neo4j/graph-data-science-client/blob/main/examples/graph-analytics-serverless-standalone.ipynb[image:https://colab.research.google.com/assets/colab-badge.svg[Open
@@ -25,12 +25,11 @@ link:../graph-analytics-serverless-self-managed[this example].
2525

2626
== Prerequisites
2727

28-
This notebook requires having a Neo4j instance instance available and
29-
that the Graph Analytics Serverless
28+
This notebook requires having the Graph Analytics Serverless
3029
https://neo4j.com/docs/aura/graph-analytics/#aura-gds-serverless[feature]
31-
is enabled for your Neo4j Aura project.
30+
enabled for your Neo4j Aura project.
3231

33-
We also need to have the `graphdatascience` Python library installed,
32+
You also need to have the `graphdatascience` Python library installed,
3433
version `1.15` or later.
3534

3635
[source, python, role=no-test]
@@ -40,13 +39,9 @@ version `1.15` or later.
4039

4140
== Aura API credentials
4241

43-
A GDS Session is managed via the Aura API. In order to use the Aura API,
44-
we need to have
45-
https://neo4j.com/docs/aura/platform/api/authentication/#_creating_credentials[Aura
46-
API credentials].
47-
48-
Using these credentials, we can create our `GdsSessions` object, which
49-
is the main entry point for managing GDS Sessions.
42+
The entry point for managing GDS Sessions is the `GdsSessions` object,
43+
which requires creating
44+
https://neo4j.com/docs/aura/api/authentication[Aura API credentials].
5045

5146
[source, python, role=no-test]
5247
----
@@ -65,22 +60,16 @@ sessions = GdsSessions(api_credentials=AuraAPICredentials(client_id, client_secr
6560

6661
== Creating a new session
6762

68-
A new session is created by calling `sessions.get++_++or++_++create()`.
69-
We also need to specify the session `memory` and `cloud++_++location`.
63+
A new session is created by calling `sessions.get++_++or++_++create()`
64+
with the following parameters: ++*++ A session name, which lets you
65+
reconnect to an existing session by calling `get++_++or++_++create`
66+
again. ++*++ The session memory. ++*++ The cloud location. ++*++ A
67+
time-to-live (TTL), which ensures that the session is automatically
68+
deleted after being unused for the set time, to avoid incurring costs.
7069

71-
Please refer to the API reference
70+
See the API reference
7271
https://neo4j.com/docs/graph-data-science-client/current/api/sessions/gds_sessions/#graphdatascience.session.gds_sessions.GdsSessions.get_or_create[documentation]
73-
or the manual for a full list options.
74-
75-
Finally, we need to give our session a name. We will call ours
76-
`people-and-fruits-standalone`. It is possible to reconnect to an
77-
existing session by calling `get++_++or++_++create` with the same
78-
session name and configuration.
79-
80-
We will also set a time-to-live (TTL) for the session. This ensures that
81-
our session is automatically deleted after being unused for 30 minutes.
82-
This is a good practice to avoid incurring costs should we forget to
83-
delete the session ourselves.
72+
or the manual for more details on the parameters.
8473

8574
[source, python, role=no-test]
8675
----
@@ -122,8 +111,8 @@ gds = sessions.get_or_create(
122111

123112
== Listing sessions
124113

125-
Now that we have created a session, let’s list all our sessions to see
126-
what that looks like
114+
You can use `sessions.list()` to see the details for each created
115+
session.
127116

128117
[source, python, role=no-test]
129118
----
@@ -198,12 +187,8 @@ str(G)
198187

199188
== Running Algorithms
200189

201-
We can now run algorithms on the constructed graph. This is done using
202-
the standard GDS Python Client API. There are many other tutorials
203-
covering some interesting things we can do at this step, so we will keep
204-
it rather brief here.
205-
206-
We will simply run PageRank and FastRP on the graph.
190+
You can run algorithms on the constructed graph using the standard GDS
191+
Python Client API. See the other tutorials for more examples.
207192

208193
[source, python, role=no-test]
209194
----
@@ -240,10 +225,9 @@ result.merge(names, how="left")
240225

241226
== Deleting the session
242227

243-
Now that we have finished our analysis, we can delete the session. The
244-
results that we produced were written back to our Neo4j database, and
245-
will not be lost. If we computed additional things that we did not write
246-
back, those will be lost.
228+
After the analysis is done, you can delete the session. As this example
229+
is not connected to a Neo4j DB, you need to make sure the algorithm
230+
results are persisted on your own.
247231

248232
Deleting the session will release all resources associated with it, and
249233
stop incurring costs.
@@ -259,10 +243,3 @@ sessions.delete(session_name="people-and-fruits-standalone")
259243
# let's also make sure the deleted session is truly gone:
260244
sessions.list()
261245
----
262-
263-
== Conclusion
264-
265-
And we’re done! We have created a GDS Session, constructed a graph, run
266-
some algorithms, inspect the algorithm results, and deleted the session.
267-
This is a simple example, but it shows the main steps of using GDS
268-
Sessions.

doc/modules/ROOT/pages/tutorials/graph-analytics-serverless.adoc

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Graph Analytics Serverless
3030
https://neo4j.com/docs/aura/graph-analytics/#aura-gds-serverless[feature]
3131
enabled for your project.
3232

33-
We also need to have the `graphdatascience` Python library installed,
33+
You also need to have the `graphdatascience` Python library installed,
3434
version `1.15` or later.
3535

3636
[source, python, role=no-test]
@@ -40,12 +40,9 @@ version `1.15` or later.
4040

4141
== Aura API credentials
4242

43-
A GDS Session is managed via the Aura API. In order to use the Aura API,
44-
we need to have https://neo4j.com/docs/aura/api/authentication[Aura API
45-
credentials].
46-
47-
Using these credentials, we can create our `GdsSessions` object, which
48-
is the main entry point for managing GDS Sessions.
43+
The entry point for managing GDS Sessions is the `GdsSessions` object,
44+
which requires creating
45+
https://neo4j.com/docs/aura/api/authentication[Aura API credentials].
4946

5047
[source, python, role=no-test]
5148
----
@@ -64,22 +61,18 @@ sessions = GdsSessions(api_credentials=AuraAPICredentials(client_id, client_secr
6461

6562
== Creating a new session
6663

67-
A new session is created by calling `sessions.get++_++or++_++create()`.
68-
As the data source, we assume here that an AuraDB instance has been
69-
created and is available for access. We need to pass the database
70-
address, username and password to the `DbmsConnectionInfo` class.
71-
72-
We also need to specify the size of the session. Please refer to the API
73-
reference documentation or the manual for a full list.
74-
75-
Finally, we need to give our session a name. We will call ours
76-
`people-and-fruits'. It is possible to reconnect to an existing session by calling`get++_++or++_++create++`++
77-
with the same session name and configuration.
64+
A new session is created by calling `sessions.get++_++or++_++create()`
65+
with the following parameters: ++*++ A session name, which lets you
66+
reconnect to an existing session by calling `get++_++or++_++create`
67+
again. ++*++ The `DbmsConnectionInfo` containing the address, user name
68+
and password to an AuraDB instance ++*++ The session memory. ++*++ The
69+
cloud location. ++*++ A time-to-live (TTL), which ensures that the
70+
session is automatically deleted after being unused for the set time, to
71+
avoid incurring costs.
7872

79-
We will also set a time-to-live (TTL) for the session. This ensures that
80-
our session is automatically deleted after being unused for 30 minutes.
81-
This is a good practice to avoid incurring costs should we forget to
82-
delete the session ourselves.
73+
See the API reference
74+
https://neo4j.com/docs/graph-data-science-client/current/api/sessions/gds_sessions/#graphdatascience.session.gds_sessions.GdsSessions.get_or_create[documentation]
75+
or the manual for more details on the parameters.
8376

8477
[source, python, role=no-test]
8578
----
@@ -119,8 +112,8 @@ gds = sessions.get_or_create(
119112

120113
== Listing sessions
121114

122-
Now that we have created a session, let’s list all our sessions to see
123-
what that looks like
115+
You can use `sessions.list()` to see the details for each created
116+
session.
124117

125118
[source, python, role=no-test]
126119
----
@@ -233,12 +226,8 @@ str(G)
233226

234227
== Running Algorithms
235228

236-
We can now run algorithms on the projected graph. This is done using the
237-
standard GDS Python Client API. There are many other tutorials covering
238-
some interesting things we can do at this step, so we will keep it
239-
rather brief here.
240-
241-
We will simply run PageRank and FastRP on the graph.
229+
You can run algorithms on the constructed graph using the standard GDS
230+
Python Client API. See the other tutorials for more examples.
242231

243232
[source, python, role=no-test]
244233
----
@@ -327,9 +316,3 @@ sessions.list()
327316
# Lastly, let's clean up the database
328317
gds.run_cypher("MATCH (n:Person|Fruit) DETACH DELETE n")
329318
----
330-
331-
== Conclusion
332-
333-
And we’re done! We have created a GDS Session, projected a graph, run
334-
some algorithms, written back the results, and deleted the session. This
335-
is a simple example, but it shows the main steps of using GDS Sessions.

0 commit comments

Comments
 (0)