Skip to content

Commit 94bdeda

Browse files
committed
Update to pandoc 3.6.2
1 parent b3acbec commit 94bdeda

12 files changed

+223
-215
lines changed

doc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ The script `../scripts/nb2doc/convert.sh` can be used:
134134
* to generate documents from new notebooks;
135135
* to ensure that any changes to the existing notebooks are reflected in the existing documents (for instance in a CI setting).
136136

137-
The script must be run from the project root directory and requires [Pandoc](https://pandoc.org/) to be already installed. The latest supported version of Pandoc is 3.5
137+
The script must be run from the project root directory and requires [Pandoc](https://pandoc.org/) to be already installed. The latest supported version of Pandoc is 3.6.2
138138

139139
```bash
140140
./scripts/nb2doc/convert.sh

doc/modules/ROOT/pages/tutorials/centrality-algorithms.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ in the Neo4j Graph Data Science Client Github repository.
1313

1414
Centrality algorithms are used to understand the role or influence of
1515
particular nodes in a graph. The notebook shows the application of
16-
centrality algorithms using the `+graphdatascience+` library on the
16+
centrality algorithms using the `graphdatascience` library on the
1717
Airline travel reachability network dataset that can be downloaded
1818
https://snap.stanford.edu/data/reachability.html[here].
1919

@@ -64,10 +64,10 @@ assert gds.server_version() >= ServerVersion(1, 8, 0)
6464
== Importing the dataset
6565

6666
We import the dataset as a pandas dataframe first. We deal with two
67-
files here. The file `+reachability-meta.csv.gz+` stores the names of
68-
the cities and their information while the file `+reachability.txt.gz+`
69-
stores the edges of the graph. An edge exists from city `+i+` to city
70-
`+j+` if the estimated airline travel time is less than a threshold.
67+
files here. The file `reachability-meta.csv.gz` stores the names of the
68+
cities and their information while the file `reachability.txt.gz` stores
69+
the edges of the graph. An edge exists from city `i` to city `j` if the
70+
estimated airline travel time is less than a threshold.
7171

7272
[source, python, role=no-test]
7373
----
@@ -88,11 +88,11 @@ routes_df = pd.read_csv(
8888
routes_df.head()
8989
----
9090

91-
Since this graph is very small, a straight-forward Cypher `+UNWIND+`
92-
query is the simplest way to create our graph in the database.
91+
Since this graph is very small, a straight-forward Cypher `UNWIND` query
92+
is the simplest way to create our graph in the database.
9393

9494
Larger graphs may need a more sophisticated importing technique like
95-
batching, `+neo4j-admin import+` or Arrow `+CREATE DATABASE+`.
95+
batching, `neo4j-admin import` or Arrow `CREATE DATABASE`.
9696

9797
[source, python, role=no-test]
9898
----

doc/modules/ROOT/pages/tutorials/community-detection.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ This Jupyter notebook is hosted
1111
https://github.com/neo4j/graph-data-science-client/blob/main/examples/community-detection.ipynb[here]
1212
in the Neo4j Graph Data Science Client Github repository.
1313

14-
The notebook shows the usage of the `+graphdatascience+` library for
14+
The notebook shows the usage of the `graphdatascience` library for
1515
community detection on the Reddit Hyperlink Network dataset that can be
1616
downloaded
1717
https://snap.stanford.edu/data/soc-RedditHyperlinks.html[here]. We will
18-
use the `+soc-redditHyperlinks-body.tsv+` file.
18+
use the `soc-redditHyperlinks-body.tsv` file.
1919

2020
The tasks we cover here include performing initial graph preprocessing
2121
using Weakly Connected Components and then performing community
@@ -73,8 +73,8 @@ df = df[df["TIMESTAMP"] < "2014-03-01 02:51:13"]
7373
df.head()
7474
----
7575

76-
The `+LINK_SENTIMENT+` column tells if there is a positive (+1) or
77-
negative (-1) relationship from the source subreddit to destination
76+
The `LINK++_++SENTIMENT` column tells if there is a positive ({plus}1)
77+
or negative (-1) relationship from the source subreddit to destination
7878
subreddit. We filter out the negative sentiment relationships as they
7979
won’t add to any meaningful communities. We also drop duplicate
8080
relationships.
@@ -172,7 +172,7 @@ G.node_properties()
172172
Next, we will see the size of each connected component and depending on
173173
that, we can pick the subgraph that needs further analysis.
174174

175-
We use `+run_cypher+` here instead of the direct GDS client call since
175+
We use `run++_++cypher` here instead of the direct GDS client call since
176176
we want to see the size of the connected components.
177177

178178
[source, python, role=no-test]
@@ -213,7 +213,7 @@ largest_component_graph
213213
We use the
214214
https://neo4j.com/docs/graph-data-science/current/algorithms/louvain/[Louvain]
215215
algorithm to detect communities in our subgraph and assign a
216-
`+louvainCommunityId+` to each community.
216+
`louvainCommunityId` to each community.
217217

218218
[source, python, role=no-test]
219219
----

doc/modules/ROOT/pages/tutorials/fastrp-and-knn.adoc

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This Jupyter notebook is hosted
1111
https://github.com/neo4j/graph-data-science-client/blob/main/examples/fastrp-and-knn.ipynb[here]
1212
in the Neo4j Graph Data Science Client Github repository.
1313

14-
The notebook exemplifies how to use the `+graphdatascience+` Python
14+
The notebook exemplifies how to use the `graphdatascience` Python
1515
library to operate Neo4j GDS. It shows an adapted version of the FastRP
1616
and kNN end-to-end example from the GDS Manual, found
1717
https://neo4j.com/docs/graph-data-science/current/end-to-end-examples/fastrp-knn-example[here].
@@ -33,11 +33,11 @@ one of the customers will be recommended to the other.
3333
== Prerequisites
3434

3535
Running this notebook requires a Neo4j server with a recent version
36-
(2.0+) of GDS installed. We recommend using Neo4j Desktop with GDS, or
37-
AuraDS.
36+
(2.0{plus}) of GDS installed. We recommend using Neo4j Desktop with GDS,
37+
or AuraDS.
3838

39-
The `+graphdatascience+` Python library needs to be installed as well.
40-
See the examples in the Setup section below and in the
39+
The `graphdatascience` Python library needs to be installed as well. See
40+
the examples in the Setup section below and in the
4141
https://neo4j.com/docs/graph-data-science-client/current/installation/[client
4242
installation instructions].
4343

@@ -80,7 +80,7 @@ assert gds.server_version() >= ServerVersion(1, 8, 0)
8080
== Example graph creation
8181

8282
We now create a graph of products and customers in the database. The
83-
`+amount+` relationship property represents the average weekly amount of
83+
`amount` relationship property represents the average weekly amount of
8484
money spent by a customer on a given product.
8585

8686
[source, python, role=no-test]
@@ -165,10 +165,10 @@ print(f"Graph '{G.name()}' node labels: {G.node_labels()}")
165165
Next we use the
166166
https://neo4j.com/docs/graph-data-science/current/machine-learning/node-embeddings/fastrp/[FastRP
167167
algorithm] to generate node embeddings that capture topological
168-
information from the graph. We choose to work with
169-
`+embeddingDimension+` set to 4 which is sufficient since our example
170-
graph is very small. The `+iterationWeights+` are chosen empirically to
171-
yield sensible results. Please see
168+
information from the graph. We choose to work with `embeddingDimension`
169+
set to 4 which is sufficient since our example graph is very small. The
170+
`iterationWeights` are chosen empirically to yield sensible results.
171+
Please see
172172
https://neo4j.com/docs/graph-data-science/current/machine-learning/node-embeddings/fastrp/#algorithms-embeddings-fastrp-syntax[the
173173
syntax section of the FastRP documentation] for more information on
174174
these parameters.
@@ -212,11 +212,11 @@ print(f"Number of embedding vectors produced: {result['nodePropertiesWritten']}"
212212
Now we can run
213213
https://neo4j.com/docs/graph-data-science/current/algorithms/knn/[kNN]
214214
to identify similar nodes by using the node embeddings that we generated
215-
with FastRP as `+nodeProperties+`. Since we are working with a small
216-
graph, we can set `+sampleRate+` to 1 and `+deltaThreshold+` to 0
217-
without having to worry about long computation times. The
218-
`+concurrency+` parameter is set to 1 (along with the fixed
219-
`+randomSeed+`) in order to get a deterministic result. Please see
215+
with FastRP as `nodeProperties`. Since we are working with a small
216+
graph, we can set `sampleRate` to 1 and `deltaThreshold` to 0 without
217+
having to worry about long computation times. The `concurrency`
218+
parameter is set to 1 (along with the fixed `randomSeed`) in order to
219+
get a deterministic result. Please see
220220
https://neo4j.com/docs/graph-data-science/current/algorithms/knn/#algorithms-knn-syntax[the
221221
syntax section of the kNN documentation] for more information on these
222222
parameters.
@@ -252,10 +252,10 @@ paths between nodes leading to many similar FastRP node embeddings.
252252
== Exploring the results
253253

254254
Let us now inspect the results of our kNN call by using Cypher. We can
255-
use the `+SIMILARITY+` relationship type to filter out the relationships
255+
use the `SIMILARITY` relationship type to filter out the relationships
256256
we are interested in. And since we just care about similarities between
257257
people for our product recommendation engine, we make sure to only match
258-
nodes with the `+Person+` label.
258+
nodes with the `Person` label.
259259

260260
Please see https://neo4j.com/docs/cypher-manual/current/[the Cypher
261261
manual] for documentation on how to use Cypher.
@@ -271,23 +271,23 @@ gds.run_cypher(
271271
)
272272
----
273273

274-
Our kNN results indicate among other things that the `+Person+` nodes
275-
named "`Annie`" and "`Matt`" are very similar. Looking at the `+BUYS+`
274+
Our kNN results indicate among other things that the `Person` nodes
275+
named "`Annie`" and "`Matt`" are very similar. Looking at the `BUYS`
276276
relationships for these two nodes we can see that such a conclusion
277277
makes sense. They both buy three products, two of which are the same
278-
(`+Product+` nodes named "`Cucumber`" and "`Tomatoes`") for both people
278+
(`Product` nodes named "`Cucumber`" and "`Tomatoes`") for both people
279279
and with similar amounts. We can therefore have high confidence in our
280280
approach.
281281

282282
== Making recommendations
283283

284-
Using the information we derived that the `+Person+` nodes named
285-
"`Annie`" and "`Matt`" are similar, we can make product recommendations
286-
for each of them. Since they are similar, we can assume that products
287-
purchased by only one of the people may be of interest to buy also for
288-
the other person not already buying the product. By this principle we
289-
can derive product recommendations for the `+Person+` named "`Matt`"
290-
using a simple Cypher query.
284+
Using the information we derived that the `Person` nodes named "`Annie`"
285+
and "`Matt`" are similar, we can make product recommendations for each
286+
of them. Since they are similar, we can assume that products purchased
287+
by only one of the people may be of interest to buy also for the other
288+
person not already buying the product. By this principle we can derive
289+
product recommendations for the `Person` named "`Matt`" using a simple
290+
Cypher query.
291291

292292
[source, python, role=no-test]
293293
----
@@ -326,5 +326,5 @@ derive some sensible product recommendations for a customer in our small
326326
example.
327327

328328
To make sure to get similarities to other customers for every customer
329-
in our graph with kNN, we could play around with increasing the `+topK+`
329+
in our graph with kNN, we could play around with increasing the `topK`
330330
parameter.

doc/modules/ROOT/pages/tutorials/gds-sessions-self-managed.adoc

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This Jupyter notebook is hosted
1111
https://github.com/neo4j/graph-data-science-client/blob/main/examples/gds-sessions-self-managed.ipynb[here]
1212
in the Neo4j Graph Data Science Client Github repository.
1313

14-
The notebook shows how to use the `+graphdatascience+` Python library to
14+
The notebook shows how to use the `graphdatascience` Python library to
1515
create, manage, and use a GDS Session.
1616

1717
We consider a graph of people and fruits, which we’re using as a simple
@@ -28,13 +28,11 @@ This notebook requires having a Neo4j instance instance available and
2828
that the GDS sessions feature is enabled for your Neo4j Aura tenant.
2929
Contact your account manager to get the features enabled.
3030

31-
We also need to have the `+graphdatascience+` Python library installed,
32-
version `+1.12a1+` or later.
31+
We also need to have the `graphdatascience` Python library installed,
32+
version `1.12a1` or later.
3333

3434
[source, python, role=no-test]
3535
----
36-
from datetime import timedelta
37-
3836
%pip install "graphdatascience>=1.13"
3937
----
4038

@@ -45,7 +43,7 @@ we need to have
4543
https://neo4j.com/docs/aura/platform/api/authentication/#_creating_credentials[Aura
4644
API credentialsn].
4745

48-
Using these credentials, we can create our `+GdsSessions+` object, which
46+
Using these credentials, we can create our `GdsSessions` object, which
4947
is the main entry point for managing GDS Sessions.
5048

5149
[source, python, role=no-test]
@@ -65,16 +63,16 @@ sessions = GdsSessions(api_credentials=AuraAPICredentials(client_id, client_secr
6563

6664
== Creating a new session
6765

68-
A new session is created by calling `+sessions.get_or_create()+`. As the
69-
data source, we assume that a self-managed Neo4j DBMS instance has been
70-
set up and is accessible. We need to pass the database address, user
71-
name and password to the `+DbmsConnectionInfo+` class.
66+
A new session is created by calling `sessions.get++_++or++_++create()`.
67+
As the data source, we assume that a self-managed Neo4j DBMS instance
68+
has been set up and is accessible. We need to pass the database address,
69+
user name and password to the `DbmsConnectionInfo` class.
7270

7371
We also need to specify the session size. Please refer to the API
7472
reference documentation or the manual for a full list.
7573

7674
Finally, we need to give our session a name. We will call ours
77-
`+people-and-fruits-sm'. It is possible to reconnect to an existing session by calling+`get_or_create`
75+
`people-and-fruits-sm'. It is possible to reconnect to an existing session by calling`get++_++or++_++create++`++
7876
with the same session name and configuration.
7977

8078
We will also set a time-to-live (TTL) for the session. This ensures that
@@ -102,6 +100,7 @@ cloud_location = cloud_locations[0]
102100
[source, python, role=no-test]
103101
----
104102
import os
103+
from datetime import timedelta
105104
106105
from graphdatascience.session import DbmsConnectionInfo
107106
@@ -128,7 +127,12 @@ what that looks like
128127

129128
[source, python, role=no-test]
130129
----
130+
from pandas import DataFrame
131+
131132
gds_sessions = sessions.list()
133+
134+
# for better visualization
135+
DataFrame(gds_sessions)
132136
----
133137

134138
== Adding a dataset
@@ -188,14 +192,14 @@ gds.run_cypher("MATCH (n) RETURN count(n) AS nodeCount")
188192
== Projecting Graphs
189193

190194
Now that we have imported a graph to our database, we can project it
191-
into our GDS Session. We do that by using the `+gds.graph.project()+`
195+
into our GDS Session. We do that by using the `gds.graph.project()`
192196
endpoint.
193197

194-
The remote projection query that we are using selects all `+Person+`
195-
nodes and their `+LIKES+` relationships, and all `+Fruit+` nodes and
196-
their `+LIKES+` relationships. Additionally, we project node properties
197-
for illustrative purposes. We can use these node properties as input to
198-
algorithms, although we do not do that in this notebook.
198+
The remote projection query that we are using selects all `Person` nodes
199+
and their `LIKES` relationships, and all `Fruit` nodes and their `LIKES`
200+
relationships. Additionally, we project node properties for illustrative
201+
purposes. We can use these node properties as input to algorithms,
202+
although we do not do that in this notebook.
199203

200204
[source, python, role=no-test]
201205
----
@@ -275,16 +279,16 @@ the PageRank and FastRP algorithms to the Neo4j database.
275279
gds.graph.nodeProperties.write(G, ["pagerank", "fastRP"])
276280
----
277281

278-
Of course, we can just use `+.write+` modes as well. Let’s run Louvain
279-
in write mode to show:
282+
Of course, we can just use `.write` modes as well. Let’s run Louvain in
283+
write mode to show:
280284

281285
[source, python, role=no-test]
282286
----
283287
gds.louvain.write(G, writeProperty="louvain")
284288
----
285289

286-
We can now use the `+gds.run_cypher()+` method to query the updated
287-
graph. Note that the `+run_cypher()+` method will run the query on the
290+
We can now use the `gds.run++_++cypher()` method to query the updated
291+
graph. Note that the `run++_++cypher()` method will run the query on the
288292
Neo4j database.
289293

290294
[source, python, role=no-test]

0 commit comments

Comments
 (0)