graphdatascience 2.0a3__py3-none-any.whl → 2.0a5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- graphdatascience/arrow_client/arrow_authentication.py +2 -0
- graphdatascience/arrow_client/arrow_endpoint_version.py +0 -1
- graphdatascience/arrow_client/authenticated_flight_client.py +5 -1
- graphdatascience/arrow_client/server_health_check.py +2 -0
- graphdatascience/arrow_client/v1/gds_arrow_client.py +47 -46
- graphdatascience/arrow_client/v2/api_types.py +2 -0
- graphdatascience/arrow_client/v2/gds_arrow_client.py +28 -28
- graphdatascience/error/standalone_session_error.py +1 -1
- graphdatascience/graph/graph_api.py +49 -17
- graphdatascience/graph_construction/arrow_v1_graph_constructor.py +1 -13
- graphdatascience/graph_construction/cypher_graph_constructor.py +1 -0
- graphdatascience/graph_data_science.py +28 -18
- graphdatascience/model/model.py +24 -8
- graphdatascience/procedure_surface/api/catalog/catalog_endpoints.py +22 -10
- graphdatascience/procedure_surface/api/catalog/dataset_endpoints.py +13 -5
- graphdatascience/procedure_surface/api/catalog/graph_sampling_endpoints.py +25 -17
- graphdatascience/procedure_surface/api/catalog/node_label_endpoints.py +4 -4
- graphdatascience/procedure_surface/api/catalog/node_properties_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/catalog/node_property_endpoints.py +6 -4
- graphdatascience/procedure_surface/api/catalog/relationship_properties_endpoints.py +5 -3
- graphdatascience/procedure_surface/api/catalog/relationship_property_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/catalog/relationships_endpoints.py +12 -11
- graphdatascience/procedure_surface/api/catalog/scale_properties_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/catalog/validation.py +17 -0
- graphdatascience/procedure_surface/api/centrality/articlerank_endpoints.py +13 -13
- graphdatascience/procedure_surface/api/centrality/articulationpoints_endpoints.py +4 -4
- graphdatascience/procedure_surface/api/centrality/betweenness_endpoints.py +11 -11
- graphdatascience/procedure_surface/api/centrality/bridges_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/centrality/celf_endpoints.py +16 -16
- graphdatascience/procedure_surface/api/centrality/closeness_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/centrality/closeness_harmonic_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/centrality/degree_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/centrality/hits_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py +14 -14
- graphdatascience/procedure_surface/api/collapse_path_endpoints.py +3 -3
- graphdatascience/procedure_surface/api/community/clique_counting_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/community/conductance_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/community/hdbscan_endpoints.py +21 -21
- graphdatascience/procedure_surface/api/community/k1coloring_endpoints.py +3 -3
- graphdatascience/procedure_surface/api/community/kcore_endpoints.py +2 -2
- graphdatascience/procedure_surface/api/community/kmeans_endpoints.py +21 -21
- graphdatascience/procedure_surface/api/community/labelpropagation_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/community/leiden_endpoints.py +21 -21
- graphdatascience/procedure_surface/api/community/local_clustering_coefficient_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/community/louvain_endpoints.py +12 -12
- graphdatascience/procedure_surface/api/community/maxkcut_endpoints.py +4 -4
- graphdatascience/procedure_surface/api/community/modularity_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/community/modularity_optimization_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/community/scc_endpoints.py +2 -2
- graphdatascience/procedure_surface/api/community/sllpa_endpoints.py +11 -11
- graphdatascience/procedure_surface/api/community/triangle_count_endpoints.py +11 -11
- graphdatascience/procedure_surface/api/community/triangles_endpoints.py +3 -3
- graphdatascience/procedure_surface/api/community/wcc_endpoints.py +9 -9
- graphdatascience/procedure_surface/api/config_endpoints.py +4 -4
- graphdatascience/procedure_surface/api/kge/kge_predict_endpoints.py +2 -2
- graphdatascience/procedure_surface/api/kge/simple_rel_embedding_model.py +1 -1
- graphdatascience/procedure_surface/api/list_progress_endpoint.py +1 -1
- graphdatascience/procedure_surface/api/model/model_catalog_endpoints.py +2 -2
- graphdatascience/procedure_surface/api/node_embedding/fastpath_endpoints.py +68 -68
- graphdatascience/procedure_surface/api/node_embedding/fastrp_endpoints.py +36 -36
- graphdatascience/procedure_surface/api/node_embedding/graphsage_endpoints.py +16 -16
- graphdatascience/procedure_surface/api/node_embedding/graphsage_model.py +17 -17
- graphdatascience/procedure_surface/api/node_embedding/graphsage_predict_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/node_embedding/graphsage_train_endpoints.py +15 -15
- graphdatascience/procedure_surface/api/node_embedding/hashgnn_endpoints.py +29 -29
- graphdatascience/procedure_surface/api/node_embedding/node2vec_endpoints.py +57 -57
- graphdatascience/procedure_surface/api/pathfinding/all_shortest_path_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/pathfinding/bfs_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/pathfinding/dfs_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/pathfinding/dijkstra_endpoints.py +8 -8
- graphdatascience/procedure_surface/api/pathfinding/k_spanning_tree_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/pathfinding/longest_path_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/pathfinding/max_flow_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/pathfinding/max_flow_min_cost_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/pathfinding/prize_steiner_tree_endpoints.py +7 -7
- graphdatascience/procedure_surface/api/pathfinding/random_walk_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/pathfinding/single_source_bellman_ford_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/pathfinding/single_source_delta_endpoints.py +9 -9
- graphdatascience/procedure_surface/api/pathfinding/single_source_dijkstra_endpoints.py +4 -4
- graphdatascience/procedure_surface/api/pathfinding/source_target_astar_endpoints.py +16 -16
- graphdatascience/procedure_surface/api/pathfinding/source_target_dijkstra_endpoints.py +8 -8
- graphdatascience/procedure_surface/api/pathfinding/source_target_yens_endpoints.py +8 -8
- graphdatascience/procedure_surface/api/pathfinding/spanning_tree_endpoints.py +7 -7
- graphdatascience/procedure_surface/api/pathfinding/steiner_tree_endpoints.py +17 -17
- graphdatascience/procedure_surface/api/pathfinding/topological_sort_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/pipeline/link_prediction_pipeline.py +1 -1
- graphdatascience/procedure_surface/api/pipeline/link_prediction_predict_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/pipeline/node_classification_model.py +1 -1
- graphdatascience/procedure_surface/api/pipeline/node_classification_pipeline.py +1 -1
- graphdatascience/procedure_surface/api/pipeline/node_classification_predict_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/pipeline/node_regression_model.py +1 -1
- graphdatascience/procedure_surface/api/pipeline/node_regression_predict_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/pipeline/pipeline_catalog_protocol.py +4 -0
- graphdatascience/procedure_surface/api/similarity/knn_endpoints.py +23 -23
- graphdatascience/procedure_surface/api/similarity/knn_filtered_endpoints.py +42 -42
- graphdatascience/procedure_surface/api/similarity/node_similarity_endpoints.py +37 -37
- graphdatascience/procedure_surface/api/similarity/node_similarity_filtered_endpoints.py +47 -47
- graphdatascience/procedure_surface/api/topological_link_prediction_endpoints.py +11 -11
- graphdatascience/procedure_surface/api/util_endpoints.py +5 -5
- graphdatascience/procedure_surface/arrow/catalog/__init__.py +8 -1
- graphdatascience/procedure_surface/arrow/catalog/catalog_arrow_endpoints.py +33 -7
- graphdatascience/procedure_surface/arrow/catalog/graph_sampling_arrow_endpoints.py +13 -0
- graphdatascience/procedure_surface/arrow/catalog/projection_arrow_endpoints.py +46 -22
- graphdatascience/procedure_surface/arrow/centrality/articulationpoints_arrow_endpoints.py +11 -4
- graphdatascience/procedure_surface/arrow/centrality/pagerank_arrow_endpoints.py +3 -3
- graphdatascience/procedure_surface/arrow/endpoints_helper_base.py +2 -2
- graphdatascience/procedure_surface/arrow/jobs_arrow_endpoints.py +1 -1
- graphdatascience/procedure_surface/arrow/node_embedding/fastpath_arrow_endpoints.py +89 -95
- graphdatascience/procedure_surface/arrow/pathfinding/single_source_bellman_ford_arrow_endpoints.py +2 -0
- graphdatascience/procedure_surface/arrow/similarity/node_similarity_arrow_endpoints.py +7 -7
- graphdatascience/procedure_surface/arrow/stream_result_mapper.py +18 -1
- graphdatascience/procedure_surface/cypher/catalog/catalog_cypher_endpoints.py +16 -0
- graphdatascience/procedure_surface/cypher/catalog/graph_backend_cypher.py +10 -36
- graphdatascience/procedure_surface/cypher/catalog/graph_ops_cypher.py +55 -0
- graphdatascience/procedure_surface/cypher/catalog/graph_sampling_cypher_endpoints.py +13 -0
- graphdatascience/procedure_surface/cypher/catalog/projection_cypher_endpoints.py +7 -4
- graphdatascience/procedure_surface/cypher/estimation_utils.py +5 -5
- graphdatascience/procedure_surface/cypher/topological_link_prediction_cypher_endpoints.py +1 -1
- graphdatascience/query_runner/neo4j_query_runner.py +22 -13
- graphdatascience/query_runner/query_runner.py +5 -3
- graphdatascience/query_runner/termination_flag.py +2 -0
- graphdatascience/retry_utils/retry_config.py +1 -1
- graphdatascience/session/aura_api.py +4 -1
- graphdatascience/session/aura_api_responses.py +5 -3
- graphdatascience/session/aura_graph_data_science.py +17 -10
- graphdatascience/session/dbms_connection_info.py +3 -1
- graphdatascience/session/gds_sessions.py +32 -9
- graphdatascience/session/remote_ops/project_protocols.py +11 -3
- graphdatascience/session/remote_ops/write_protocols.py +3 -2
- graphdatascience/session/session_info.py +7 -4
- graphdatascience/session/session_lifecycle_manager.py +2 -2
- graphdatascience/session/session_sizes.py +6 -2
- graphdatascience/version.py +1 -1
- {graphdatascience-2.0a3.dist-info → graphdatascience-2.0a5.dist-info}/METADATA +2 -2
- {graphdatascience-2.0a3.dist-info → graphdatascience-2.0a5.dist-info}/RECORD +139 -137
- {graphdatascience-2.0a3.dist-info → graphdatascience-2.0a5.dist-info}/WHEEL +1 -1
- {graphdatascience-2.0a3.dist-info → graphdatascience-2.0a5.dist-info}/licenses/LICENSE +0 -0
- {graphdatascience-2.0a3.dist-info → graphdatascience-2.0a5.dist-info}/top_level.txt +0 -0
|
@@ -30,6 +30,5 @@ class ArrowEndpointVersion(Enum):
|
|
|
30
30
|
class UnsupportedArrowEndpointVersion(Exception):
|
|
31
31
|
def __init__(self, compatible_versions: set[ArrowEndpointVersion], supported_server_versions: set[str]) -> None:
|
|
32
32
|
super().__init__(
|
|
33
|
-
self,
|
|
34
33
|
f"The GDS version is not supported by this client version, please update the `graphdatascience` package. Arrow versions supported by this client are: {compatible_versions}, but GDS supports: {supported_server_versions}",
|
|
35
34
|
)
|
|
@@ -34,6 +34,8 @@ T = TypeVar("T")
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
class AuthenticatedArrowClient:
|
|
37
|
+
"""Arrow Flight client used to communicate with the GDS Arrow server."""
|
|
38
|
+
|
|
37
39
|
def __init__(
|
|
38
40
|
self,
|
|
39
41
|
connection_info: str | tuple[str, int],
|
|
@@ -58,7 +60,7 @@ class AuthenticatedArrowClient:
|
|
|
58
60
|
arrow_client_options
|
|
59
61
|
Additional options to be passed to the Arrow Flight client.
|
|
60
62
|
user_agent
|
|
61
|
-
The user agent string to use for the connection. (default is `neo4j-graphdatascience-v[VERSION] pyarrow-v[PYARROW_VERSION])
|
|
63
|
+
The user agent string to use for the connection. (default is `neo4j-graphdatascience-v[VERSION] pyarrow-v[PYARROW_VERSION]`)
|
|
62
64
|
retry_config
|
|
63
65
|
The retry configuration to use for the Arrow requests send by the client.
|
|
64
66
|
advertised_listen_address
|
|
@@ -264,6 +266,8 @@ class AuthenticatedArrowClient:
|
|
|
264
266
|
|
|
265
267
|
@dataclass
|
|
266
268
|
class ConnectionInfo:
|
|
269
|
+
"""Host, port and encryption details for an Arrow server connection."""
|
|
270
|
+
|
|
267
271
|
host: str
|
|
268
272
|
port: int
|
|
269
273
|
encrypted: bool
|
|
@@ -29,7 +29,7 @@ class GdsArrowClient:
|
|
|
29
29
|
|
|
30
30
|
Parameters
|
|
31
31
|
----------
|
|
32
|
-
flight_client
|
|
32
|
+
flight_client
|
|
33
33
|
The authenticated flight client to use for communication with the GDS server. Ownership of the client is transferred to this GdsArrowClient.
|
|
34
34
|
"""
|
|
35
35
|
self._flight_client = flight_client
|
|
@@ -50,21 +50,21 @@ class GdsArrowClient:
|
|
|
50
50
|
Parameters
|
|
51
51
|
----------
|
|
52
52
|
graph_name
|
|
53
|
-
|
|
53
|
+
Name of the graph to be created
|
|
54
54
|
database
|
|
55
|
-
|
|
55
|
+
Name of the database to which the graph belongs
|
|
56
56
|
node_properties
|
|
57
|
-
|
|
57
|
+
Name of the node properties to retrieve
|
|
58
58
|
node_labels
|
|
59
59
|
A list of node labels to filter the nodes
|
|
60
60
|
list_node_labels
|
|
61
61
|
A flag that indicates whether the node labels should be included in the result
|
|
62
62
|
concurrency
|
|
63
|
-
|
|
63
|
+
Number of threads used on the server side when serving the data
|
|
64
64
|
|
|
65
65
|
Returns
|
|
66
66
|
-------
|
|
67
|
-
DataFrame
|
|
67
|
+
pandas.DataFrame
|
|
68
68
|
The requested node property as a DataFrame
|
|
69
69
|
"""
|
|
70
70
|
config: dict[str, Any] = {
|
|
@@ -94,15 +94,15 @@ class GdsArrowClient:
|
|
|
94
94
|
Parameters
|
|
95
95
|
----------
|
|
96
96
|
graph_name
|
|
97
|
-
|
|
97
|
+
Name of the graph to be created
|
|
98
98
|
database
|
|
99
|
-
|
|
99
|
+
Name of the database to which the graph belongs
|
|
100
100
|
concurrency
|
|
101
|
-
|
|
101
|
+
Number of threads used on the server side when serving the data
|
|
102
102
|
|
|
103
103
|
Returns
|
|
104
104
|
-------
|
|
105
|
-
DataFrame
|
|
105
|
+
pandas.DataFrame
|
|
106
106
|
The requested nodes as a DataFrame
|
|
107
107
|
"""
|
|
108
108
|
return self._get_data(graph_name, database, "gds.graph.nodeLabels.stream", concurrency, {})
|
|
@@ -119,18 +119,18 @@ class GdsArrowClient:
|
|
|
119
119
|
|
|
120
120
|
Parameters
|
|
121
121
|
----------
|
|
122
|
-
graph_name
|
|
123
|
-
|
|
124
|
-
database
|
|
125
|
-
|
|
126
|
-
relationship_types
|
|
127
|
-
|
|
128
|
-
concurrency
|
|
129
|
-
|
|
122
|
+
graph_name
|
|
123
|
+
Name of the graph to be created
|
|
124
|
+
database
|
|
125
|
+
Name of the database to which the graph belongs
|
|
126
|
+
relationship_types
|
|
127
|
+
Name of the relationship types to retrieve
|
|
128
|
+
concurrency
|
|
129
|
+
Number of threads used on the server side when serving the data
|
|
130
130
|
|
|
131
131
|
Returns
|
|
132
132
|
-------
|
|
133
|
-
DataFrame
|
|
133
|
+
pandas.DataFrame
|
|
134
134
|
The requested relationships as a DataFrame
|
|
135
135
|
"""
|
|
136
136
|
return self._get_data(
|
|
@@ -155,19 +155,19 @@ class GdsArrowClient:
|
|
|
155
155
|
Parameters
|
|
156
156
|
----------
|
|
157
157
|
graph_name
|
|
158
|
-
|
|
158
|
+
Name of the graph
|
|
159
159
|
database
|
|
160
|
-
|
|
160
|
+
Name of the database to which the graph belongs
|
|
161
161
|
relationship_properties
|
|
162
|
-
|
|
162
|
+
Name of the relationship properties to retrieve
|
|
163
163
|
relationship_types
|
|
164
|
-
|
|
164
|
+
Name of the relationship types to retrieve
|
|
165
165
|
concurrency
|
|
166
|
-
|
|
166
|
+
Number of threads used on the server side when serving the data
|
|
167
167
|
|
|
168
168
|
Returns
|
|
169
169
|
-------
|
|
170
|
-
DataFrame
|
|
170
|
+
pandas.DataFrame
|
|
171
171
|
The requested relationships as a DataFrame
|
|
172
172
|
"""
|
|
173
173
|
config: dict[str, Any] = {}
|
|
@@ -198,15 +198,15 @@ class GdsArrowClient:
|
|
|
198
198
|
|
|
199
199
|
Parameters
|
|
200
200
|
----------
|
|
201
|
-
graph_name
|
|
201
|
+
graph_name
|
|
202
202
|
The name used to identify the graph in the catalog and the import process
|
|
203
203
|
database: str
|
|
204
204
|
The name of the database from which the graph will be accessible
|
|
205
|
-
undirected_relationship_types
|
|
205
|
+
undirected_relationship_types
|
|
206
206
|
A list of relationship types that should be treated as undirected
|
|
207
|
-
inverse_indexed_relationship_types
|
|
207
|
+
inverse_indexed_relationship_types
|
|
208
208
|
A list of relationship types that should be indexed in reverse direction as well
|
|
209
|
-
concurrency
|
|
209
|
+
concurrency
|
|
210
210
|
The number of threads used on the server side when importing the graph
|
|
211
211
|
"""
|
|
212
212
|
|
|
@@ -239,15 +239,15 @@ class GdsArrowClient:
|
|
|
239
239
|
|
|
240
240
|
Parameters
|
|
241
241
|
----------
|
|
242
|
-
graph_name
|
|
242
|
+
graph_name
|
|
243
243
|
The name used to identify the graph in the catalog and the import process
|
|
244
244
|
database: str
|
|
245
245
|
The name of the database from which the graph will be accessible
|
|
246
|
-
undirected_relationship_types
|
|
246
|
+
undirected_relationship_types
|
|
247
247
|
A list of relationship types that should be treated as undirected
|
|
248
|
-
inverse_indexed_relationship_types
|
|
248
|
+
inverse_indexed_relationship_types
|
|
249
249
|
A list of relationship types that should be indexed in reverse direction as well
|
|
250
|
-
concurrency
|
|
250
|
+
concurrency
|
|
251
251
|
The number of threads used on the server side when importing the graph
|
|
252
252
|
"""
|
|
253
253
|
|
|
@@ -285,13 +285,13 @@ class GdsArrowClient:
|
|
|
285
285
|
----------
|
|
286
286
|
database: str
|
|
287
287
|
The name used to identify the database and the import process
|
|
288
|
-
id_type
|
|
288
|
+
id_type
|
|
289
289
|
Sets the node id type used in the input data. Can be either `INTEGER` or `STRING` (default is `INTEGER`)
|
|
290
|
-
id_property
|
|
290
|
+
id_property
|
|
291
291
|
The node property key which stores the node id of the input data (default is `originalId`)
|
|
292
292
|
db_format
|
|
293
293
|
Database format. Valid values standard, aligned, high_limit or block (default is controlled by the db setting `db.db_format`)
|
|
294
|
-
concurrency
|
|
294
|
+
concurrency
|
|
295
295
|
The number of threads used on the server side when importing the graph
|
|
296
296
|
force: bool
|
|
297
297
|
Force deletes any existing database files prior to the import (default is False)
|
|
@@ -325,7 +325,7 @@ class GdsArrowClient:
|
|
|
325
325
|
|
|
326
326
|
Parameters
|
|
327
327
|
----------
|
|
328
|
-
graph_name
|
|
328
|
+
graph_name
|
|
329
329
|
The name of the import process
|
|
330
330
|
|
|
331
331
|
Returns
|
|
@@ -343,11 +343,12 @@ class GdsArrowClient:
|
|
|
343
343
|
|
|
344
344
|
Parameters
|
|
345
345
|
----------
|
|
346
|
-
graph_name
|
|
346
|
+
graph_name
|
|
347
347
|
The name of the import process
|
|
348
348
|
|
|
349
349
|
Returns
|
|
350
|
-
|
|
350
|
+
-------
|
|
351
|
+
RelationshipLoadDoneResult
|
|
351
352
|
RelationshipLoadDoneResult
|
|
352
353
|
A result object containing the name of the import process and the number of relationships loaded
|
|
353
354
|
"""
|
|
@@ -361,7 +362,7 @@ class GdsArrowClient:
|
|
|
361
362
|
|
|
362
363
|
Parameters
|
|
363
364
|
----------
|
|
364
|
-
graph_name
|
|
365
|
+
graph_name
|
|
365
366
|
The name of the import process
|
|
366
367
|
|
|
367
368
|
Returns
|
|
@@ -377,7 +378,7 @@ class GdsArrowClient:
|
|
|
377
378
|
|
|
378
379
|
Parameters
|
|
379
380
|
----------
|
|
380
|
-
graph_name
|
|
381
|
+
graph_name
|
|
381
382
|
The name of the import process
|
|
382
383
|
"""
|
|
383
384
|
self._send_action("ABORT", {"name": graph_name})
|
|
@@ -394,13 +395,13 @@ class GdsArrowClient:
|
|
|
394
395
|
|
|
395
396
|
Parameters
|
|
396
397
|
----------
|
|
397
|
-
graph_name
|
|
398
|
+
graph_name
|
|
398
399
|
The name of the import process
|
|
399
|
-
node_data
|
|
400
|
+
node_data
|
|
400
401
|
The node data to upload
|
|
401
|
-
batch_size
|
|
402
|
+
batch_size
|
|
402
403
|
The number of rows per batch
|
|
403
|
-
progress_callback
|
|
404
|
+
progress_callback
|
|
404
405
|
A callback function that is called with the number of rows uploaded after each batch
|
|
405
406
|
"""
|
|
406
407
|
self._upload_data(graph_name, "node", node_data, batch_size, progress_callback)
|
|
@@ -442,7 +443,7 @@ class GdsArrowClient:
|
|
|
442
443
|
----------
|
|
443
444
|
graph_name
|
|
444
445
|
The name of the import process
|
|
445
|
-
triplet_data
|
|
446
|
+
triplet_data
|
|
446
447
|
The triplet data to upload
|
|
447
448
|
batch_size
|
|
448
449
|
The number of rows per batch
|
|
@@ -30,7 +30,7 @@ class GdsArrowClient:
|
|
|
30
30
|
|
|
31
31
|
Parameters
|
|
32
32
|
----------
|
|
33
|
-
flight_client
|
|
33
|
+
flight_client
|
|
34
34
|
The authenticated flight client to use for communication with the GDS server. Ownership of the client is transferred to this GdsArrowClient.
|
|
35
35
|
"""
|
|
36
36
|
self._flight_client = flight_client
|
|
@@ -52,15 +52,15 @@ class GdsArrowClient:
|
|
|
52
52
|
Parameters
|
|
53
53
|
----------
|
|
54
54
|
graph_name
|
|
55
|
-
|
|
55
|
+
Name of the graph to be created
|
|
56
56
|
node_properties
|
|
57
|
-
|
|
57
|
+
Names of the node properties to retrieve
|
|
58
58
|
node_labels
|
|
59
59
|
A list of node labels to filter the nodes
|
|
60
60
|
list_node_labels
|
|
61
61
|
A flag that indicates whether the node labels should be included in the result
|
|
62
62
|
concurrency
|
|
63
|
-
|
|
63
|
+
Number of threads used on the server side when serving the data
|
|
64
64
|
log_progress
|
|
65
65
|
Display progress logging.
|
|
66
66
|
job_id
|
|
@@ -100,7 +100,7 @@ class GdsArrowClient:
|
|
|
100
100
|
Parameters
|
|
101
101
|
----------
|
|
102
102
|
graph_name
|
|
103
|
-
|
|
103
|
+
Name of the graph to be created
|
|
104
104
|
node_filter
|
|
105
105
|
A Cypher predicate for filtering nodes in the input graph.
|
|
106
106
|
log_progress
|
|
@@ -188,7 +188,7 @@ class GdsArrowClient:
|
|
|
188
188
|
|
|
189
189
|
Returns
|
|
190
190
|
-------
|
|
191
|
-
DataFrame
|
|
191
|
+
pandas.DataFrame
|
|
192
192
|
A pandas DataFrame containing the results of the job.
|
|
193
193
|
"""
|
|
194
194
|
return JobClient().get_stream(self._flight_client, job_id)
|
|
@@ -251,29 +251,29 @@ class GdsArrowClient:
|
|
|
251
251
|
job_id: str | None = None,
|
|
252
252
|
) -> str:
|
|
253
253
|
"""
|
|
254
|
-
|
|
254
|
+
Starts a new graph import process on the GDS server.
|
|
255
255
|
|
|
256
|
-
|
|
256
|
+
The import process accepts triplets as input data.
|
|
257
257
|
|
|
258
258
|
Parameters
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
259
|
+
----------
|
|
260
|
+
graph_name
|
|
261
|
+
The name used to identify the graph in the catalog
|
|
262
|
+
undirected_relationship_types
|
|
263
|
+
A list of relationship types that should be treated as undirected
|
|
264
|
+
inverse_indexed_relationship_types
|
|
265
|
+
A list of relationship types that should be indexed in reverse direction as well
|
|
266
|
+
concurrency
|
|
267
|
+
Number of concurrent threads to use.
|
|
268
|
+
log_progress
|
|
269
|
+
Display progress logging.
|
|
270
|
+
job_id
|
|
271
|
+
Identifier for the computation.
|
|
272
|
+
|
|
273
|
+
Returns
|
|
274
|
+
-------
|
|
275
|
+
str
|
|
276
|
+
The JobId identifying the import process
|
|
277
277
|
"""
|
|
278
278
|
|
|
279
279
|
config = ConfigConverter.convert_to_gds_config(
|
|
@@ -412,7 +412,7 @@ class GdsArrowClient:
|
|
|
412
412
|
|
|
413
413
|
Parameters
|
|
414
414
|
----------
|
|
415
|
-
job_id
|
|
415
|
+
job_id
|
|
416
416
|
The job id of the process
|
|
417
417
|
"""
|
|
418
418
|
JobClient.cancel_job(self._flight_client, job_id)
|
|
@@ -428,7 +428,7 @@ class GdsArrowClient:
|
|
|
428
428
|
|
|
429
429
|
Returns
|
|
430
430
|
-------
|
|
431
|
-
JobStatus
|
|
431
|
+
~graphdatascience.arrow_client.v2.api_types.JobStatus
|
|
432
432
|
The status of the job
|
|
433
433
|
"""
|
|
434
434
|
return JobClient.get_job_status(self._flight_client, job_id)
|
|
@@ -32,21 +32,27 @@ class Graph:
|
|
|
32
32
|
|
|
33
33
|
def name(self) -> str:
|
|
34
34
|
"""
|
|
35
|
-
Returns
|
|
36
|
-
|
|
35
|
+
Returns
|
|
36
|
+
-------
|
|
37
|
+
str
|
|
38
|
+
name of the graph
|
|
37
39
|
"""
|
|
38
40
|
return self._name
|
|
39
41
|
|
|
40
42
|
def configuration(self) -> dict[str, Any]:
|
|
41
43
|
"""
|
|
42
|
-
Returns
|
|
44
|
+
Returns
|
|
45
|
+
-------
|
|
46
|
+
dict[str, Any]
|
|
43
47
|
the configuration of the graph
|
|
44
48
|
"""
|
|
45
49
|
return self._backend.graph_info().configuration
|
|
46
50
|
|
|
47
51
|
def node_count(self) -> int:
|
|
48
52
|
"""
|
|
49
|
-
Returns
|
|
53
|
+
Returns
|
|
54
|
+
-------
|
|
55
|
+
int
|
|
50
56
|
the number of nodes in the graph
|
|
51
57
|
|
|
52
58
|
"""
|
|
@@ -54,28 +60,36 @@ class Graph:
|
|
|
54
60
|
|
|
55
61
|
def relationship_count(self) -> int:
|
|
56
62
|
"""
|
|
57
|
-
Returns
|
|
63
|
+
Returns
|
|
64
|
+
-------
|
|
65
|
+
int
|
|
58
66
|
the number of relationships in the graph
|
|
59
67
|
"""
|
|
60
68
|
return self._backend.graph_info().relationship_count
|
|
61
69
|
|
|
62
70
|
def node_labels(self) -> list[str]:
|
|
63
71
|
"""
|
|
64
|
-
Returns
|
|
72
|
+
Returns
|
|
73
|
+
-------
|
|
74
|
+
list[str]
|
|
65
75
|
the node labels in the graph
|
|
66
76
|
"""
|
|
67
77
|
return list(self._backend.graph_info().graph_schema["nodes"].keys())
|
|
68
78
|
|
|
69
79
|
def relationship_types(self) -> list[str]:
|
|
70
80
|
"""
|
|
71
|
-
Returns
|
|
81
|
+
Returns
|
|
82
|
+
-------
|
|
83
|
+
list[str]
|
|
72
84
|
the relationship types in the graph
|
|
73
85
|
"""
|
|
74
86
|
return list(self._backend.graph_info().graph_schema["relationships"].keys())
|
|
75
87
|
|
|
76
88
|
def node_properties(self) -> dict[str, list[str]]:
|
|
77
89
|
"""
|
|
78
|
-
Returns
|
|
90
|
+
Returns
|
|
91
|
+
-------
|
|
92
|
+
dict[str, list[str]]
|
|
79
93
|
the node properties per node label
|
|
80
94
|
|
|
81
95
|
"""
|
|
@@ -85,7 +99,9 @@ class Graph:
|
|
|
85
99
|
|
|
86
100
|
def relationship_properties(self) -> dict[str, list[str]]:
|
|
87
101
|
"""
|
|
88
|
-
Returns
|
|
102
|
+
Returns
|
|
103
|
+
-------
|
|
104
|
+
dict[str, list[str]]
|
|
89
105
|
the relationship properties per relationship type
|
|
90
106
|
"""
|
|
91
107
|
rel_schema = self._backend.graph_info().graph_schema["relationships"]
|
|
@@ -94,35 +110,45 @@ class Graph:
|
|
|
94
110
|
|
|
95
111
|
def degree_distribution(self) -> dict[str, float | int]:
|
|
96
112
|
"""
|
|
97
|
-
Returns
|
|
113
|
+
Returns
|
|
114
|
+
-------
|
|
115
|
+
dict[str, float | int]
|
|
98
116
|
the degree distribution of the graph
|
|
99
117
|
"""
|
|
100
118
|
return self._backend.graph_info().degree_distribution
|
|
101
119
|
|
|
102
120
|
def density(self) -> float:
|
|
103
121
|
"""
|
|
104
|
-
Returns
|
|
122
|
+
Returns
|
|
123
|
+
-------
|
|
124
|
+
float
|
|
105
125
|
the density of the graph
|
|
106
126
|
"""
|
|
107
127
|
return self._backend.graph_info().density
|
|
108
128
|
|
|
109
129
|
def memory_usage(self) -> str | None:
|
|
110
130
|
"""
|
|
111
|
-
Returns
|
|
131
|
+
Returns
|
|
132
|
+
-------
|
|
133
|
+
str | None
|
|
112
134
|
the memory usage of the graph
|
|
113
135
|
"""
|
|
114
136
|
return self._backend.graph_info().memory_usage
|
|
115
137
|
|
|
116
138
|
def size_in_bytes(self) -> int:
|
|
117
139
|
"""
|
|
118
|
-
Returns
|
|
140
|
+
Returns
|
|
141
|
+
-------
|
|
142
|
+
int
|
|
119
143
|
the size of the graph in bytes
|
|
120
144
|
"""
|
|
121
145
|
return self._backend.graph_info().size_in_bytes
|
|
122
146
|
|
|
123
147
|
def exists(self) -> bool:
|
|
124
148
|
"""
|
|
125
|
-
Returns
|
|
149
|
+
Returns
|
|
150
|
+
-------
|
|
151
|
+
bool
|
|
126
152
|
whether the graph exists
|
|
127
153
|
"""
|
|
128
154
|
return self._backend.exists()
|
|
@@ -132,7 +158,9 @@ class Graph:
|
|
|
132
158
|
Args:
|
|
133
159
|
fail_if_missing: whether to fail if the graph does not exist
|
|
134
160
|
|
|
135
|
-
Returns
|
|
161
|
+
Returns
|
|
162
|
+
-------
|
|
163
|
+
GraphInfo | None
|
|
136
164
|
the result of the drop operation
|
|
137
165
|
|
|
138
166
|
"""
|
|
@@ -140,7 +168,9 @@ class Graph:
|
|
|
140
168
|
|
|
141
169
|
def creation_time(self) -> datetime:
|
|
142
170
|
"""
|
|
143
|
-
Returns
|
|
171
|
+
Returns
|
|
172
|
+
-------
|
|
173
|
+
datetime
|
|
144
174
|
the creation time of the graph
|
|
145
175
|
|
|
146
176
|
"""
|
|
@@ -148,7 +178,9 @@ class Graph:
|
|
|
148
178
|
|
|
149
179
|
def modification_time(self) -> datetime:
|
|
150
180
|
"""
|
|
151
|
-
Returns
|
|
181
|
+
Returns
|
|
182
|
+
-------
|
|
183
|
+
datetime
|
|
152
184
|
the modification time of the graph
|
|
153
185
|
"""
|
|
154
186
|
return self._backend.graph_info().modification_time
|
|
@@ -3,7 +3,6 @@ from __future__ import annotations
|
|
|
3
3
|
import concurrent
|
|
4
4
|
import logging
|
|
5
5
|
from concurrent.futures import ThreadPoolExecutor
|
|
6
|
-
from typing import Any
|
|
7
6
|
|
|
8
7
|
from pandas import DataFrame
|
|
9
8
|
from tqdm.auto import tqdm
|
|
@@ -36,22 +35,11 @@ class ArrowV1GraphConstructor(GraphConstructor):
|
|
|
36
35
|
|
|
37
36
|
def run(self, node_dfs: list[DataFrame], relationship_dfs: list[DataFrame]) -> None:
|
|
38
37
|
try:
|
|
39
|
-
config: dict[str, Any] = {
|
|
40
|
-
"name": self._graph_name,
|
|
41
|
-
"database_name": self._database,
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if self._undirected_relationship_types:
|
|
45
|
-
config["undirected_relationship_types"] = self._undirected_relationship_types
|
|
46
|
-
|
|
47
|
-
if self._inverse_indexed_relationship_types:
|
|
48
|
-
config["inverse_indexed_relationship_types"] = self._inverse_indexed_relationship_types
|
|
49
|
-
|
|
50
38
|
self._client.create_graph(
|
|
51
39
|
graph_name=self._graph_name,
|
|
52
40
|
database=self._database,
|
|
53
41
|
undirected_relationship_types=self._undirected_relationship_types,
|
|
54
|
-
inverse_indexed_relationship_types=
|
|
42
|
+
inverse_indexed_relationship_types=self._inverse_indexed_relationship_types,
|
|
55
43
|
concurrency=self._concurrency,
|
|
56
44
|
)
|
|
57
45
|
|
|
@@ -83,6 +83,7 @@ class CypherGraphConstructor(GraphConstructor):
|
|
|
83
83
|
self._server_version,
|
|
84
84
|
self._concurrency,
|
|
85
85
|
self._undirected_relationship_types,
|
|
86
|
+
self._inverse_indexed_relationship_types,
|
|
86
87
|
).run(node_dfs, relationship_dfs)
|
|
87
88
|
|
|
88
89
|
def _should_warn_about_arrow_missing(self) -> bool:
|