graphdatascience 2.3__py3-none-any.whl → 2.5__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_endpoint_version.py +2 -2
- graphdatascience/arrow_client/v2/gds_arrow_client.py +2 -1
- graphdatascience/arrow_client/v2/job_client.py +3 -1
- graphdatascience/datasets/nx_loader.py +3 -4
- graphdatascience/procedure_surface/api/catalog/__init__.py +4 -0
- graphdatascience/procedure_surface/api/catalog/catalog_endpoints.py +2 -2
- graphdatascience/procedure_surface/api/catalog/relationships_endpoints.py +3 -6
- graphdatascience/procedure_surface/api/catalog/scale_properties_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/catalog/scale_properties_session_endpoints.py +66 -0
- graphdatascience/procedure_surface/api/centrality/__init__.py +44 -0
- graphdatascience/procedure_surface/api/centrality/articlerank_endpoints.py +7 -7
- graphdatascience/procedure_surface/api/centrality/articlerank_session_endpoints.py +76 -0
- graphdatascience/procedure_surface/api/centrality/articulationpoints_session_endpoints.py +59 -0
- graphdatascience/procedure_surface/api/centrality/betweenness_session_endpoints.py +68 -0
- graphdatascience/procedure_surface/api/centrality/bridges_session_endpoints.py +59 -0
- graphdatascience/procedure_surface/api/centrality/celf_session_endpoints.py +71 -0
- graphdatascience/procedure_surface/api/centrality/closeness_harmonic_session_endpoints.py +59 -0
- graphdatascience/procedure_surface/api/centrality/closeness_session_endpoints.py +73 -0
- graphdatascience/procedure_surface/api/centrality/degree_session_endpoints.py +65 -0
- graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/centrality/eigenvector_session_endpoints.py +75 -0
- graphdatascience/procedure_surface/api/centrality/hits_session_endpoints.py +71 -0
- graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py +7 -7
- graphdatascience/procedure_surface/api/centrality/pagerank_session_endpoints.py +77 -0
- graphdatascience/procedure_surface/api/community/__init__.py +69 -1
- graphdatascience/procedure_surface/api/community/clique_counting_session_endpoints.py +59 -0
- graphdatascience/procedure_surface/api/community/conductance_session_endpoints.py +65 -0
- graphdatascience/procedure_surface/api/community/hdbscan_session_endpoints.py +71 -0
- graphdatascience/procedure_surface/api/community/k1coloring_session_endpoints.py +65 -0
- graphdatascience/procedure_surface/api/community/kcore_session_endpoints.py +59 -0
- graphdatascience/procedure_surface/api/community/kmeans_session_endpoints.py +86 -0
- graphdatascience/procedure_surface/api/community/labelpropagation_session_endpoints.py +74 -0
- graphdatascience/procedure_surface/api/community/leiden_session_endpoints.py +86 -0
- graphdatascience/procedure_surface/api/community/local_clustering_coefficient_session_endpoints.py +62 -0
- graphdatascience/procedure_surface/api/community/louvain_endpoints.py +9 -9
- graphdatascience/procedure_surface/api/community/louvain_session_endpoints.py +80 -0
- graphdatascience/procedure_surface/api/community/maxkcut_session_endpoints.py +74 -0
- graphdatascience/procedure_surface/api/community/modularity_optimization_session_endpoints.py +77 -0
- graphdatascience/procedure_surface/api/community/modularity_session_endpoints.py +65 -0
- graphdatascience/procedure_surface/api/community/scc_session_endpoints.py +62 -0
- graphdatascience/procedure_surface/api/community/sllpa_session_endpoints.py +68 -0
- graphdatascience/procedure_surface/api/community/triangle_count_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/community/triangle_count_session_endpoints.py +65 -0
- graphdatascience/procedure_surface/api/community/triangles_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/community/wcc_session_endpoints.py +71 -0
- graphdatascience/procedure_surface/api/node_embedding/__init__.py +28 -4
- graphdatascience/procedure_surface/api/node_embedding/fastpath_session_endpoints.py +102 -0
- graphdatascience/procedure_surface/api/node_embedding/fastrp_endpoints.py +17 -5
- graphdatascience/procedure_surface/api/node_embedding/fastrp_session_endpoints.py +84 -0
- graphdatascience/procedure_surface/api/node_embedding/graphsage_endpoints.py +8 -0
- graphdatascience/procedure_surface/api/node_embedding/graphsage_predict_endpoints.py +12 -0
- graphdatascience/procedure_surface/api/node_embedding/graphsage_supervised_endpoints.py +16 -0
- graphdatascience/procedure_surface/api/node_embedding/graphsage_supervised_model.py +15 -0
- graphdatascience/procedure_surface/api/node_embedding/graphsage_supervised_session_endpoints.py +63 -0
- graphdatascience/procedure_surface/api/node_embedding/graphsage_train_endpoints.py +4 -0
- graphdatascience/procedure_surface/api/node_embedding/graphsage_unsupervised_endpoints.py +16 -0
- graphdatascience/procedure_surface/api/node_embedding/graphsage_unsupervised_model.py +18 -0
- graphdatascience/procedure_surface/api/node_embedding/graphsage_unsupervised_session_endpoints.py +63 -0
- graphdatascience/procedure_surface/api/node_embedding/hashgnn_endpoints.py +12 -0
- graphdatascience/procedure_surface/api/node_embedding/hashgnn_session_endpoints.py +90 -0
- graphdatascience/procedure_surface/api/node_embedding/node2vec_endpoints.py +12 -0
- graphdatascience/procedure_surface/api/node_embedding/node2vec_session_endpoints.py +110 -0
- graphdatascience/procedure_surface/api/pathfinding/__init__.py +91 -9
- graphdatascience/procedure_surface/api/pathfinding/all_shortest_path_session_endpoints.py +80 -0
- graphdatascience/procedure_surface/api/pathfinding/bfs_endpoints.py +4 -4
- graphdatascience/procedure_surface/api/pathfinding/bfs_session_endpoints.py +68 -0
- graphdatascience/procedure_surface/api/pathfinding/dag_session_endpoints.py +27 -0
- graphdatascience/procedure_surface/api/pathfinding/dfs_endpoints.py +4 -4
- graphdatascience/procedure_surface/api/pathfinding/dfs_session_endpoints.py +68 -0
- graphdatascience/procedure_surface/api/pathfinding/dijkstra_endpoints.py +4 -4
- graphdatascience/procedure_surface/api/pathfinding/dijkstra_session_endpoints.py +68 -0
- graphdatascience/procedure_surface/api/pathfinding/k_spanning_tree_session_endpoints.py +71 -0
- graphdatascience/procedure_surface/api/pathfinding/longest_path_session_endpoints.py +62 -0
- graphdatascience/procedure_surface/api/pathfinding/max_flow_min_cost_session_endpoints.py +77 -0
- graphdatascience/procedure_surface/api/pathfinding/max_flow_session_endpoints.py +80 -0
- graphdatascience/procedure_surface/api/pathfinding/prize_steiner_tree_session_endpoints.py +65 -0
- graphdatascience/procedure_surface/api/pathfinding/random_walk_session_endpoints.py +82 -0
- graphdatascience/procedure_surface/api/pathfinding/shortest_path_session_endpoints.py +36 -0
- graphdatascience/procedure_surface/api/pathfinding/single_source_bellman_ford_session_endpoints.py +65 -0
- graphdatascience/procedure_surface/api/pathfinding/single_source_delta_session_endpoints.py +68 -0
- graphdatascience/procedure_surface/api/pathfinding/single_source_dijkstra_session_endpoints.py +65 -0
- graphdatascience/procedure_surface/api/pathfinding/source_target_astar_session_endpoints.py +74 -0
- graphdatascience/procedure_surface/api/pathfinding/source_target_dijkstra_endpoints.py +4 -4
- graphdatascience/procedure_surface/api/pathfinding/source_target_dijkstra_session_endpoints.py +68 -0
- graphdatascience/procedure_surface/api/pathfinding/source_target_yens_session_endpoints.py +71 -0
- graphdatascience/procedure_surface/api/pathfinding/spanning_tree_session_endpoints.py +68 -0
- graphdatascience/procedure_surface/api/pathfinding/steiner_tree_endpoints.py +1 -1
- graphdatascience/procedure_surface/api/pathfinding/steiner_tree_session_endpoints.py +74 -0
- graphdatascience/procedure_surface/api/pathfinding/topological_sort_session_endpoints.py +62 -0
- graphdatascience/procedure_surface/api/similarity/__init__.py +16 -0
- graphdatascience/procedure_surface/api/similarity/knn_filtered_session_endpoints.py +98 -0
- graphdatascience/procedure_surface/api/similarity/knn_session_endpoints.py +98 -0
- graphdatascience/procedure_surface/api/similarity/node_similarity_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/similarity/node_similarity_filtered_session_endpoints.py +95 -0
- graphdatascience/procedure_surface/api/similarity/node_similarity_session_endpoints.py +97 -0
- graphdatascience/procedure_surface/arrow/catalog/catalog_arrow_endpoints.py +1 -1
- graphdatascience/procedure_surface/arrow/catalog/node_properties_arrow_endpoints.py +2 -1
- graphdatascience/procedure_surface/arrow/catalog/projection_arrow_endpoints.py +34 -12
- graphdatascience/procedure_surface/arrow/catalog/scale_properties_arrow_endpoints.py +34 -2
- graphdatascience/procedure_surface/arrow/centrality/articlerank_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/centrality/articulationpoints_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/centrality/betweenness_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/centrality/bridges_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/centrality/celf_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/centrality/closeness_arrow_endpoints.py +8 -4
- graphdatascience/procedure_surface/arrow/centrality/closeness_harmonic_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/centrality/degree_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/centrality/eigenvector_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/centrality/hits_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/centrality/pagerank_arrow_endpoints.py +9 -3
- graphdatascience/procedure_surface/arrow/community/clique_counting_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/community/conductance_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/community/hdbscan_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/community/k1coloring_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/community/kcore_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/community/kmeans_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/community/labelpropagation_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/community/leiden_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/community/local_clustering_coefficient_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/community/louvain_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/community/maxkcut_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/community/modularity_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/community/modularity_optimization_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/community/scc_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/community/sllpa_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/community/triangle_count_arrow_endpoints.py +10 -8
- graphdatascience/procedure_surface/arrow/community/triangles_arrow_endpoints.py +1 -1
- graphdatascience/procedure_surface/arrow/community/wcc_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/node_embedding/fastpath_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/node_embedding/fastrp_arrow_endpoints.py +12 -2
- graphdatascience/procedure_surface/arrow/node_embedding/graphsage_predict_arrow_endpoints.py +8 -0
- graphdatascience/procedure_surface/arrow/node_embedding/graphsage_session_endpoints.py +12 -10
- graphdatascience/procedure_surface/arrow/node_embedding/graphsage_supervised_arrow_endpoints.py +15 -4
- graphdatascience/procedure_surface/arrow/node_embedding/graphsage_train_arrow_endpoints.py +4 -0
- graphdatascience/procedure_surface/arrow/node_embedding/graphsage_unsupervised_arrow_endpoints.py +15 -4
- graphdatascience/procedure_surface/arrow/node_embedding/hashgnn_arrow_endpoints.py +12 -2
- graphdatascience/procedure_surface/arrow/node_embedding/node2vec_arrow_endpoints.py +12 -2
- graphdatascience/procedure_surface/arrow/pathfinding/all_shortest_path_arrow_endpoints.py +11 -7
- graphdatascience/procedure_surface/arrow/pathfinding/bfs_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/pathfinding/dag_arrow_endpoints.py +10 -6
- graphdatascience/procedure_surface/arrow/pathfinding/dfs_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/pathfinding/dijkstra_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/pathfinding/k_spanning_tree_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/pathfinding/longest_path_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/pathfinding/max_flow_arrow_endpoints.py +8 -4
- graphdatascience/procedure_surface/arrow/pathfinding/max_flow_min_cost_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/pathfinding/prize_steiner_tree_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/pathfinding/random_walk_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/pathfinding/shortest_path_arrow_endpoints.py +12 -12
- graphdatascience/procedure_surface/arrow/pathfinding/single_source_bellman_ford_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/pathfinding/single_source_delta_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/pathfinding/single_source_dijkstra_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/pathfinding/source_target_astar_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/pathfinding/source_target_dijkstra_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/pathfinding/source_target_yens_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/pathfinding/spanning_tree_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/pathfinding/steiner_tree_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/pathfinding/topological_sort_arrow_endpoints.py +32 -2
- graphdatascience/procedure_surface/arrow/similarity/knn_arrow_endpoints.py +8 -4
- graphdatascience/procedure_surface/arrow/similarity/knn_filtered_arrow_endpoints.py +4 -2
- graphdatascience/procedure_surface/arrow/similarity/node_similarity_arrow_endpoints.py +7 -5
- graphdatascience/procedure_surface/arrow/similarity/node_similarity_filtered_arrow_endpoints.py +3 -3
- graphdatascience/procedure_surface/cypher/catalog/catalog_cypher_endpoints.py +3 -2
- graphdatascience/procedure_surface/cypher/community/triangle_count_cypher_endpoints.py +5 -5
- graphdatascience/procedure_surface/cypher/community/triangles_cypher_endpoints.py +1 -1
- graphdatascience/procedure_surface/cypher/node_embedding/fastrp_cypher_endpoints.py +7 -0
- graphdatascience/procedure_surface/cypher/node_embedding/graphsage_predict_cypher_endpoints.py +7 -0
- graphdatascience/procedure_surface/cypher/node_embedding/graphsage_train_cypher_endpoints.py +26 -0
- graphdatascience/procedure_surface/cypher/node_embedding/hashgnn_cypher_endpoints.py +7 -0
- graphdatascience/procedure_surface/cypher/node_embedding/node2vec_cypher_endpoints.py +7 -0
- graphdatascience/procedure_surface/cypher/result_as_vector_utils.py +25 -0
- graphdatascience/procedure_surface/utils/gpu_config.py +3 -0
- graphdatascience/query_runner/neo4j_query_runner.py +37 -21
- graphdatascience/query_runner/query_type.py +2 -2
- graphdatascience/retry_utils/neo4j_retry_helper.py +20 -0
- graphdatascience/session/algorithm_category.py +2 -2
- graphdatascience/session/aura_graph_data_science.py +194 -108
- graphdatascience/session/dbms/protocol_version.py +2 -2
- graphdatascience/session/dbms_connection_info.py +15 -2
- graphdatascience/session/gds_sessions.py +18 -9
- graphdatascience/session/remote_ops/project_protocols.py +8 -2
- graphdatascience/session/remote_ops/projection_runner.py +2 -0
- graphdatascience/session/session_target.py +16 -1
- graphdatascience/utils.py +22 -0
- graphdatascience/version.py +1 -1
- {graphdatascience-2.3.dist-info → graphdatascience-2.5.dist-info}/METADATA +2 -2
- {graphdatascience-2.3.dist-info → graphdatascience-2.5.dist-info}/RECORD +190 -127
- {graphdatascience-2.3.dist-info → graphdatascience-2.5.dist-info}/WHEEL +0 -0
- {graphdatascience-2.3.dist-info → graphdatascience-2.5.dist-info}/licenses/LICENSE +0 -0
- {graphdatascience-2.3.dist-info → graphdatascience-2.5.dist-info}/top_level.txt +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from enum import
|
|
3
|
+
from enum import StrEnum
|
|
4
4
|
|
|
5
5
|
from graphdatascience.arrow_client.authenticated_flight_client import AuthenticatedArrowClient
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
class ArrowEndpointVersion(
|
|
8
|
+
class ArrowEndpointVersion(StrEnum):
|
|
9
9
|
V1 = "v1"
|
|
10
10
|
V2 = "v2"
|
|
11
11
|
|
|
@@ -13,6 +13,7 @@ from graphdatascience.arrow_client.arrow_endpoint_version import ArrowEndpointVe
|
|
|
13
13
|
from graphdatascience.arrow_client.arrow_table_utils import table_from_pandas
|
|
14
14
|
from graphdatascience.arrow_client.authenticated_flight_client import AuthenticatedArrowClient, ConnectionInfo
|
|
15
15
|
from graphdatascience.query_runner.termination_flag import TerminationFlag
|
|
16
|
+
from graphdatascience.utils import as_list
|
|
16
17
|
|
|
17
18
|
from ...procedure_surface.api.default_values import ALL_TYPES
|
|
18
19
|
from ...procedure_surface.utils.config_converter import ConfigConverter
|
|
@@ -71,7 +72,7 @@ class GdsArrowClient:
|
|
|
71
72
|
str
|
|
72
73
|
The JobId identifying the export process
|
|
73
74
|
"""
|
|
74
|
-
normalized_properties =
|
|
75
|
+
normalized_properties = as_list(node_properties)
|
|
75
76
|
|
|
76
77
|
config = ConfigConverter.convert_to_gds_config(
|
|
77
78
|
graph_name=graph_name,
|
|
@@ -111,7 +111,9 @@ class JobClient:
|
|
|
111
111
|
):
|
|
112
112
|
with attempt:
|
|
113
113
|
try:
|
|
114
|
-
|
|
114
|
+
# a submission is not retried here: a timed-out call may still have landed on
|
|
115
|
+
# the server, so only the status check below decides whether to send it again
|
|
116
|
+
res = list(client.do_action(endpoint, config))
|
|
115
117
|
return JobIdConfig(**deserialize_single(res)).job_id
|
|
116
118
|
except FLIGHT_TRANSIENT_EXCEPTIONS as e:
|
|
117
119
|
try:
|
|
@@ -6,6 +6,7 @@ from pandas import DataFrame
|
|
|
6
6
|
|
|
7
7
|
from graphdatascience.datasets.graph_constructor_func import GraphConstructorFunc
|
|
8
8
|
from graphdatascience.graph import Graph
|
|
9
|
+
from graphdatascience.utils import as_list
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class NXLoader:
|
|
@@ -41,10 +42,8 @@ class NXLoader:
|
|
|
41
42
|
node_labels: list[str]
|
|
42
43
|
if no_node_labels:
|
|
43
44
|
node_labels = ["N"]
|
|
44
|
-
elif isinstance(labels_attr, str):
|
|
45
|
-
node_labels =
|
|
46
|
-
elif isinstance(labels_attr, list):
|
|
47
|
-
node_labels = labels_attr
|
|
45
|
+
elif isinstance(labels_attr, (str, list)):
|
|
46
|
+
node_labels = as_list(labels_attr)
|
|
48
47
|
else:
|
|
49
48
|
raise ValueError(
|
|
50
49
|
"`labels` node attributes must be of type `str` or `list[str]`. "
|
|
@@ -51,6 +51,9 @@ from graphdatascience.procedure_surface.api.catalog.scale_properties_endpoints i
|
|
|
51
51
|
ScalePropertiesStatsResult,
|
|
52
52
|
ScalePropertiesWriteResult,
|
|
53
53
|
)
|
|
54
|
+
from graphdatascience.procedure_surface.api.catalog.scale_properties_session_endpoints import (
|
|
55
|
+
ScalePropertiesSessionEndpoints,
|
|
56
|
+
)
|
|
54
57
|
from graphdatascience.procedure_surface.api.catalog.scaler_config import ScalerConfig
|
|
55
58
|
|
|
56
59
|
__all__ = [
|
|
@@ -87,6 +90,7 @@ __all__ = [
|
|
|
87
90
|
"RelationshipsWriteResult",
|
|
88
91
|
"ScalePropertiesEndpoints",
|
|
89
92
|
"ScalePropertiesMutateResult",
|
|
93
|
+
"ScalePropertiesSessionEndpoints",
|
|
90
94
|
"ScalePropertiesStatsResult",
|
|
91
95
|
"ScalePropertiesWriteResult",
|
|
92
96
|
"ScalerConfig",
|
|
@@ -43,13 +43,13 @@ class CatalogEndpoints(ABC):
|
|
|
43
43
|
pass
|
|
44
44
|
|
|
45
45
|
@abstractmethod
|
|
46
|
-
def exists(self, graph_name: str) -> bool:
|
|
46
|
+
def exists(self, graph_name: Graph | str) -> bool:
|
|
47
47
|
"""Check if a graph exists in the catalog.
|
|
48
48
|
|
|
49
49
|
Parameters
|
|
50
50
|
----------
|
|
51
51
|
graph_name
|
|
52
|
-
|
|
52
|
+
The graph, or the name of the graph
|
|
53
53
|
|
|
54
54
|
Returns
|
|
55
55
|
-------
|
|
@@ -10,6 +10,7 @@ from graphdatascience.graph.graph_api import Graph
|
|
|
10
10
|
from graphdatascience.procedure_surface.api.base_result import BaseResult
|
|
11
11
|
from graphdatascience.procedure_surface.api.catalog.relationships_data_frame import RelationshipsDataFrame
|
|
12
12
|
from graphdatascience.procedure_surface.api.default_values import ALL_LABELS, ALL_TYPES
|
|
13
|
+
from graphdatascience.utils import as_list
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
class RelationshipsEndpoints(ABC):
|
|
@@ -276,12 +277,8 @@ class RelationshipsWriteResult(BaseResult):
|
|
|
276
277
|
@field_validator("relationship_properties", mode="before")
|
|
277
278
|
@classmethod
|
|
278
279
|
def coerce_relationship_properties(cls, v: Any) -> list[str]:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
elif isinstance(v, str):
|
|
282
|
-
return [v]
|
|
283
|
-
else:
|
|
284
|
-
return v # type: ignore
|
|
280
|
+
coerced = as_list(v)
|
|
281
|
+
return [] if coerced is None else coerced
|
|
285
282
|
|
|
286
283
|
|
|
287
284
|
class RelationshipsDropResult(BaseResult):
|
|
@@ -45,7 +45,7 @@ class ScalePropertiesEndpoints(ABC):
|
|
|
45
45
|
|
|
46
46
|
- A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE')
|
|
47
47
|
- A dictionary with scaler configuration (e.g., {'type': 'Log', 'offset': 1.0})
|
|
48
|
-
-
|
|
48
|
+
- A :class:`~graphdatascience.procedure_surface.api.catalog.scaler_config.ScalerConfig` instance
|
|
49
49
|
node_labels
|
|
50
50
|
Filter the graph using the given node labels. Nodes with any of the given labels will be included.
|
|
51
51
|
sudo
|
|
@@ -95,7 +95,7 @@ class ScalePropertiesEndpoints(ABC):
|
|
|
95
95
|
|
|
96
96
|
- A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE')
|
|
97
97
|
- A dictionary with scaler configuration (e.g., {'type': 'Log', 'offset': 1.0})
|
|
98
|
-
-
|
|
98
|
+
- A :class:`~graphdatascience.procedure_surface.api.catalog.scaler_config.ScalerConfig` instance
|
|
99
99
|
node_labels
|
|
100
100
|
Filter the graph using the given node labels. Nodes with any of the given labels will be included.
|
|
101
101
|
sudo
|
|
@@ -143,7 +143,7 @@ class ScalePropertiesEndpoints(ABC):
|
|
|
143
143
|
|
|
144
144
|
- A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE')
|
|
145
145
|
- A dictionary with scaler configuration (e.g., {'type': 'Log', 'offset': 1.0})
|
|
146
|
-
-
|
|
146
|
+
- A :class:`~graphdatascience.procedure_surface.api.catalog.scaler_config.ScalerConfig` instance
|
|
147
147
|
node_labels
|
|
148
148
|
Filter the graph using the given node labels. Nodes with any of the given labels will be included.
|
|
149
149
|
sudo
|
|
@@ -198,7 +198,7 @@ class ScalePropertiesEndpoints(ABC):
|
|
|
198
198
|
|
|
199
199
|
- A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE')
|
|
200
200
|
- A dictionary with scaler configuration (e.g., {'type': 'Log', 'offset': 1.0})
|
|
201
|
-
-
|
|
201
|
+
- A :class:`~graphdatascience.procedure_surface.api.catalog.scaler_config.ScalerConfig` instance
|
|
202
202
|
node_labels
|
|
203
203
|
Filter the graph using the given node labels. Nodes with any of the given labels will be included.
|
|
204
204
|
sudo
|
|
@@ -242,7 +242,7 @@ class ScalePropertiesEndpoints(ABC):
|
|
|
242
242
|
|
|
243
243
|
- A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE')
|
|
244
244
|
- A dictionary with scaler configuration (e.g., {'type': 'Log', 'offset': 1.0})
|
|
245
|
-
-
|
|
245
|
+
- A :class:`~graphdatascience.procedure_surface.api.catalog.scaler_config.ScalerConfig` instance
|
|
246
246
|
node_labels
|
|
247
247
|
Filter the graph using the given node labels. Nodes with any of the given labels will be included.
|
|
248
248
|
concurrency
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from abc import abstractmethod
|
|
4
|
+
|
|
5
|
+
from graphdatascience.graph.graph_api import Graph
|
|
6
|
+
from graphdatascience.procedure_surface.api.catalog.scale_properties_endpoints import (
|
|
7
|
+
ScalePropertiesEndpoints,
|
|
8
|
+
)
|
|
9
|
+
from graphdatascience.procedure_surface.api.catalog.scaler_config import ScalerConfig
|
|
10
|
+
from graphdatascience.procedure_surface.api.default_values import ALL_LABELS
|
|
11
|
+
from graphdatascience.procedure_surface.api.job_handle import JobHandle
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ScalePropertiesSessionEndpoints(ScalePropertiesEndpoints):
|
|
15
|
+
"""Scale properties endpoints as exposed by a GDS Session."""
|
|
16
|
+
|
|
17
|
+
@abstractmethod
|
|
18
|
+
def compute(
|
|
19
|
+
self,
|
|
20
|
+
G: Graph,
|
|
21
|
+
node_properties: list[str],
|
|
22
|
+
scaler: str | dict[str, str | int | float] | ScalerConfig,
|
|
23
|
+
node_labels: list[str] = ALL_LABELS,
|
|
24
|
+
sudo: bool = False,
|
|
25
|
+
log_progress: bool = True,
|
|
26
|
+
username: str | None = None,
|
|
27
|
+
concurrency: int | None = None,
|
|
28
|
+
job_id: str | None = None,
|
|
29
|
+
) -> JobHandle:
|
|
30
|
+
"""
|
|
31
|
+
Starts the computation as a job and returns a handle to it.
|
|
32
|
+
|
|
33
|
+
The computation runs without materializing its result. Use the returned handle to
|
|
34
|
+
mutate, write or stream the result afterwards.
|
|
35
|
+
|
|
36
|
+
Parameters
|
|
37
|
+
----------
|
|
38
|
+
G
|
|
39
|
+
Graph object to use
|
|
40
|
+
node_properties
|
|
41
|
+
The node properties to scale. Can be a list of property names or a dictionary mapping property names to configurations.
|
|
42
|
+
scaler
|
|
43
|
+
The scaler to use. Can be:
|
|
44
|
+
|
|
45
|
+
- A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE')
|
|
46
|
+
- A dictionary with scaler configuration (e.g., {'type': 'Log', 'offset': 1.0})
|
|
47
|
+
- A :class:`~graphdatascience.procedure_surface.api.catalog.scaler_config.ScalerConfig` instance
|
|
48
|
+
node_labels
|
|
49
|
+
Filter the graph using the given node labels. Nodes with any of the given labels will be included.
|
|
50
|
+
sudo
|
|
51
|
+
Disable the memory guard.
|
|
52
|
+
log_progress
|
|
53
|
+
Display progress logging.
|
|
54
|
+
username
|
|
55
|
+
As an administrator, impersonate a different user for accessing their graphs.
|
|
56
|
+
concurrency
|
|
57
|
+
Number of concurrent threads to use.
|
|
58
|
+
job_id
|
|
59
|
+
Identifier for the computation.
|
|
60
|
+
|
|
61
|
+
Returns
|
|
62
|
+
-------
|
|
63
|
+
JobHandle
|
|
64
|
+
Handle to the started computation
|
|
65
|
+
"""
|
|
66
|
+
pass
|
|
@@ -4,25 +4,40 @@ from graphdatascience.procedure_surface.api.centrality.articlerank_endpoints imp
|
|
|
4
4
|
ArticleRankStatsResult,
|
|
5
5
|
ArticleRankWriteResult,
|
|
6
6
|
)
|
|
7
|
+
from graphdatascience.procedure_surface.api.centrality.articlerank_session_endpoints import (
|
|
8
|
+
ArticleRankSessionEndpoints,
|
|
9
|
+
)
|
|
7
10
|
from graphdatascience.procedure_surface.api.centrality.articulationpoints_endpoints import (
|
|
8
11
|
ArticulationPointsEndpoints,
|
|
9
12
|
ArticulationPointsMutateResult,
|
|
10
13
|
ArticulationPointsStatsResult,
|
|
11
14
|
ArticulationPointsWriteResult,
|
|
12
15
|
)
|
|
16
|
+
from graphdatascience.procedure_surface.api.centrality.articulationpoints_session_endpoints import (
|
|
17
|
+
ArticulationPointsSessionEndpoints,
|
|
18
|
+
)
|
|
13
19
|
from graphdatascience.procedure_surface.api.centrality.betweenness_endpoints import (
|
|
14
20
|
BetweennessEndpoints,
|
|
15
21
|
BetweennessMutateResult,
|
|
16
22
|
BetweennessStatsResult,
|
|
17
23
|
BetweennessWriteResult,
|
|
18
24
|
)
|
|
25
|
+
from graphdatascience.procedure_surface.api.centrality.betweenness_session_endpoints import (
|
|
26
|
+
BetweennessSessionEndpoints,
|
|
27
|
+
)
|
|
19
28
|
from graphdatascience.procedure_surface.api.centrality.bridges_endpoints import BridgesEndpoints
|
|
29
|
+
from graphdatascience.procedure_surface.api.centrality.bridges_session_endpoints import (
|
|
30
|
+
BridgesSessionEndpoints,
|
|
31
|
+
)
|
|
20
32
|
from graphdatascience.procedure_surface.api.centrality.celf_endpoints import (
|
|
21
33
|
CelfEndpoints,
|
|
22
34
|
CelfMutateResult,
|
|
23
35
|
CelfStatsResult,
|
|
24
36
|
CelfWriteResult,
|
|
25
37
|
)
|
|
38
|
+
from graphdatascience.procedure_surface.api.centrality.celf_session_endpoints import (
|
|
39
|
+
CelfSessionEndpoints,
|
|
40
|
+
)
|
|
26
41
|
from graphdatascience.procedure_surface.api.centrality.closeness_endpoints import (
|
|
27
42
|
ClosenessEndpoints,
|
|
28
43
|
ClosenessMutateResult,
|
|
@@ -35,71 +50,100 @@ from graphdatascience.procedure_surface.api.centrality.closeness_harmonic_endpoi
|
|
|
35
50
|
ClosenessHarmonicStatsResult,
|
|
36
51
|
ClosenessHarmonicWriteResult,
|
|
37
52
|
)
|
|
53
|
+
from graphdatascience.procedure_surface.api.centrality.closeness_harmonic_session_endpoints import (
|
|
54
|
+
ClosenessHarmonicSessionEndpoints,
|
|
55
|
+
)
|
|
56
|
+
from graphdatascience.procedure_surface.api.centrality.closeness_session_endpoints import (
|
|
57
|
+
ClosenessSessionEndpoints,
|
|
58
|
+
)
|
|
38
59
|
from graphdatascience.procedure_surface.api.centrality.degree_endpoints import (
|
|
39
60
|
DegreeEndpoints,
|
|
40
61
|
DegreeMutateResult,
|
|
41
62
|
DegreeStatsResult,
|
|
42
63
|
DegreeWriteResult,
|
|
43
64
|
)
|
|
65
|
+
from graphdatascience.procedure_surface.api.centrality.degree_session_endpoints import (
|
|
66
|
+
DegreeSessionEndpoints,
|
|
67
|
+
)
|
|
44
68
|
from graphdatascience.procedure_surface.api.centrality.eigenvector_endpoints import (
|
|
45
69
|
EigenvectorEndpoints,
|
|
46
70
|
EigenvectorMutateResult,
|
|
47
71
|
EigenvectorStatsResult,
|
|
48
72
|
EigenvectorWriteResult,
|
|
49
73
|
)
|
|
74
|
+
from graphdatascience.procedure_surface.api.centrality.eigenvector_session_endpoints import (
|
|
75
|
+
EigenvectorSessionEndpoints,
|
|
76
|
+
)
|
|
50
77
|
from graphdatascience.procedure_surface.api.centrality.hits_endpoints import (
|
|
51
78
|
HitsEndpoints,
|
|
52
79
|
HitsMutateResult,
|
|
53
80
|
HitsStatsResult,
|
|
54
81
|
HitsWriteResult,
|
|
55
82
|
)
|
|
83
|
+
from graphdatascience.procedure_surface.api.centrality.hits_session_endpoints import (
|
|
84
|
+
HitsSessionEndpoints,
|
|
85
|
+
)
|
|
56
86
|
from graphdatascience.procedure_surface.api.centrality.pagerank_endpoints import (
|
|
57
87
|
PageRankEndpoints,
|
|
58
88
|
PageRankMutateResult,
|
|
59
89
|
PageRankStatsResult,
|
|
60
90
|
PageRankWriteResult,
|
|
61
91
|
)
|
|
92
|
+
from graphdatascience.procedure_surface.api.centrality.pagerank_session_endpoints import (
|
|
93
|
+
PageRankSessionEndpoints,
|
|
94
|
+
)
|
|
62
95
|
|
|
63
96
|
__all__ = [
|
|
64
97
|
"ArticleRankEndpoints",
|
|
65
98
|
"ArticleRankMutateResult",
|
|
99
|
+
"ArticleRankSessionEndpoints",
|
|
66
100
|
"ArticleRankStatsResult",
|
|
67
101
|
"ArticleRankWriteResult",
|
|
68
102
|
"ArticulationPointsEndpoints",
|
|
69
103
|
"ArticulationPointsMutateResult",
|
|
104
|
+
"ArticulationPointsSessionEndpoints",
|
|
70
105
|
"ArticulationPointsStatsResult",
|
|
71
106
|
"ArticulationPointsWriteResult",
|
|
72
107
|
"BetweennessEndpoints",
|
|
73
108
|
"BetweennessMutateResult",
|
|
109
|
+
"BetweennessSessionEndpoints",
|
|
74
110
|
"BetweennessStatsResult",
|
|
75
111
|
"BetweennessWriteResult",
|
|
76
112
|
"BridgesEndpoints",
|
|
113
|
+
"BridgesSessionEndpoints",
|
|
77
114
|
"CelfEndpoints",
|
|
78
115
|
"CelfMutateResult",
|
|
116
|
+
"CelfSessionEndpoints",
|
|
79
117
|
"CelfStatsResult",
|
|
80
118
|
"CelfWriteResult",
|
|
81
119
|
"ClosenessEndpoints",
|
|
82
120
|
"ClosenessHarmonicEndpoints",
|
|
83
121
|
"ClosenessHarmonicMutateResult",
|
|
122
|
+
"ClosenessHarmonicSessionEndpoints",
|
|
84
123
|
"ClosenessHarmonicStatsResult",
|
|
85
124
|
"ClosenessHarmonicWriteResult",
|
|
86
125
|
"ClosenessMutateResult",
|
|
126
|
+
"ClosenessSessionEndpoints",
|
|
87
127
|
"ClosenessStatsResult",
|
|
88
128
|
"ClosenessWriteResult",
|
|
89
129
|
"DegreeEndpoints",
|
|
90
130
|
"DegreeMutateResult",
|
|
131
|
+
"DegreeSessionEndpoints",
|
|
91
132
|
"DegreeStatsResult",
|
|
92
133
|
"DegreeWriteResult",
|
|
93
134
|
"EigenvectorEndpoints",
|
|
94
135
|
"EigenvectorMutateResult",
|
|
136
|
+
"EigenvectorSessionEndpoints",
|
|
95
137
|
"EigenvectorStatsResult",
|
|
96
138
|
"EigenvectorWriteResult",
|
|
97
139
|
"HitsEndpoints",
|
|
98
140
|
"HitsMutateResult",
|
|
141
|
+
"HitsSessionEndpoints",
|
|
99
142
|
"HitsStatsResult",
|
|
100
143
|
"HitsWriteResult",
|
|
101
144
|
"PageRankEndpoints",
|
|
102
145
|
"PageRankMutateResult",
|
|
146
|
+
"PageRankSessionEndpoints",
|
|
103
147
|
"PageRankStatsResult",
|
|
104
148
|
"PageRankWriteResult",
|
|
105
149
|
]
|
|
@@ -57,7 +57,7 @@ class ArticleRankEndpoints(ABC):
|
|
|
57
57
|
|
|
58
58
|
- A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE')
|
|
59
59
|
- A dictionary with scaler configuration (e.g., {'type': 'Log', 'offset': 1.0})
|
|
60
|
-
-
|
|
60
|
+
- A :class:`~graphdatascience.procedure_surface.api.catalog.scaler_config.ScalerConfig` instance
|
|
61
61
|
relationship_types
|
|
62
62
|
Filter the graph using the given relationship types. Relationships with any of the given types will be included.
|
|
63
63
|
node_labels
|
|
@@ -127,7 +127,7 @@ class ArticleRankEndpoints(ABC):
|
|
|
127
127
|
|
|
128
128
|
- A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE')
|
|
129
129
|
- A dictionary with scaler configuration (e.g., {'type': 'Log', 'offset': 1.0})
|
|
130
|
-
-
|
|
130
|
+
- A :class:`~graphdatascience.procedure_surface.api.catalog.scaler_config.ScalerConfig` instance
|
|
131
131
|
relationship_types
|
|
132
132
|
Filter the graph using the given relationship types. Relationships with any of the given types will be included.
|
|
133
133
|
node_labels
|
|
@@ -183,7 +183,7 @@ class ArticleRankEndpoints(ABC):
|
|
|
183
183
|
G
|
|
184
184
|
Graph object to use
|
|
185
185
|
damping_factor
|
|
186
|
-
|
|
186
|
+
Probability of a jump to a random node.
|
|
187
187
|
tolerance
|
|
188
188
|
Minimum change in scores between iterations.
|
|
189
189
|
max_iterations
|
|
@@ -193,7 +193,7 @@ class ArticleRankEndpoints(ABC):
|
|
|
193
193
|
|
|
194
194
|
- A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE')
|
|
195
195
|
- A dictionary with scaler configuration (e.g., {'type': 'Log', 'offset': 1.0})
|
|
196
|
-
-
|
|
196
|
+
- A :class:`~graphdatascience.procedure_surface.api.catalog.scaler_config.ScalerConfig` instance
|
|
197
197
|
relationship_types
|
|
198
198
|
Filter the graph using the given relationship types. Relationships with any of the given types will be included.
|
|
199
199
|
node_labels
|
|
@@ -267,7 +267,7 @@ class ArticleRankEndpoints(ABC):
|
|
|
267
267
|
|
|
268
268
|
- A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE')
|
|
269
269
|
- A dictionary with scaler configuration (e.g., {'type': 'Log', 'offset': 1.0})
|
|
270
|
-
-
|
|
270
|
+
- A :class:`~graphdatascience.procedure_surface.api.catalog.scaler_config.ScalerConfig` instance
|
|
271
271
|
relationship_types
|
|
272
272
|
Filter the graph using the given relationship types. Relationships with any of the given types will be included.
|
|
273
273
|
node_labels
|
|
@@ -319,7 +319,7 @@ class ArticleRankEndpoints(ABC):
|
|
|
319
319
|
G
|
|
320
320
|
Graph object to use or a dictionary representing the graph dimensions.
|
|
321
321
|
damping_factor
|
|
322
|
-
|
|
322
|
+
Probability of a jump to a random node.
|
|
323
323
|
tolerance
|
|
324
324
|
Minimum change in scores between iterations.
|
|
325
325
|
max_iterations
|
|
@@ -329,7 +329,7 @@ class ArticleRankEndpoints(ABC):
|
|
|
329
329
|
|
|
330
330
|
- A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE')
|
|
331
331
|
- A dictionary with scaler configuration (e.g., {'type': 'Log', 'offset': 1.0})
|
|
332
|
-
-
|
|
332
|
+
- A :class:`~graphdatascience.procedure_surface.api.catalog.scaler_config.ScalerConfig` instance
|
|
333
333
|
relationship_types
|
|
334
334
|
Filter the graph using the given relationship types. Relationships with any of the given types will be included.
|
|
335
335
|
node_labels
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from abc import abstractmethod
|
|
4
|
+
|
|
5
|
+
from graphdatascience.graph.graph_api import Graph
|
|
6
|
+
from graphdatascience.procedure_surface.api.catalog.scaler_config import ScalerConfig
|
|
7
|
+
from graphdatascience.procedure_surface.api.centrality.articlerank_endpoints import ArticleRankEndpoints
|
|
8
|
+
from graphdatascience.procedure_surface.api.default_values import ALL_LABELS, ALL_TYPES
|
|
9
|
+
from graphdatascience.procedure_surface.api.job_handle import JobHandle
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ArticleRankSessionEndpoints(ArticleRankEndpoints):
|
|
13
|
+
"""Article Rank endpoints as exposed by a GDS Session."""
|
|
14
|
+
|
|
15
|
+
@abstractmethod
|
|
16
|
+
def compute(
|
|
17
|
+
self,
|
|
18
|
+
G: Graph,
|
|
19
|
+
*,
|
|
20
|
+
damping_factor: float = 0.85,
|
|
21
|
+
tolerance: float = 1.0e-7,
|
|
22
|
+
max_iterations: int = 20,
|
|
23
|
+
scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE",
|
|
24
|
+
relationship_types: list[str] = ALL_TYPES,
|
|
25
|
+
node_labels: list[str] = ALL_LABELS,
|
|
26
|
+
sudo: bool = False,
|
|
27
|
+
log_progress: bool = True,
|
|
28
|
+
username: str | None = None,
|
|
29
|
+
concurrency: int | None = None,
|
|
30
|
+
job_id: str | None = None,
|
|
31
|
+
relationship_weight_property: str | None = None,
|
|
32
|
+
source_nodes: int | list[int] | list[tuple[int, float]] | None = None,
|
|
33
|
+
) -> JobHandle:
|
|
34
|
+
"""
|
|
35
|
+
Starts the computation as a job and returns a handle to it.
|
|
36
|
+
|
|
37
|
+
The computation runs without materializing its result. Use the returned handle to
|
|
38
|
+
mutate, write or stream the result afterwards.
|
|
39
|
+
|
|
40
|
+
Parameters
|
|
41
|
+
----------
|
|
42
|
+
G
|
|
43
|
+
Graph object to use
|
|
44
|
+
damping_factor
|
|
45
|
+
Probability of a jump to a random node.
|
|
46
|
+
tolerance
|
|
47
|
+
Minimum change in scores between iterations.
|
|
48
|
+
max_iterations
|
|
49
|
+
Maximum number of iterations to run.
|
|
50
|
+
scaler
|
|
51
|
+
The scaler to use. Can be: - A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE') - A dictionary with scaler configuration (e.g., {'type': 'Log', 'offset': 1.0}) - A :class:`~graphdatascience.procedure_surface.api.catalog.scaler_config.ScalerConfig` instance
|
|
52
|
+
relationship_types
|
|
53
|
+
Filter the graph using the given relationship types. Relationships with any of the given types will be included.
|
|
54
|
+
node_labels
|
|
55
|
+
Filter the graph using the given node labels. Nodes with any of the given labels will be included.
|
|
56
|
+
sudo
|
|
57
|
+
Disable the memory guard.
|
|
58
|
+
log_progress
|
|
59
|
+
Display progress logging.
|
|
60
|
+
username
|
|
61
|
+
As an administrator, impersonate a different user for accessing their graphs.
|
|
62
|
+
concurrency
|
|
63
|
+
Number of concurrent threads to use.
|
|
64
|
+
job_id
|
|
65
|
+
Identifier for the computation.
|
|
66
|
+
relationship_weight_property
|
|
67
|
+
Name of the property to be used as weights.
|
|
68
|
+
source_nodes
|
|
69
|
+
node ids to use as starting points. Can be: - single node id (e.g., 42) - list of node id (e.g., [42, 43, 44]) - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)])
|
|
70
|
+
|
|
71
|
+
Returns
|
|
72
|
+
-------
|
|
73
|
+
JobHandle
|
|
74
|
+
Handle to the started computation
|
|
75
|
+
"""
|
|
76
|
+
pass
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from abc import abstractmethod
|
|
4
|
+
|
|
5
|
+
from graphdatascience.graph.graph_api import Graph
|
|
6
|
+
from graphdatascience.procedure_surface.api.centrality.articulationpoints_endpoints import (
|
|
7
|
+
ArticulationPointsEndpoints,
|
|
8
|
+
)
|
|
9
|
+
from graphdatascience.procedure_surface.api.default_values import ALL_LABELS, ALL_TYPES
|
|
10
|
+
from graphdatascience.procedure_surface.api.job_handle import JobHandle
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ArticulationPointsSessionEndpoints(ArticulationPointsEndpoints):
|
|
14
|
+
"""ArticulationPoints endpoints as exposed by a GDS Session."""
|
|
15
|
+
|
|
16
|
+
@abstractmethod
|
|
17
|
+
def compute(
|
|
18
|
+
self,
|
|
19
|
+
G: Graph,
|
|
20
|
+
*,
|
|
21
|
+
relationship_types: list[str] = ALL_TYPES,
|
|
22
|
+
node_labels: list[str] = ALL_LABELS,
|
|
23
|
+
sudo: bool = False,
|
|
24
|
+
log_progress: bool = True,
|
|
25
|
+
username: str | None = None,
|
|
26
|
+
concurrency: int | None = None,
|
|
27
|
+
job_id: str | None = None,
|
|
28
|
+
) -> JobHandle:
|
|
29
|
+
"""
|
|
30
|
+
Starts the computation as a job and returns a handle to it.
|
|
31
|
+
|
|
32
|
+
The computation runs without materializing its result. Use the returned handle to
|
|
33
|
+
mutate, write or stream the result afterwards.
|
|
34
|
+
|
|
35
|
+
Parameters
|
|
36
|
+
----------
|
|
37
|
+
G
|
|
38
|
+
Graph object to use
|
|
39
|
+
relationship_types
|
|
40
|
+
Filter the graph using the given relationship types. Relationships with any of the given types will be included.
|
|
41
|
+
node_labels
|
|
42
|
+
Filter the graph using the given node labels. Nodes with any of the given labels will be included.
|
|
43
|
+
sudo
|
|
44
|
+
Disable the memory guard.
|
|
45
|
+
log_progress
|
|
46
|
+
Display progress logging.
|
|
47
|
+
username
|
|
48
|
+
As an administrator, impersonate a different user for accessing their graphs.
|
|
49
|
+
concurrency
|
|
50
|
+
Number of concurrent threads to use.
|
|
51
|
+
job_id
|
|
52
|
+
Identifier for the computation.
|
|
53
|
+
|
|
54
|
+
Returns
|
|
55
|
+
-------
|
|
56
|
+
JobHandle
|
|
57
|
+
Handle to the started computation
|
|
58
|
+
"""
|
|
59
|
+
pass
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from abc import abstractmethod
|
|
4
|
+
|
|
5
|
+
from graphdatascience.graph.graph_api import Graph
|
|
6
|
+
from graphdatascience.procedure_surface.api.centrality.betweenness_endpoints import (
|
|
7
|
+
BetweennessEndpoints,
|
|
8
|
+
)
|
|
9
|
+
from graphdatascience.procedure_surface.api.default_values import ALL_LABELS, ALL_TYPES
|
|
10
|
+
from graphdatascience.procedure_surface.api.job_handle import JobHandle
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class BetweennessSessionEndpoints(BetweennessEndpoints):
|
|
14
|
+
"""Betweenness endpoints as exposed by a GDS Session."""
|
|
15
|
+
|
|
16
|
+
@abstractmethod
|
|
17
|
+
def compute(
|
|
18
|
+
self,
|
|
19
|
+
G: Graph,
|
|
20
|
+
*,
|
|
21
|
+
sampling_size: int | None = None,
|
|
22
|
+
sampling_seed: int | None = None,
|
|
23
|
+
relationship_types: list[str] = ALL_TYPES,
|
|
24
|
+
node_labels: list[str] = ALL_LABELS,
|
|
25
|
+
sudo: bool = False,
|
|
26
|
+
log_progress: bool = True,
|
|
27
|
+
username: str | None = None,
|
|
28
|
+
concurrency: int | None = None,
|
|
29
|
+
job_id: str | None = None,
|
|
30
|
+
relationship_weight_property: str | None = None,
|
|
31
|
+
) -> JobHandle:
|
|
32
|
+
"""
|
|
33
|
+
Starts the computation as a job and returns a handle to it.
|
|
34
|
+
|
|
35
|
+
The computation runs without materializing its result. Use the returned handle to
|
|
36
|
+
mutate, write or stream the result afterwards.
|
|
37
|
+
|
|
38
|
+
Parameters
|
|
39
|
+
----------
|
|
40
|
+
G
|
|
41
|
+
Graph object to use
|
|
42
|
+
sampling_size
|
|
43
|
+
Number of source nodes to consider for computing centrality scores.
|
|
44
|
+
sampling_seed
|
|
45
|
+
Seed value for the random number generator that selects source nodes.
|
|
46
|
+
relationship_types
|
|
47
|
+
Filter the graph using the given relationship types. Relationships with any of the given types will be included.
|
|
48
|
+
node_labels
|
|
49
|
+
Filter the graph using the given node labels. Nodes with any of the given labels will be included.
|
|
50
|
+
sudo
|
|
51
|
+
Disable the memory guard.
|
|
52
|
+
log_progress
|
|
53
|
+
Display progress logging.
|
|
54
|
+
username
|
|
55
|
+
As an administrator, impersonate a different user for accessing their graphs.
|
|
56
|
+
concurrency
|
|
57
|
+
Number of concurrent threads to use.
|
|
58
|
+
job_id
|
|
59
|
+
Identifier for the computation.
|
|
60
|
+
relationship_weight_property
|
|
61
|
+
Name of the property to be used as weights.
|
|
62
|
+
|
|
63
|
+
Returns
|
|
64
|
+
-------
|
|
65
|
+
JobHandle
|
|
66
|
+
Handle to the started computation
|
|
67
|
+
"""
|
|
68
|
+
pass
|