neo4j package

Reference page for the bluegraph.backends.neo4j package. All the interfaces below are also available as bluegraph.backends.neo4j.<interface> (for example, from bluegraph.backends.neo4j import Neo4jPathFinder).

Graph metrics

class bluegraph.backends.neo4j.analyse.metrics.Neo4jMetricProcessor(pgframe=None, uri=None, username=None, password=None, driver=None, node_label=None, edge_label=None, directed=True)

Class for metric processing based on Neso4j graphs.

betweenness_centrality(distance=None, write=False, write_property=None)

Compute (weighted) betweenness centrality.

closeness_centrality(distance=None, write=False, write_property=None)

Compute (weighted) closeness centrality.

degree_centrality(weight=None, write=False, write_property=None)

Compute (weighted) degree centrality.

pagerank_centrality(weight=None, write=False, write_property=None)

Compute (weighted) PageRank centrality.

Community Detection

class bluegraph.backends.neo4j.analyse.communities.Neo4jCommunityDetector(pgframe=None, uri=None, username=None, password=None, driver=None, node_label=None, edge_label=None, directed=True)

Neo4j-based community detection interface.

Currently supported community detection strategies for Neo4j:

  • Louvain algorithm (strategy=”louvain”)

  • Girvan–Newman algorithm (strategy=”girvan-newman”)

  • Label propagation (strategy=”lpa”)

  • Hierarchical clustering (strategy=”hierarchical”)

References

https://neo4j.com/docs/graph-data-science/current/algorithms/community/

detect_communities(strategy='louvain', weight=None, n_communities=2, intermediate=False, write=False, write_property=None, **kwargs)

Detect community partition using the input strategy.

Node embedding

class bluegraph.backends.neo4j.embed.embedders.Neo4jNodeEmbedder(model_name, directed=True, include_type=False, feature_props=None, feature_vector_prop=None, edge_weight=None, **model_params)
fit_model(pgframe=None, uri=None, username=None, password=None, driver=None, node_label=None, edge_label=None, graph_view=None, write=False, write_property=False)

Train specified model on the provided graph.

predict_embeddings(pgframe=None, uri=None, username=None, password=None, driver=None, node_label=None, edge_label=None, graph_view=None, write=False, write_property=False)

Predict embeddings of out-sample elements.