You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-21Lines changed: 17 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,16 +6,12 @@ It enables users to write pure Python code to project graphs, run algorithms, as
6
6
The API is designed to mimic the GDS Cypher procedure API in Python code.
7
7
It abstracts the necessary operations of the [Neo4j Python driver](https://neo4j.com/docs/python-manual/current/) to offer a simpler surface.
8
8
9
+
`graphdatascience` is only guaranteed to work with GDS versions 2.0+.
10
+
9
11
Please leave any feedback as issues on [the source repository](https://github.com/neo4j/graph-data-science-client).
10
12
Happy coding!
11
13
12
14
13
-
## NOTE
14
-
15
-
This is a work in progress and some GDS features are known to be missing or not working properly (see [Known limitations](#known-limitations) below).
16
-
Further, this library targets GDS versions 2.0+ (not yet released) and as such may not work with older versions.
17
-
18
-
19
15
## Installation
20
16
21
17
To install the latest deployed version of `graphdatascience`, simply run:
@@ -28,7 +24,7 @@ pip install graphdatascience
28
24
## Usage
29
25
30
26
What follows is a high level description of some of the operations supported by `graphdatascience`.
31
-
For extensive documentation of all capabilities, please refer to the [Python client chapter of the GDS Manual](https://neo4j.com/docs/graph-data-science/2.0-preview/python-client/).
27
+
For extensive documentation of all capabilities, please refer to the [Python client chapter of the GDS Manual](https://neo4j.com/docs/graph-data-science/current/python-client/).
32
28
33
29
Extensive end-to-end examples in Jupyter ready-to-run notebooks can be found in the [`examples` source directory](https://github.com/neo4j/graph-data-science-client/tree/main/examples):
34
30
@@ -37,7 +33,7 @@ Extensive end-to-end examples in Jupyter ready-to-run notebooks can be found in
37
33
38
34
### Imports and setup
39
35
40
-
The library wraps the [Neo4j Python driver](https://neo4j.com/docs/python-manual/2.0-preview/) with a `GraphDataScience` object through which most calls to GDS will be made.
36
+
The library wraps the [Neo4j Python driver](https://neo4j.com/docs/python-manual/current/) with a `GraphDataScience` object through which most calls to GDS will be made.
Supposing that we have some graph data in our Neo4j database, we can [project the graph into memory](https://neo4j.com/docs/graph-data-science/2.0-preview/graph-project/).
69
+
Supposing that we have some graph data in our Neo4j database, we can [project the graph into memory](https://neo4j.com/docs/graph-data-science/current/graph-project/).
74
70
75
71
```python
76
72
# Optionally we can estimate memory of the operation first
The `G` that is returned here is a `Graph` which on the client side represents the projection on the server side.
85
81
86
-
The analogous calls `gds.graph.project.cypher{,.estimate}` for [Cypher based projection](https://neo4j.com/docs/graph-data-science/2.0-preview/graph-project-cypher/) are also supported.
82
+
The analogous calls `gds.graph.project.cypher{,.estimate}` for [Cypher based projection](https://neo4j.com/docs/graph-data-science/current/graph-project-cypher/) are also supported.
87
83
88
84
89
85
### Running algorithms
90
86
91
-
We can take a projected graph, represented to us by a `Graph` object named `G`, and run [algorithms](https://neo4j.com/docs/graph-data-science/2.0-preview/algorithms/) on it.
87
+
We can take a projected graph, represented to us by a `Graph` object named `G`, and run [algorithms](https://neo4j.com/docs/graph-data-science/current/algorithms/) on it.
92
88
93
89
```python
94
90
# Optionally we can estimate memory of the operation first (if the algo supports it)
These calls take one positional argument and a number of keyword arguments depending on the algorithm.
103
-
The first (positional) argument is a `Graph`, and the keyword arguments map directly to the algorithm's [configuration map](https://neo4j.com/docs/graph-data-science/2.0-preview/common-usage/running-algos/#algorithms-syntax-configuration-parameters).
99
+
The first (positional) argument is a `Graph`, and the keyword arguments map directly to the algorithm's [configuration map](https://neo4j.com/docs/graph-data-science/current/common-usage/running-algos/#algorithms-syntax-configuration-parameters).
104
100
105
-
The other [algorithm execution modes](https://neo4j.com/docs/graph-data-science/2.0-preview/common-usage/running-algos/) - stats, stream and write - are also supported via analogous calls.
101
+
The other [algorithm execution modes](https://neo4j.com/docs/graph-data-science/current/common-usage/running-algos/) - stats, stream and write - are also supported via analogous calls.
106
102
The stream mode call returns a pandas DataFrame (with contents depending on the algorithm of course).
107
103
The mutate, stats and write mode calls however return a pandas Series with metadata about the algorithm execution.
108
104
109
105
110
106
#### Topological link prediction
111
107
112
-
The methods for doing [topological link prediction](https://neo4j.com/docs/graph-data-science/2.0-preview/algorithms/linkprediction/) are a bit different.
108
+
The methods for doing [topological link prediction](https://neo4j.com/docs/graph-data-science/current/algorithms/linkprediction/) are a bit different.
113
109
Just like in the GDS procedure API they do not take a graph as an argument, but rather two node references as positional arguments.
114
110
And they simply return the similarity score of the prediction just made as a float - not any kind of pandas data structure.
115
111
@@ -144,7 +140,7 @@ This includes support for models trained using pipelines (for Link Prediction an
144
140
145
141
#### Pipelines
146
142
147
-
There's native support for [Link prediction pipelines](https://neo4j.com/docs/graph-data-science/2.0-preview/algorithms/ml-models/linkprediction-pipelines/) and [Node classification pipelines](https://neo4j.com/docs/graph-data-science/2.0-preview/algorithms/ml-models/nodeclassification-pipelines/).
143
+
There's native support for [Link prediction pipelines](https://neo4j.com/docs/graph-data-science/current/algorithms/ml-models/linkprediction-pipelines/) and [Node classification pipelines](https://neo4j.com/docs/graph-data-science/current/algorithms/ml-models/nodeclassification-pipelines/).
148
144
Apart from the call to create a pipeline, the GDS native pipelines calls are represented by methods on pipeline Python objects.
149
145
Additionally to the standard GDS calls, there are several methods to query the pipeline for information about it.
150
146
@@ -192,7 +188,7 @@ Note that with GraphSAGE we call the `train` method directly and supply all trai
192
188
193
189
### Graph catalog utils
194
190
195
-
All procedures from the [GDS Graph catalog](https://neo4j.com/docs/graph-data-science/2.0-preview/management-ops/graph-catalog-ops/) are supported with `graphdatascience`.
191
+
All procedures from the [GDS Graph catalog](https://neo4j.com/docs/graph-data-science/current/management-ops/graph-catalog-ops/) are supported with `graphdatascience`.
196
192
Some examples are (where `G` is a `Graph`):
197
193
198
194
```python
@@ -210,7 +206,7 @@ The idea is to have a way of creating `Graph`s for already projected graphs, wit
210
206
211
207
### Pipeline catalog utils
212
208
213
-
All procedures from the [GDS Pipeline catalog](https://neo4j.com/docs/graph-data-science/2.0-preview/pipeline-catalog/) are supported with `graphdatascience`.
209
+
All procedures from the [GDS Pipeline catalog](https://neo4j.com/docs/graph-data-science/current/pipeline-catalog/) are supported with `graphdatascience`.
214
210
Some examples are (where `pipe` is a machine learning training pipeline object):
215
211
216
212
```python
@@ -228,7 +224,7 @@ The idea is to have a way of creating pipeline objects for already existing pipe
228
224
229
225
### Model catalog utils
230
226
231
-
All procedures from the [GDS Model catalog](https://neo4j.com/docs/graph-data-science/2.0-preview/model-catalog/) are supported with `graphdatascience`.
227
+
All procedures from the [GDS Model catalog](https://neo4j.com/docs/graph-data-science/current/model-catalog/) are supported with `graphdatascience`.
232
228
Some examples are (where `model` is a machine learning model object):
233
229
234
230
```python
@@ -247,7 +243,7 @@ The idea is to have a way of creating model objects for already loaded models, w
247
243
### Node matching without Cypher
248
244
249
245
When calling path finding or topological link prediction algorithms one has to provide specific nodes as input arguments.
250
-
When using the GDS procedure API directly to call such algorithms, typically Cypher `MATCH` statements are used in order to find valid representations of input nodes of interest, see eg. [this example in the GDS docs](https://neo4j.com/docs/graph-data-science/2.0-preview/algorithms/dijkstra-source-target/#algorithms-dijkstra-source-target-examples-stream).
246
+
When using the GDS procedure API directly to call such algorithms, typically Cypher `MATCH` statements are used in order to find valid representations of input nodes of interest, see eg. [this example in the GDS docs](https://neo4j.com/docs/graph-data-science/current/algorithms/dijkstra-source-target/#algorithms-dijkstra-source-target-examples-stream).
251
247
To simplify this, `graphdatascience` provides a utility function, `gds.find_node_id`, for letting one find nodes without using Cypher.
252
248
253
249
Below is an example of how this can be done (supposing `G` is a projected `Graph` with `City` nodes having `name` properties):
@@ -272,8 +268,8 @@ For more advanced filtering we recommend users do matching via Cypher's `MATCH`.
272
268
273
269
Operations known to not yet work with `graphdatascience`:
274
270
275
-
*[Numeric utility functions](https://neo4j.com/docs/graph-data-science/2.0-preview/management-ops/utility-functions/#utility-functions-numeric) (will never be supported)
276
-
*[Cypher on GDS](https://neo4j.com/docs/graph-data-science/2.0-preview/management-ops/create-cypher-db/) (might be supported in the future)
271
+
*[Numeric utility functions](https://neo4j.com/docs/graph-data-science/current/management-ops/utility-functions/#utility-functions-numeric) (will never be supported)
272
+
*[Cypher on GDS](https://neo4j.com/docs/graph-data-science/current/management-ops/create-cypher-db/) (might be supported in the future)
0 commit comments