Catalog Cypher 端点

class graphdatascience.procedure_surface.cypher.catalog.catalog_cypher_endpoints.CatalogCypherEndpoints
__new__(**kwargs)
construct(graph_name: str, nodes: DataFrame | list[DataFrame], relationships: DataFrame | list[DataFrame] | None = None, concurrency: int | None = None, undirected_relationship_types: list[str] | None = None) GraphV2

从节点和关系数据帧(DataFrames)列表构建图。

参数:
  • graph_name (str) – 要构建的图的名称

  • nodes (DataFrame | list[DataFrame]) –

    节点数据帧。数据帧应遵循以下模式:

    • nodeId 用于在整个数据帧中唯一标识节点

    • labels 用于以字符串列表形式指定节点标签(可选)

    • 其他列被视为节点属性

  • relationships (DataFrame | list[DataFrame] | None) –

    关系数据帧。数据帧应遵循以下模式:

    • sourceNodeId 用于标识关系的起始节点

    • targetNodeId 用于标识关系的结束节点

    • relationshipType 用于指定关系类型(可选)

    • 其他列被视为关系属性

  • concurrency (int | None) – 要使用的并发线程数。

  • undirected_relationship_types (list[str] | None) – 要视为无向关系的关系类型列表。

返回:

构建的图对象。

返回类型:

GraphV2

property datasets: DatasetEndpoints

用于将预定义数据集加载到图目录中的端点。

drop(G: GraphV2 | str, fail_if_missing: bool = True) GraphInfo | None

从图目录中删除一个图。

参数:
  • G (GraphV2 | str) – 要删除的图的对象或名称。

  • fail_if_missing (bool) – 若图缺失是否报错

返回:

包含节点计数等信息的 GraphV2 元数据对象。

返回类型:

GraphListResult

filter(G: GraphV2, graph_name: str, node_filter: str, relationship_filter: str, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True) GraphWithFilterResult

基于过滤表达式创建图的子图。

参数:
  • G (GraphV2) – 要使用的图对象

  • (str) (relationship_filter) – 要创建的子图名称

  • (str) – 节点的过滤表达式

  • (str) – 关系的过滤表达式

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • graph_name (str)

  • node_filter (str)

  • relationship_filter (str)

  • log_progress (bool)

返回:

包含过滤后的图对象以及图名称、节点数、关系数等信息的元组。

返回类型:

GraphWithFilterResult

generate(graph_name: str, node_count: int, average_degree: float, *, relationship_distribution: str | None = None, relationship_seed: int | None = None, relationship_property: RelationshipPropertySpec | None = None, orientation: str | None = None, allow_self_loops: bool | None = None, read_concurrency: int | None = None, job_id: str | None = None, sudo: bool = False, log_progress: bool = True, username: str | None = None) GraphWithGenerationStats

生成一个随机图并将其存储在图目录中。

参数:
  • graph_name (str) – 生成的图的名称。

  • node_count (int) – 生成图中的节点数量

  • average_degree (float) – 生成节点的平均出度

  • relationship_distribution (str | None, default=None) – 确定关系分布策略。

  • relationship_seed (int | None, default=None) – 用于生成确定性关系的种子值。

  • relationship_property (RelationshipPropertySpec | None, default=None) – 配置生成的关联属性。

  • orientation (str | None, default=None) – 指定生成关系的方向。

  • allow_self_loops (bool | None, default=None) – 图中的节点是否可以具有起始节点和结束节点相同的关系。

  • read_concurrency (int | None, default=None) – 图生成期间使用的并发线程/进程数。

  • job_id (str | None) – 计算任务的标识符。

  • sudo (bool) – 禁用内存保护。

  • log_progress (bool) – 显示进度日志。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含生成的图对象和包含生成统计信息的结果对象的元组。

返回类型:

GraphGenerationStats

get(graph_name: str) GraphV2

从图目录中检索图的句柄。

参数:

graph_name (str) – 图的名称。

返回:

该图的句柄。

返回类型:

GraphV2

list(G: GraphV2 | str | None = None) list[GraphInfoWithDegrees]

列出图目录中的图。

参数:

G (GraphV2 | str | None) – 用于过滤结果的 GraphV2 对象或名称。如果为 None,则列出所有图。

返回:

包含节点计数等信息的图元数据对象列表。

返回类型:

list[GraphInfoWithDegrees]

property node_labels: NodeLabelEndpoints

用于节点标签操作的端点。

property node_properties: NodePropertiesEndpoints

用于节点标签操作的端点。

property relationships: RelationshipsEndpoints

用于关系操作的端点。

property sample: GraphSamplingEndpoints

用于图采样的端点。

pydantic model graphdatascience.procedure_surface.cypher.catalog.GraphProjectResult
field graph_name: str
field node_count: int
field node_projection: dict[str, Any]
field project_millis: int
field relationship_count: int
field relationship_projection: dict[str, Any]
class graphdatascience.procedure_surface.cypher.catalog.GraphWithProjectResult

GraphWithProjectResult(graph, result)

static __new__(_cls, graph: GraphV2, result: GraphProjectResult)

创建 GraphWithProjectResult(graph, result) 的新实例

参数:
graph: GraphV2

字段编号 0 的别名

result: GraphProjectResult

字段编号 1 的别名

© . This site is unofficial and not affiliated with Neo4j, Inc.