graphdatascience 1.10a1__tar.gz → 1.11__tar.gz
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-1.10a1/graphdatascience.egg-info → graphdatascience-1.11}/PKG-INFO +4 -5
- {graphdatascience-1.10a1 → graphdatascience-1.11}/README.md +0 -2
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/call_builder.py +1 -1
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/endpoints.py +17 -2
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/base_graph_proc_runner.py +7 -7
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/graph_cypher_runner.py +10 -3
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/graph_entity_ops_runner.py +51 -9
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/graph_remote_proc_runner.py +0 -1
- graphdatascience-1.11/graphdatascience/graph/graph_remote_project_runner.py +47 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph_data_science.py +19 -11
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/model/link_prediction_model.py +1 -1
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/model/model.py +62 -60
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/model/model_proc_runner.py +23 -15
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/model/node_classification_model.py +2 -2
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/model/node_regression_model.py +1 -1
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/model/pipeline_model.py +3 -3
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/query_runner/arrow_graph_constructor.py +13 -40
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/query_runner/arrow_query_runner.py +31 -166
- graphdatascience-1.11/graphdatascience/query_runner/aura_db_query_runner.py +173 -0
- graphdatascience-1.11/graphdatascience/query_runner/gds_arrow_client.py +254 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/query_runner/neo4j_query_runner.py +64 -18
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/query_runner/query_runner.py +4 -0
- graphdatascience-1.11/graphdatascience/session/__init__.py +15 -0
- graphdatascience-1.11/graphdatascience/session/algorithm_category.py +14 -0
- graphdatascience-1.11/graphdatascience/session/aura_api.py +321 -0
- graphdatascience-1.11/graphdatascience/session/aura_api_responses.py +180 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/session/aura_graph_data_science.py +24 -9
- graphdatascience-1.11/graphdatascience/session/aurads_sessions.py +212 -0
- graphdatascience-1.11/graphdatascience/session/dedicated_sessions.py +174 -0
- graphdatascience-1.11/graphdatascience/session/gds_sessions.py +107 -0
- graphdatascience-1.11/graphdatascience/session/session_info.py +43 -0
- graphdatascience-1.11/graphdatascience/session/session_sizes.py +70 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/system/system_endpoints.py +2 -2
- graphdatascience-1.10a1/graphdatascience/utils/util_endpoints.py → graphdatascience-1.11/graphdatascience/utils/direct_util_endpoints.py +0 -5
- graphdatascience-1.11/graphdatascience/utils/util_node_property_func_runner.py +31 -0
- graphdatascience-1.11/graphdatascience/utils/util_proc_runner.py +43 -0
- graphdatascience-1.11/graphdatascience/utils/util_remote_proc_runner.py +48 -0
- graphdatascience-1.11/graphdatascience/version.py +1 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11/graphdatascience.egg-info}/PKG-INFO +4 -5
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience.egg-info/SOURCES.txt +10 -3
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience.egg-info/requires.txt +3 -2
- {graphdatascience-1.10a1 → graphdatascience-1.11}/requirements/base/base.txt +3 -2
- graphdatascience-1.10a1/graphdatascience/graph/graph_remote_project_runner.py +0 -40
- graphdatascience-1.10a1/graphdatascience/query_runner/aura_db_arrow_query_runner.py +0 -184
- graphdatascience-1.10a1/graphdatascience/session/__init__.py +0 -13
- graphdatascience-1.10a1/graphdatascience/session/aura_api.py +0 -300
- graphdatascience-1.10a1/graphdatascience/session/gds_sessions.py +0 -240
- graphdatascience-1.10a1/graphdatascience/session/schema.py +0 -16
- graphdatascience-1.10a1/graphdatascience/session/session_sizes.py +0 -33
- graphdatascience-1.10a1/graphdatascience/utils/util_proc_runner.py +0 -68
- graphdatascience-1.10a1/graphdatascience/version.py +0 -1
- {graphdatascience-1.10a1 → graphdatascience-1.11}/LICENSE +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/MANIFEST.in +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/__init__.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/algo/__init__.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/algo/algo_endpoints.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/algo/algo_proc_runner.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/algo/single_mode_algo_endpoints.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/call_parameters.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/caller_base.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/error/__init__.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/error/client_only_endpoint.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/error/cypher_warning_handler.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/error/endpoint_suggester.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/error/gds_not_installed.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/error/illegal_attr_checker.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/error/unable_to_connect.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/error/uncallable_namespace.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/__init__.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/graph_alpha_proc_runner.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/graph_beta_proc_runner.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/graph_create_result.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/graph_endpoints.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/graph_export_runner.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/graph_object.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/graph_proc_runner.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/graph_project_runner.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/graph_sample_runner.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/graph_type_check.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/nx_loader.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/ogb_loader.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/ignored_server_endpoints.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/model/__init__.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/model/graphsage_model.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/model/model_alpha_proc_runner.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/model/model_beta_proc_runner.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/model/model_endpoints.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/model/model_resolver.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/model/simple_rel_embedding_model.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/pipeline/__init__.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/pipeline/classification_training_pipeline.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/pipeline/lp_pipeline_create_runner.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/pipeline/lp_training_pipeline.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/pipeline/nc_pipeline_create_runner.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/pipeline/nc_training_pipeline.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/pipeline/nr_pipeline_create_runner.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/pipeline/nr_training_pipeline.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/pipeline/pipeline_alpha_proc_runner.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/pipeline/pipeline_beta_proc_runner.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/pipeline/pipeline_endpoints.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/pipeline/pipeline_proc_runner.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/pipeline/training_pipeline.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/py.typed +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/query_runner/__init__.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/query_runner/arrow_endpoint_version.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/query_runner/cypher_graph_constructor.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/query_runner/graph_constructor.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/__init__.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/cora/__init__.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/cora/cora_nodes.parquet.gzip +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/cora/cora_rels.parquet.gzip +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/cora/serialize_cora.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/imdb/__init__.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/imdb/imdb_acted_in.parquet.gzip +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/imdb/imdb_actors.parquet.gzip +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/imdb/imdb_directed_in.parquet.gzip +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/imdb/imdb_directors.parquet.gzip +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/imdb/imdb_movies_with_genre.parquet.gzip +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/imdb/imdb_movies_without_genre.parquet.gzip +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/imdb/serialize_imdb.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/karate/__init__.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/karate/karate_club.parquet.gzip +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/lastfm/__init__.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/lastfm/artist_nodes.parquet.gzip +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/lastfm/serialize_lastfm.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/lastfm/user_friend_df_directed.parquet.gzip +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/lastfm/user_listen_artist_rels.parquet.gzip +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/lastfm/user_nodes.parquet.gzip +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/resources/lastfm/user_tag_artist_rels.parquet.gzip +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/server_version/__init__.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/server_version/compatible_with.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/server_version/server_version.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/session/dbms_connection_info.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/session/region_suggester.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/system/__init__.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/system/config_endpoints.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/topological_lp/__init__.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/topological_lp/topological_lp_alpha_runner.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/topological_lp/topological_lp_endpoints.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/utils/__init__.py +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience.egg-info/dependency_links.txt +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience.egg-info/not-zip-safe +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience.egg-info/top_level.txt +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/pyproject.toml +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/requirements/base/networkx.txt +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/requirements/base/ogb.txt +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/setup.cfg +0 -0
- {graphdatascience-1.10a1 → graphdatascience-1.11}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: graphdatascience
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.11
|
|
4
4
|
Summary: A Python client for the Neo4j Graph Data Science (GDS) library
|
|
5
5
|
Home-page: https://neo4j.com/product/graph-data-science/
|
|
6
6
|
Author: Neo4j
|
|
@@ -29,9 +29,10 @@ Requires-Python: >=3.8
|
|
|
29
29
|
Description-Content-Type: text/markdown
|
|
30
30
|
License-File: LICENSE
|
|
31
31
|
Requires-Dist: multimethod<2.0,>=1.0
|
|
32
|
-
Requires-Dist: neo4j<6.0,>=4.4.
|
|
32
|
+
Requires-Dist: neo4j<6.0,>=4.4.12
|
|
33
|
+
Requires-Dist: numpy<2.0
|
|
33
34
|
Requires-Dist: pandas<3.0,>=1.0
|
|
34
|
-
Requires-Dist: pyarrow<
|
|
35
|
+
Requires-Dist: pyarrow<17.0,>=14.0.1
|
|
35
36
|
Requires-Dist: textdistance<5.0,>=4.0
|
|
36
37
|
Requires-Dist: tqdm<5.0,>=4.0
|
|
37
38
|
Requires-Dist: typing-extensions<5.0,>=4.0
|
|
@@ -141,8 +142,6 @@ The manual is versioned to cover all GDS Python Client versions, so make sure to
|
|
|
141
142
|
Operations known to not yet work with `graphdatascience`:
|
|
142
143
|
|
|
143
144
|
* [Numeric utility functions](https://neo4j.com/docs/graph-data-science/current/management-ops/utility-functions/#utility-functions-numeric) (will never be supported)
|
|
144
|
-
* [Cypher on GDS](https://neo4j.com/docs/graph-data-science/current/management-ops/create-cypher-db/) (might be supported in the future)
|
|
145
|
-
* [Projecting graphs using Cypher Aggregation](https://neo4j.com/docs/graph-data-science/current/management-ops/projections/graph-project-cypher-aggregation/) (might be supported in the future)
|
|
146
145
|
|
|
147
146
|
|
|
148
147
|
## License
|
|
@@ -98,8 +98,6 @@ The manual is versioned to cover all GDS Python Client versions, so make sure to
|
|
|
98
98
|
Operations known to not yet work with `graphdatascience`:
|
|
99
99
|
|
|
100
100
|
* [Numeric utility functions](https://neo4j.com/docs/graph-data-science/current/management-ops/utility-functions/#utility-functions-numeric) (will never be supported)
|
|
101
|
-
* [Cypher on GDS](https://neo4j.com/docs/graph-data-science/current/management-ops/create-cypher-db/) (might be supported in the future)
|
|
102
|
-
* [Projecting graphs using Cypher Aggregation](https://neo4j.com/docs/graph-data-science/current/management-ops/projections/graph-project-cypher-aggregation/) (might be supported in the future)
|
|
103
101
|
|
|
104
102
|
|
|
105
103
|
## License
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from .algo.algo_endpoints import AlgoEndpoints
|
|
2
2
|
from .error.uncallable_namespace import UncallableNamespace
|
|
3
|
-
from .utils.
|
|
3
|
+
from .utils.direct_util_endpoints import IndirectUtilAlphaEndpoints
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class IndirectCallBuilder(AlgoEndpoints, UncallableNamespace):
|
|
@@ -23,7 +23,7 @@ from .system.system_endpoints import (
|
|
|
23
23
|
SystemBetaEndpoints,
|
|
24
24
|
)
|
|
25
25
|
from .topological_lp.topological_lp_endpoints import TopologicalLPAlphaEndpoints
|
|
26
|
-
from .utils.
|
|
26
|
+
from .utils.direct_util_endpoints import DirectUtilEndpoints
|
|
27
27
|
|
|
28
28
|
"""
|
|
29
29
|
This class should inherit endpoint classes that only contain endpoints that can be called directly from
|
|
@@ -44,7 +44,7 @@ class DirectEndpoints(
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
"""
|
|
47
|
-
This class should inherit endpoint classes that only expose calls of the `gds.
|
|
47
|
+
This class should inherit endpoint classes that only expose calls of the `gds.alpha` namespace.
|
|
48
48
|
Example of such endpoints: "gds.alpha.listProgress".
|
|
49
49
|
"""
|
|
50
50
|
|
|
@@ -65,6 +65,21 @@ class AlphaEndpoints(
|
|
|
65
65
|
return IndirectAlphaCallBuilder(self._query_runner, f"{self._namespace}.{attr}", self._server_version)
|
|
66
66
|
|
|
67
67
|
|
|
68
|
+
class AlphaRemoteEndpoints(
|
|
69
|
+
GraphAlphaEndpoints,
|
|
70
|
+
PipelineAlphaEndpoints,
|
|
71
|
+
ModelAlphaEndpoints,
|
|
72
|
+
SingleModeAlphaAlgoEndpoints,
|
|
73
|
+
SystemAlphaEndpoints,
|
|
74
|
+
AlphaConfigEndpoints,
|
|
75
|
+
):
|
|
76
|
+
def __init__(self, query_runner: QueryRunner, namespace: str, server_version: ServerVersion):
|
|
77
|
+
super().__init__(query_runner, namespace, server_version)
|
|
78
|
+
|
|
79
|
+
def __getattr__(self, attr: str) -> IndirectAlphaCallBuilder:
|
|
80
|
+
return IndirectAlphaCallBuilder(self._query_runner, f"{self._namespace}.{attr}", self._server_version)
|
|
81
|
+
|
|
82
|
+
|
|
68
83
|
"""
|
|
69
84
|
This class should inherit endpoint classes that only expose calls of the `gds.beta` namespace.
|
|
70
85
|
Example of such endpoints: "gds.beta.listProgress".
|
{graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/base_graph_proc_runner.py
RENAMED
|
@@ -15,11 +15,12 @@ from ..error.uncallable_namespace import UncallableNamespace
|
|
|
15
15
|
from ..server_version.compatible_with import compatible_with
|
|
16
16
|
from ..server_version.server_version import ServerVersion
|
|
17
17
|
from .graph_entity_ops_runner import (
|
|
18
|
-
GraphElementPropertyRunner,
|
|
19
18
|
GraphLabelRunner,
|
|
20
19
|
GraphNodePropertiesRunner,
|
|
20
|
+
GraphNodePropertyRunner,
|
|
21
21
|
GraphPropertyRunner,
|
|
22
22
|
GraphRelationshipPropertiesRunner,
|
|
23
|
+
GraphRelationshipPropertyRunner,
|
|
23
24
|
GraphRelationshipRunner,
|
|
24
25
|
GraphRelationshipsRunner,
|
|
25
26
|
)
|
|
@@ -379,9 +380,9 @@ class BaseGraphProcRunner(UncallableNamespace, IllegalAttrChecker):
|
|
|
379
380
|
)
|
|
380
381
|
|
|
381
382
|
@property
|
|
382
|
-
def nodeProperty(self) ->
|
|
383
|
+
def nodeProperty(self) -> GraphNodePropertyRunner:
|
|
383
384
|
self._namespace += ".nodeProperty"
|
|
384
|
-
return
|
|
385
|
+
return GraphNodePropertyRunner(self._query_runner, self._namespace, self._server_version)
|
|
385
386
|
|
|
386
387
|
@property
|
|
387
388
|
def nodeProperties(self) -> GraphNodePropertiesRunner:
|
|
@@ -389,9 +390,9 @@ class BaseGraphProcRunner(UncallableNamespace, IllegalAttrChecker):
|
|
|
389
390
|
return GraphNodePropertiesRunner(self._query_runner, self._namespace, self._server_version)
|
|
390
391
|
|
|
391
392
|
@property
|
|
392
|
-
def relationshipProperty(self) ->
|
|
393
|
+
def relationshipProperty(self) -> GraphRelationshipPropertyRunner:
|
|
393
394
|
self._namespace += ".relationshipProperty"
|
|
394
|
-
return
|
|
395
|
+
return GraphRelationshipPropertyRunner(self._query_runner, self._namespace, self._server_version)
|
|
395
396
|
|
|
396
397
|
@property
|
|
397
398
|
def relationshipProperties(self) -> GraphRelationshipPropertiesRunner:
|
|
@@ -516,8 +517,7 @@ class BaseGraphProcRunner(UncallableNamespace, IllegalAttrChecker):
|
|
|
516
517
|
).squeeze()
|
|
517
518
|
|
|
518
519
|
@multimethod
|
|
519
|
-
def removeNodeProperties(self) -> None:
|
|
520
|
-
...
|
|
520
|
+
def removeNodeProperties(self) -> None: ...
|
|
521
521
|
|
|
522
522
|
@removeNodeProperties.register
|
|
523
523
|
@graph_type_check
|
{graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/graph_cypher_runner.py
RENAMED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
import re
|
|
2
4
|
from itertools import chain, zip_longest
|
|
3
|
-
from typing import Any, Optional
|
|
5
|
+
from typing import Any, Dict, Optional
|
|
6
|
+
|
|
7
|
+
from pandas import Series
|
|
4
8
|
|
|
5
9
|
from ..caller_base import CallerBase
|
|
6
10
|
from ..query_runner.query_runner import QueryRunner
|
|
@@ -41,7 +45,10 @@ class GraphCypherRunner(CallerBase):
|
|
|
41
45
|
|
|
42
46
|
GraphCypherRunner._verify_query_ends_with_return_clause(self._namespace, query)
|
|
43
47
|
|
|
44
|
-
result = self._query_runner.run_cypher(query, params, database, False).squeeze()
|
|
48
|
+
result: Optional[Dict[str, Any]] = self._query_runner.run_cypher(query, params, database, False).squeeze()
|
|
49
|
+
|
|
50
|
+
if not result:
|
|
51
|
+
raise ValueError("Projected graph cannot be empty.")
|
|
45
52
|
|
|
46
53
|
try:
|
|
47
54
|
graph_name = str(result["graphName"])
|
|
@@ -50,7 +57,7 @@ class GraphCypherRunner(CallerBase):
|
|
|
50
57
|
f"Invalid query, the query must end with the `RETURN {self._namespace}(...)` call: {query}"
|
|
51
58
|
)
|
|
52
59
|
|
|
53
|
-
return GraphCreateResult(Graph(graph_name, self._query_runner, self._server_version), result)
|
|
60
|
+
return GraphCreateResult(Graph(graph_name, self._query_runner, self._server_version), Series(data=result))
|
|
54
61
|
|
|
55
62
|
__separators = re.compile(r"[,(.]")
|
|
56
63
|
|
{graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/graph_entity_ops_runner.py
RENAMED
|
@@ -70,11 +70,24 @@ class GraphEntityOpsBaseRunner(UncallableNamespace, IllegalAttrChecker):
|
|
|
70
70
|
)
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
class
|
|
73
|
+
class GraphNodePropertyRunner(GraphEntityOpsBaseRunner):
|
|
74
74
|
@compatible_with("stream", min_inclusive=ServerVersion(2, 2, 0))
|
|
75
|
-
|
|
75
|
+
@filter_id_func_deprecation_warning()
|
|
76
|
+
def stream(
|
|
77
|
+
self,
|
|
78
|
+
G: Graph,
|
|
79
|
+
node_property: str,
|
|
80
|
+
node_labels: Strings = ["*"],
|
|
81
|
+
db_node_properties: List[str] = [],
|
|
82
|
+
**config: Any,
|
|
83
|
+
) -> DataFrame:
|
|
76
84
|
self._namespace += ".stream"
|
|
77
|
-
|
|
85
|
+
|
|
86
|
+
result = self._handle_properties(G, node_property, node_labels, config)
|
|
87
|
+
|
|
88
|
+
return GraphNodePropertiesRunner._process_result(
|
|
89
|
+
self._query_runner, list(node_property), False, db_node_properties, result, config
|
|
90
|
+
)
|
|
78
91
|
|
|
79
92
|
|
|
80
93
|
class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
|
|
@@ -93,6 +106,19 @@ class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
|
|
|
93
106
|
|
|
94
107
|
result = self._handle_properties(G, node_properties, node_labels, config)
|
|
95
108
|
|
|
109
|
+
return GraphNodePropertiesRunner._process_result(
|
|
110
|
+
self._query_runner, node_properties, separate_property_columns, db_node_properties, result, config
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
@staticmethod
|
|
114
|
+
def _process_result(
|
|
115
|
+
query_runner: QueryRunner,
|
|
116
|
+
node_properties: List[str],
|
|
117
|
+
separate_property_columns: bool,
|
|
118
|
+
db_node_properties: List[str],
|
|
119
|
+
result: DataFrame,
|
|
120
|
+
config: Dict[str, Any],
|
|
121
|
+
) -> DataFrame:
|
|
96
122
|
# new format was requested, but the query was run via Cypher
|
|
97
123
|
if separate_property_columns and "propertyValue" in result.keys():
|
|
98
124
|
wide_result = result.pivot(index=["nodeId"], columns=["nodeProperty"], values="propertyValue")
|
|
@@ -106,7 +132,7 @@ class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
|
|
|
106
132
|
# old format was requested but the query was run via Arrow
|
|
107
133
|
elif not separate_property_columns and "propertyValue" not in result.keys():
|
|
108
134
|
id_vars = ["nodeId", "nodeLabels"] if config.get("listNodeLabels", False) else ["nodeId"]
|
|
109
|
-
result = result.melt(id_vars=id_vars
|
|
135
|
+
result = result.melt(id_vars=id_vars, var_name="nodeProperty", value_name="propertyValue")
|
|
110
136
|
|
|
111
137
|
if db_node_properties:
|
|
112
138
|
duplicate_properties = set(db_node_properties).intersection(set(node_properties))
|
|
@@ -116,16 +142,20 @@ class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
|
|
|
116
142
|
)
|
|
117
143
|
|
|
118
144
|
unique_node_ids = result["nodeId"].drop_duplicates().tolist()
|
|
119
|
-
db_properties_df =
|
|
120
|
-
|
|
145
|
+
db_properties_df = query_runner.run_cypher(
|
|
146
|
+
GraphNodePropertiesRunner._build_query(db_node_properties), {"ids": unique_node_ids}
|
|
121
147
|
)
|
|
122
148
|
|
|
123
149
|
if "propertyValue" not in result.keys():
|
|
124
150
|
result = result.join(db_properties_df.set_index("nodeId"), on="nodeId")
|
|
125
151
|
else:
|
|
126
|
-
db_properties_df = db_properties_df.melt(
|
|
127
|
-
|
|
152
|
+
db_properties_df = db_properties_df.melt(
|
|
153
|
+
id_vars=["nodeId"], var_name="nodeProperty", value_name="propertyValue"
|
|
128
154
|
)
|
|
155
|
+
|
|
156
|
+
if "nodeProperty" not in result.keys():
|
|
157
|
+
result["nodeProperty"] = node_properties[0]
|
|
158
|
+
|
|
129
159
|
result = pd.concat([result, db_properties_df])
|
|
130
160
|
|
|
131
161
|
return result
|
|
@@ -140,7 +170,7 @@ class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
|
|
|
140
170
|
return reduce(add_property, db_node_properties, query_prefix)
|
|
141
171
|
|
|
142
172
|
@compatible_with("write", min_inclusive=ServerVersion(2, 2, 0))
|
|
143
|
-
def write(self, G: Graph, node_properties:
|
|
173
|
+
def write(self, G: Graph, node_properties: Strings, node_labels: Strings = ["*"], **config: Any) -> "Series[Any]":
|
|
144
174
|
self._namespace += ".write"
|
|
145
175
|
return self._handle_properties(G, node_properties, node_labels, config).squeeze() # type: ignore
|
|
146
176
|
|
|
@@ -160,6 +190,16 @@ class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
|
|
|
160
190
|
).squeeze()
|
|
161
191
|
|
|
162
192
|
|
|
193
|
+
class GraphRelationshipPropertyRunner(GraphEntityOpsBaseRunner):
|
|
194
|
+
@compatible_with("stream", min_inclusive=ServerVersion(2, 2, 0))
|
|
195
|
+
def stream(
|
|
196
|
+
self, G: Graph, relationship_property: str, relationship_types: Strings = ["*"], **config: Any
|
|
197
|
+
) -> DataFrame:
|
|
198
|
+
self._namespace += ".stream"
|
|
199
|
+
relationship_types = [relationship_types] if isinstance(relationship_types, str) else relationship_types
|
|
200
|
+
return self._handle_properties(G, relationship_property, relationship_types, config)
|
|
201
|
+
|
|
202
|
+
|
|
163
203
|
class GraphRelationshipPropertiesRunner(GraphEntityOpsBaseRunner):
|
|
164
204
|
@compatible_with("stream", min_inclusive=ServerVersion(2, 2, 0))
|
|
165
205
|
def stream(
|
|
@@ -172,6 +212,8 @@ class GraphRelationshipPropertiesRunner(GraphEntityOpsBaseRunner):
|
|
|
172
212
|
) -> DataFrame:
|
|
173
213
|
self._namespace += ".stream"
|
|
174
214
|
|
|
215
|
+
relationship_types = [relationship_types] if isinstance(relationship_types, str) else relationship_types
|
|
216
|
+
|
|
175
217
|
result = self._handle_properties(G, relationship_properties, relationship_types, config)
|
|
176
218
|
|
|
177
219
|
# new format was requested, but the query was run via Cypher
|
{graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/graph/graph_remote_proc_runner.py
RENAMED
|
@@ -5,5 +5,4 @@ from graphdatascience.graph.graph_remote_project_runner import GraphProjectRemot
|
|
|
5
5
|
class GraphRemoteProcRunner(BaseGraphProcRunner):
|
|
6
6
|
@property
|
|
7
7
|
def project(self) -> GraphProjectRemoteRunner:
|
|
8
|
-
self._namespace += ".project.remoteDb"
|
|
9
8
|
return GraphProjectRemoteRunner(self._query_runner, self._namespace, self._server_version)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
from ..error.illegal_attr_checker import IllegalAttrChecker
|
|
6
|
+
from ..query_runner.aura_db_query_runner import AuraDbQueryRunner
|
|
7
|
+
from ..server_version.compatible_with import compatible_with
|
|
8
|
+
from .graph_object import Graph
|
|
9
|
+
from graphdatascience.call_parameters import CallParameters
|
|
10
|
+
from graphdatascience.graph.graph_create_result import GraphCreateResult
|
|
11
|
+
from graphdatascience.server_version.server_version import ServerVersion
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class GraphProjectRemoteRunner(IllegalAttrChecker):
|
|
15
|
+
@compatible_with("project", min_inclusive=ServerVersion(2, 7, 0))
|
|
16
|
+
def __call__(
|
|
17
|
+
self,
|
|
18
|
+
graph_name: str,
|
|
19
|
+
query: str,
|
|
20
|
+
concurrency: int = 4,
|
|
21
|
+
undirected_relationship_types: Optional[List[str]] = None,
|
|
22
|
+
inverse_indexed_relationship_types: Optional[List[str]] = None,
|
|
23
|
+
batch_size: Optional[int] = None,
|
|
24
|
+
) -> GraphCreateResult:
|
|
25
|
+
if inverse_indexed_relationship_types is None:
|
|
26
|
+
inverse_indexed_relationship_types = []
|
|
27
|
+
if undirected_relationship_types is None:
|
|
28
|
+
undirected_relationship_types = []
|
|
29
|
+
|
|
30
|
+
arrow_configuration = {}
|
|
31
|
+
if batch_size is not None:
|
|
32
|
+
arrow_configuration["batchSize"] = batch_size
|
|
33
|
+
|
|
34
|
+
params = CallParameters(
|
|
35
|
+
graph_name=graph_name,
|
|
36
|
+
query=query,
|
|
37
|
+
concurrency=concurrency,
|
|
38
|
+
undirected_relationship_types=undirected_relationship_types,
|
|
39
|
+
inverse_indexed_relationship_types=inverse_indexed_relationship_types,
|
|
40
|
+
arrow_configuration=arrow_configuration,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
result = self._query_runner.call_procedure(
|
|
44
|
+
endpoint=AuraDbQueryRunner.GDS_REMOTE_PROJECTION_PROC_NAME,
|
|
45
|
+
params=params,
|
|
46
|
+
).squeeze()
|
|
47
|
+
return GraphCreateResult(Graph(graph_name, self._query_runner, self._server_version), result)
|
|
@@ -13,6 +13,7 @@ from .query_runner.neo4j_query_runner import Neo4jQueryRunner
|
|
|
13
13
|
from .query_runner.query_runner import QueryRunner
|
|
14
14
|
from .server_version.server_version import ServerVersion
|
|
15
15
|
from graphdatascience.graph.graph_proc_runner import GraphProcRunner
|
|
16
|
+
from graphdatascience.utils.util_proc_runner import UtilProcRunner
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
class GraphDataScience(DirectEndpoints, UncallableNamespace):
|
|
@@ -23,11 +24,12 @@ class GraphDataScience(DirectEndpoints, UncallableNamespace):
|
|
|
23
24
|
|
|
24
25
|
def __init__(
|
|
25
26
|
self,
|
|
27
|
+
/,
|
|
26
28
|
endpoint: Union[str, Driver, QueryRunner],
|
|
27
29
|
auth: Optional[Tuple[str, str]] = None,
|
|
28
30
|
aura_ds: bool = False,
|
|
29
31
|
database: Optional[str] = None,
|
|
30
|
-
arrow: bool = True,
|
|
32
|
+
arrow: Union[str, bool] = True,
|
|
31
33
|
arrow_disable_server_verification: bool = True,
|
|
32
34
|
arrow_tls_root_certs: Optional[bytes] = None,
|
|
33
35
|
bookmarks: Optional[Any] = None,
|
|
@@ -43,19 +45,20 @@ class GraphDataScience(DirectEndpoints, UncallableNamespace):
|
|
|
43
45
|
A username, password pair for database authentication.
|
|
44
46
|
aura_ds : bool, default False
|
|
45
47
|
A flag that indicates that that the client is used to connect
|
|
46
|
-
to a Neo4j
|
|
48
|
+
to a Neo4j AuraDS instance.
|
|
47
49
|
database: Optional[str], default None
|
|
48
50
|
The Neo4j database to query against.
|
|
49
|
-
arrow : bool, default True
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
arrow : Union[str, bool], default True
|
|
52
|
+
Arrow connection information. This is either a bool or a string.
|
|
53
|
+
If it is a string, it will be interpreted as a connection URL to a GDS Arrow Server.
|
|
54
|
+
If it is a bool,
|
|
55
|
+
True will make the client discover the connection URI to the GDS Arrow server via the Neo4j endpoint,
|
|
56
|
+
while False will make the client use Bolt for all operations.
|
|
52
57
|
arrow_disable_server_verification : bool, default True
|
|
53
|
-
A flag that
|
|
54
|
-
TLS, that it skips server verification. If this is enabled, all
|
|
55
|
-
other TLS settings are overridden.
|
|
58
|
+
A flag that overrides other TLS settings and disables server verification for TLS connections.
|
|
56
59
|
arrow_tls_root_certs : Optional[bytes], default None
|
|
57
|
-
PEM-encoded certificates that are used for the
|
|
58
|
-
Arrow Flight server.
|
|
60
|
+
PEM-encoded certificates that are used for the connection to the
|
|
61
|
+
GDS Arrow Flight server.
|
|
59
62
|
bookmarks : Optional[Any], default None
|
|
60
63
|
The Neo4j bookmarks to require a certain state before the next query gets executed.
|
|
61
64
|
"""
|
|
@@ -76,14 +79,19 @@ class GraphDataScience(DirectEndpoints, UncallableNamespace):
|
|
|
76
79
|
self._query_runner.encrypted(),
|
|
77
80
|
arrow_disable_server_verification,
|
|
78
81
|
arrow_tls_root_certs,
|
|
82
|
+
None if arrow is True else arrow,
|
|
79
83
|
)
|
|
80
84
|
|
|
81
|
-
super().__init__(self._query_runner, "gds", self._server_version)
|
|
85
|
+
super().__init__(self._query_runner, namespace="gds", server_version=self._server_version)
|
|
82
86
|
|
|
83
87
|
@property
|
|
84
88
|
def graph(self) -> GraphProcRunner:
|
|
85
89
|
return GraphProcRunner(self._query_runner, f"{self._namespace}.graph", self._server_version)
|
|
86
90
|
|
|
91
|
+
@property
|
|
92
|
+
def util(self) -> UtilProcRunner:
|
|
93
|
+
return UtilProcRunner(self._query_runner, f"{self._namespace}.util", self._server_version)
|
|
94
|
+
|
|
87
95
|
@property
|
|
88
96
|
def alpha(self) -> AlphaEndpoints:
|
|
89
97
|
return AlphaEndpoints(self._query_runner, "gds.alpha", self._server_version)
|
{graphdatascience-1.10a1 → graphdatascience-1.11}/graphdatascience/model/link_prediction_model.py
RENAMED
|
@@ -41,5 +41,5 @@ class LPModel(PipelineModel):
|
|
|
41
41
|
A list of LinkFeatures of the pipeline.
|
|
42
42
|
|
|
43
43
|
"""
|
|
44
|
-
steps: List[Dict[str, Any]] = self._list_info()["modelInfo"][
|
|
44
|
+
steps: List[Dict[str, Any]] = self._list_info()["modelInfo"]["pipeline"]["featureSteps"]
|
|
45
45
|
return [LinkFeature(s["name"], s["config"]) for s in steps]
|