图程序

列出 Neo4j 图数据科学 Python 客户端 API 中的所有图程序。 这包括所有用于投影、删除和列出图的方法,以及用于处理节点或关系属性的方法。 这些都假设一个 GraphDataScience 对象作为 gds 可用。

gds.graph.construct(graph_name: str, nodes: DataFrame | List[DataFrame], relationships: DataFrame | List[DataFrame] | None = None, concurrency: int = 4, undirected_relationship_types: List[str] | None = None) Graph

使用提供的节点和关系数据帧在图目录中构造一个新的图。

gds.graph.get(graph_name: str) Graph

获取一个图对象,表示图目录中的图。

gds.alpha.graph.graphProperty.drop(G: Graph, graph_property: str, **config: Any) Series[Any]

从投影的图中移除一个图属性。

gds.alpha.graph.graphProperty.stream(G: Graph, graph_property: str, **config: Any) DataFrame

流式传输给定的图属性。

gds.alpha.graph.nodeLabel.mutate(G: Graph, node_label: str, **config: Any) Series[Any]
使用给定的节点标签 Mutates the in-memory graph with the given node Label. 内存图。

已弃用 since version 2.5.0: 自 GDS 服务器版本 2.5.0 以来,您应该使用端点 gds.graph.nodeLabel.mutate()

gds.alpha.graph.nodeLabel.write(G: Graph, node_label: str, **config: Any) Series[Any]
将给定的节点标签写入在线的 Neo4j 数据库。 Writes the given node Label to an online Neo4j database.

已弃用 since version 2.5.0: 自 GDS 服务器版本 2.5.0 以来,您应该使用端点 gds.graph.nodeLabel.write()

gds.beta.graph.export.csv(G: Graph, **config: Any) Series[Any]

将命名图导出到 CSV 文件。

已弃用 since version 2.5.0: 自 GDS 服务器版本 2.5.0 以来,您应该使用端点 gds.graph.export.csv()

gds.beta.graph.export.csv.estimate(G: Graph, **config: Any) Series[Any]

估计将命名图导出到 CSV 文件所需的磁盘空间。

自版本 2.5.0 起已弃用: 自 GDS 服务器版本 2.5.0 起,您应该使用端点 gds.graph.export.csv.estimate() 代替。

gds.beta.graph.generate(graph_name: str, node_count: int, average_degree: int, **config: Any) GraphCreateResult

计算一个随机图,并将存储在图目录中。

自版本 2.5.0 起已弃用: 自 GDS 服务器版本 2.5.0 起,您应该使用端点 gds.graph.generate() 代替。

gds.beta.graph.project.subgraph(graph_name: str, from_G: Graph, node_filter: str, relationship_filter: str, **config: Any) GraphCreateResult

将图投影过滤为目录中的命名子图投影,供算法使用。

自版本 2.5.0 起已弃用: 自 GDS 服务器版本 2.5.0 起,您应该使用端点 gds.graph.filter() 代替。

gds.beta.graph.relationships.stream(G: Graph, relationship_types: List[str] = ['*'], **config: Any) TopologyDataFrame

流式传输给定的关系源/目标对

自版本 2.5.0 起已弃用: 自 GDS 服务器版本 2.5.0 起,您应该使用端点 gds.graph.relationships.stream() 代替。

gds.beta.graph.relationships.toUndirected(G: Graph, query: str, relationship_type: str, mutate_relationship_type: str, **config: Any) Series[Any]

ToUndirected 过程将有向关系转换为无向关系

自版本 2.5.0 起已弃用: 自 GDS 服务器版本 2.5.0 起,您应该使用端点 gds.graph.relationships.toUndirected() 代替。

gds.beta.graph.relationships.toUndirected.estimate(G: Graph, relationship_type: str, mutate_relationship_type: str, **config: Any) Series[Any]

返回该过程内存消耗的估计值。

自版本 2.5.0 起已弃用: 自 GDS 服务器版本 2.5.0 起,您应该使用端点 gds.graph.relationships.toUndirected.estimate() 代替。

gds.graph.cypher.project(query: str, database: str | None, **params: Any) GraphCreateResult

使用 Cypher 投影在目录中创建一个命名图,供算法使用。提供的查询必须以 RETURN gds.graph.project(…) 调用结束。

gds.graph.deleteRelationships(G: Graph, relationship_type: str) Series[Any]

删除存储在图目录中的给定图的关系类型。

gds.graph.drop(G: Graph, failIfMissing: bool = False, dbName: str = '', username: str | None = None) Series[Any] | None

从目录中删除命名图并释放它占用的资源。

gds.graph.exists(graph_name: str) Series[Any]

检查目录中是否存在图。

gds.graph.export(G: Graph, **config: Any) Series[Any]

将命名图导出到新的离线 Neo4j 数据库中。

gds.graph.export.csv(G: Graph, **config: Any) Series[Any]

将命名图导出到 CSV 文件。

gds.graph.export.csv.estimate(G: Graph, **config: Any) Series[Any]

估计将命名图导出到 CSV 文件所需的磁盘空间。

gds.graph.generate(graph_name: str, node_count: int, average_degree: int, **config: Any) GraphCreateResult

计算一个随机图,并将存储在图目录中。

gds.graph.graphProperty.drop(G: Graph, graph_property: str, **config: Any) Series[Any]

从投影的图中移除一个图属性。

gds.graph.graphProperty.stream(G: Graph, graph_property: str, **config: Any) DataFrame

流式传输给定的图属性。

gds.graph.list(G: Graph | None = None) DataFrame

列出存储在目录中的命名图的信息。

gds.graph.nodeProperties.drop(G: Graph, node_properties: List[str], **config: Any) Series[Any]

从投影图中删除节点属性。

gds.graph.nodeProperties.stream(G: Graph, node_properties: List[str], node_labels: Strings = ['*'], separate_property_columns: bool = False, db_node_properties: List[str] = [], **config: Any) DataFrame

流式传输给定的节点属性。

gds.graph.nodeProperties.write(G: Graph, node_properties: List[str], node_labels: Strings = ['*'], **config: Any) Series[Any]

将给定的节点属性写入在线 Neo4j 数据库。

gds.graph.nodeProperty.stream(G: Graph, node_properties: str, node_labels: Strings = ['*'], db_node_properties: List[str] = [], **config: Any) DataFrame

流式传输给定的节点属性。

gds.graph.project(graph_name: str, node_spec: Any, relationship_spec: Any, **config: Any) GraphCreateResult

在目录中创建一个名为图形的图形,供算法使用。

gds.graph.project.cypher(graph_name: str, node_spec: Any, relationship_spec: Any, **config: Any) GraphCreateResult

在目录中创建一个名为图形的图形,供算法使用。

gds.graph.project.cypher.estimate(node_projection: Any, relationship_projection: Any, **config: Any) Series[Any]

返回该过程内存消耗的估计值。

gds.graph.project.estimate(node_projection: Any, relationship_projection: Any, **config: Any) Series[Any]

返回该过程内存消耗的估计值。

gds.graph.project.subgraph(graph_name: str, from_G: Graph, node_filter: str, relationship_filter: str, **config: Any) GraphCreateResult

将图投影过滤为目录中的命名子图投影,供算法使用。

自版本 2.5.0 起已弃用: 自 GDS 服务器版本 2.5.0 起,您应该使用端点 gds.graph.filter() 代替。

gds.graph.relationships.stream(G: Graph, relationship_types: List[str] = ['*'], **config: Any) TopologyDataFrame

流式传输给定的关系源/目标对

gds.graph.relationships.toUndirected(G: Graph, query: str, relationship_type: str, mutate_relationship_type: str, **config: Any) Series[Any]

ToUndirected 过程将有向关系转换为无向关系

gds.graph.relationships.toUndirected.estimate(G: Graph, relationship_type: str, mutate_relationship_type: str, **config: Any) Series[Any]

返回该过程内存消耗的估计值。

gds.graph.relationship.write(G: Graph, relationship_type: str, relationship_property: str = '', **config: Any) Series[Any]

将给定的关系和可选的关系属性写入在线 Neo4j 数据库。

gds.graph.relationshipProperties.stream(G: Graph, relationship_properties: List[str], relationship_types: str | List[str] = ['*'], separate_property_columns: bool = False, **config: Any) DataFrame

流式传输给定的关系属性。

gds.graph.relationshipProperties.write(G: Graph, relationship_type: str, relationship_properties: List[str], **config: Any) DataFrame

将给定的关系属性写回数据库。

gds.graph.relationshipProperty.stream(G: Graph, node_properties: str, node_labels: str | List[str] = ['*'], **config: Any) DataFrame

流式传输给定的关系属性。

gds.graph.relationships.drop(G: Graph, relationship_type: str) Series[Any]

删除存储在图目录中的给定图的关系类型。

gds.graph.removeNodeProperties(G: Graph, node_properties: List[str], **config: Any) Series

从投影图中删除节点属性。

gds.graph.streamNodeProperties(G: Graph, node_properties: List[str], node_labels: Strings = ['*'], separate_property_columns: bool = False, **config: Any) DataFrame

流式传输给定的节点属性。

gds.graph.streamNodeProperty(G: Graph, node_properties: str, node_labels: Strings = ['*'], **config: Any) DataFrame

流式传输给定的节点属性。

gds.graph.streamRelationshipProperties(G: Graph, relationship_properties: List[str], relationship_types: Strings = ['*'], separate_property_columns: bool = False, **config: Any) DataFrame

流式传输给定的关系属性。

gds.graph.streamRelationshipProperty(G: Graph, relationship_properties: str, relationship_types: Strings = ['*'], **config: Any) DataFrame

流式传输给定的关系属性。

gds.graph.writeNodeProperties(G: Graph, node_properties: List[str], node_labels: Strings = ['*'], **config: Any) Series[Any]

将给定的节点属性写入在线 Neo4j 数据库。

gds.graph.writeRelationship(G: Graph, relationship_type: str, relationship_property: str = '', **config: Any) Series[Any]

将给定的关系和可选的关系属性写入在线 Neo4j 数据库。

gds.graph.load_cora(graph_name: str = 'cora', undirected: bool = False) Graph

将 Cora 数据集加载到目录中的命名图中,供算法使用。

gds.graph.load_karate_club(graph_name: str = 'karate_club', undirected: bool = False) Graph

将空手道俱乐部数据集加载到目录中的命名图中,供算法使用。

gds.graph.load_imdb(graph_name: str = 'imdb', undirected: bool = True) Graph

将 IMDB 数据集加载到目录中的命名图中,供算法使用。

gds.graph.load_lastfm(graph_name: str = 'lastfm', undirected: bool = True) Graph

将 LastFM 数据集加载到目录中的命名图中,供算法使用。

gds.graph.ogbn.load(dataset_name: str, dataset_root_path: str = 'dataset', graph_name: str | None = None, concurrency: int = 4) Graph

将 OGBN 数据集加载到目录中的命名图中,供算法使用。

gds.graph.ogbl.load(dataset_name: str, dataset_root_path: str = 'dataset', graph_name: str | None = None, concurrency: int = 4) Graph

将 OGBL 数据集加载到目录中的命名图中,供算法使用。

gds.graph.networkx.load(nx_G: nx.Graph, graph_name: str, concurrency: int = 4) Graph

将 NetworkX 图加载到目录中的命名图中,供算法使用。

gds.find_node_id(labels: List[str] = [], properties: Dict[str, Any] = {}) int

通过标签和属性查找节点 ID。

gds.graph.nodeLabel.mutate(G: Graph, node_label: str, **config: Any) Series[Any]
使用给定的节点标签 Mutates the in-memory graph with the given node Label. 内存图。
gds.graph.nodeLabel.write(G: Graph, node_label: str, **config: Any) Series[Any]
将给定的节点标签写入在线的 Neo4j 数据库。 Writes the given node Label to an online Neo4j database.
gds.filter(graph_name: str, from_G: Graph, node_filter: str, relationship_filter: str, **config: Any) GraphCreateResult

将图投影过滤为目录中的命名子图投影,供算法使用。