Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def generate(
Number of concurrent threads/processes to use during graph generation.
job_id : str | None, default=None
Unique identifier for the job associated with the graph generation.
sudo : bool | None, default=None
sudo : bool
Override memory estimation limits
log_progress : bool | None, default=None
Whether to log progress during graph generation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from graphdatascience.procedure_surface.api.base_result import BaseResult
from graphdatascience.procedure_surface.api.catalog.graph_api import GraphV2
from graphdatascience.procedure_surface.api.default_values import ALL_LABELS, ALL_TYPES


class GraphSamplingEndpoints(ABC):
Expand All @@ -19,13 +20,13 @@ def rwr(
G: GraphV2,
graph_name: str,
start_nodes: list[int] | None = None,
restart_probability: float | None = None,
sampling_ratio: float | None = None,
node_label_stratification: bool | None = None,
restart_probability: float = 0.1,
sampling_ratio: float = 0.15,
node_label_stratification: bool = False,
relationship_weight_property: str | None = None,
relationship_types: list[str] | None = None,
node_labels: list[str] | None = None,
sudo: bool | None = None,
relationship_types: list[str] = ALL_TYPES,
node_labels: list[str] = ALL_LABELS,
sudo: bool = False,
log_progress: bool = True,
username: str | None = None,
concurrency: int | None = None,
Expand Down Expand Up @@ -92,13 +93,13 @@ def cnarw(
G: GraphV2,
graph_name: str,
start_nodes: list[int] | None = None,
restart_probability: float | None = None,
sampling_ratio: float | None = None,
node_label_stratification: bool | None = None,
restart_probability: float = 0.1,
sampling_ratio: float = 0.15,
node_label_stratification: bool = False,
relationship_weight_property: str | None = None,
relationship_types: list[str] | None = None,
node_labels: list[str] | None = None,
sudo: bool | None = None,
relationship_types: list[str] = ALL_TYPES,
node_labels: list[str] = ALL_LABELS,
sudo: bool = False,
log_progress: bool = True,
username: str | None = None,
concurrency: int | None = None,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

from abc import ABC, abstractmethod
from typing import Any

from graphdatascience.procedure_surface.api.base_result import BaseResult
from graphdatascience.procedure_surface.api.catalog.graph_api import GraphV2
Expand All @@ -18,9 +17,9 @@ def mutate(
sudo: bool | None = None,
log_progress: bool = True,
username: str | None = None,
concurrency: Any | None = None,
write_concurrency: Any | None = None,
job_id: Any | None = None,
concurrency: int | None = None,
write_concurrency: int | None = None,
job_id: str | None = None,
) -> NodeLabelMutateResult:
"""
Attaches the specified node label to the filtered nodes in the graph.
Expand All @@ -33,17 +32,17 @@ def mutate(
The node label to write back.
node_filter : str
A Cypher predicate for filtering nodes in the input graph.
sudo : bool | None, default=None
sudo : bool
Override memory estimation limits
log_progress : bool | None, default=None
Whether to log progress
username : str | None, default=None
The username to attribute the procedure run to
concurrency : Any | None, default=None
concurrency : int | None, default=None
The number of concurrent threads
write_concurrency : Any | None, default=None
write_concurrency : int | None, default=None
The number of concurrent threads used for the mutation
job_id : Any | None, default=None
job_id : str | None, default=None
An identifier for the job
Returns
-------
Expand All @@ -62,9 +61,9 @@ def write(
sudo: bool | None = None,
log_progress: bool = True,
username: str | None = None,
concurrency: Any | None = None,
write_concurrency: Any | None = None,
job_id: Any | None = None,
concurrency: int | None = None,
write_concurrency: int | None = None,
job_id: str | None = None,
) -> NodeLabelWriteResult:
"""
Writes the specified node label to the filtered nodes in the database.
Expand All @@ -77,7 +76,7 @@ def write(
The node label to write back.
node_filter : str
A Cypher predicate for filtering nodes in the input graph.
sudo : bool | None, default=None
sudo : bool
Override memory estimation limits
log_progress : bool | None, default=None
Whether to log progress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from graphdatascience.procedure_surface.api.base_result import BaseResult
from graphdatascience.procedure_surface.api.catalog.graph_api import GraphV2
from graphdatascience.procedure_surface.api.default_values import ALL_LABELS


class NodePropertiesEndpoints(ABC):
Expand All @@ -18,12 +19,12 @@ def stream(
node_properties: str | list[str],
*,
list_node_labels: bool | None = None,
node_labels: list[str] | None = None,
concurrency: Any | None = None,
sudo: bool | None = None,
node_labels: list[str] = ALL_LABELS,
concurrency: int | None = None,
sudo: bool = False,
log_progress: bool = True,
username: str | None = None,
job_id: Any | None = None,
job_id: str | None = None,
db_node_properties: list[str] | None = None,
) -> DataFrame:
"""
Expand All @@ -37,11 +38,11 @@ def stream(
The node properties to stream
list_node_labels : boolean | None, default=None
Whether to include node labels in the stream
node_labels : list[str] | None, default=None
node_labels : list[str]
Filter by node labels
concurrency : Any | None, default=None
The number of concurrent threads
sudo : bool | None, default=None
sudo : bool
Override memory estimation limits
log_progress : bool | None, default=None
Whether to log progress
Expand All @@ -64,13 +65,13 @@ def write(
G: GraphV2,
node_properties: str | list[str] | dict[str, str],
*,
node_labels: list[str] | None = None,
concurrency: Any | None = None,
write_concurrency: Any | None = None,
sudo: bool | None = None,
node_labels: list[str] = ALL_LABELS,
concurrency: int | None = None,
write_concurrency: int | None = None,
sudo: bool = False,
log_progress: bool = True,
username: str | None = None,
job_id: Any | None = None,
job_id: str | None = None,
) -> NodePropertiesWriteResult:
"""
Writes the specified node properties from the graph to the database.
Expand All @@ -82,13 +83,13 @@ def write(
node_properties : str | list[str] | dict[str, str]
The node properties to write.
If a dictionary is provided, the keys are the property names and the values are the aliases that will be used as the property name in the database.
node_labels : list[str] | None, default=None
node_labels : list[str]
Filter by node labels
concurrency : Any | None, default=None
The number of concurrent threads
write_concurrency : Any | None, default=None
The number of concurrent threads used for writing
sudo : bool | None, default=None
sudo : bool
Override memory estimation limits
log_progress : bool | None, default=None
Whether to log progress
Expand All @@ -110,7 +111,7 @@ def drop(
node_properties: list[str],
*,
fail_if_missing: bool | None = None,
concurrency: Any | None = None,
concurrency: int | None = None,
username: str | None = None,
) -> NodePropertiesDropResult:
"""
Expand All @@ -124,7 +125,7 @@ def drop(
The node properties to drop
fail_if_missing: bool | None = None,
Whether to fail if any of the node properties are missing
concurrency : Any | None, default=None
concurrency : int | None = None
The number of concurrent threads
username : str | None, default=None
The username to attribute the procedure run to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@

from graphdatascience.procedure_surface.api.base_result import BaseResult
from graphdatascience.procedure_surface.api.catalog.graph_api import GraphV2
from graphdatascience.procedure_surface.api.default_values import ALL_TYPES


class RelationshipsEndpoints(ABC):
@abstractmethod
def stream(
self,
G: GraphV2,
relationship_types: list[str] | None = None,
relationship_types: list[str] = ALL_TYPES,
relationship_properties: list[str] | None = None,
*,
concurrency: Any | None = None,
sudo: bool | None = None,
concurrency: int | None = None,
sudo: bool = False,
log_progress: bool = True,
username: str | None = None,
) -> DataFrame:
Expand All @@ -36,11 +37,11 @@ def stream(
If not specified, all relationships in the graph will be streamed.
relationship_properties: list[str] | None, default = None
The relationship properties to stream. If not specified, no properties will be streamed.
concurrency : Any | None, default=None
concurrency : int | None, default=None
The number of concurrent threads
sudo : bool | None, default=None
sudo : bool
Override memory estimation limits
log_progress : bool | None, default=None
log_progress : bool = True
Whether to log progress
username : str | None, default=None
The username to attribute the procedure run to
Expand All @@ -58,12 +59,12 @@ def write(
relationship_type: str,
relationship_properties: list[str] | None = None,
*,
concurrency: Any | None = None,
write_concurrency: Any | None = None,
sudo: bool | None = None,
concurrency: int | None = None,
write_concurrency: int | None = None,
sudo: bool = False,
log_progress: bool = True,
username: str | None = None,
job_id: Any | None = None,
job_id: str | None = None,
) -> RelationshipsWriteResult:
"""
Writes all relationships of the specified relationship type with the specified properties from the graph to the database.
Expand All @@ -76,17 +77,17 @@ def write(
The relationship type to write to the database
relationship_properties: list[str] | None, default = None
The relationship properties to write. If not specified, no properties will be written.
concurrency : Any | None, default=None
concurrency : int | None, default=None
The number of concurrent threads
write_concurrency : Any | None, default=None
write_concurrency : int | None, default=None
The number of concurrent threads used for writing
sudo : bool | None, default=None
sudo : bool
Override memory estimation limits
log_progress : bool | None, default=None
Whether to log progress
username : str | None, default=None
The username to attribute the procedure run to
job_id : Any | None, default=None
job_id : str | None, default=None
An identifier for the job
Returns
-------
Expand Down Expand Up @@ -127,11 +128,11 @@ def index_inverse(
G: GraphV2,
relationship_types: list[str],
*,
concurrency: Any | None = None,
sudo: bool | None = None,
concurrency: int | None = None,
sudo: bool = False,
log_progress: bool = True,
username: str | None = None,
job_id: Any | None = None,
job_id: str | None = None,
) -> RelationshipsInverseIndexResult:
"""
Creates an index of the specified relationships indexing the reverse direction of each relationship.
Expand All @@ -141,17 +142,17 @@ def index_inverse(
----------
G : Graph
The graph to operate on
relationship_types: list[str] | None = None,
relationship_types: list[str] = ALL_TYPES,
The relationship types to create the inverse index for
concurrency : Any | None, default=None
concurrency : int | None, default=None
The number of concurrent threads
sudo : bool | None, default=None
sudo : bool = False,
Override memory estimation limits
log_progress : bool | None, default=None
log_progress : bool = True
Whether to log progress
username : str | None, default=None
The username to attribute the procedure run to
job_id : Any | None, default=None
job_id : str | None, default=None
An identifier for the job
Returns
-------
Expand All @@ -167,11 +168,11 @@ def to_undirected(
mutate_relationship_type: str,
*,
aggregation: Aggregation | dict[str, Aggregation] | None = None,
concurrency: Any | None = None,
sudo: bool | None = None,
concurrency: int | None = None,
sudo: bool = False,
log_progress: bool = True,
username: str | None = None,
job_id: Any | None = None,
job_id: str | None = None,
) -> RelationshipsToUndirectedResult:
"""
Creates a new relationship type in the graph.
Expand All @@ -189,15 +190,15 @@ def to_undirected(
Specifies how to aggregate parallel relationships in the graph.
If a single aggregation is provided, it will be used for properties of the specified relationships.
A dictionary can be provided to specify property specific aggregations.
concurrency : Any | None, default=None
concurrency : int | None, default=None
The number of concurrent threads
sudo : bool | None, default=None
sudo : bool = False,
Override memory estimation limits
log_progress : bool | None, default=None
log_progress : bool = True
Whether to log progress
username : str | None, default=None
The username to attribute the procedure run to
job_id : Any | None, default=None
job_id : str | None, default=None
An identifier for the job
Returns
-------
Expand Down
Loading