Graph Catalog

Graph algorithms run on a graph data model which is a projection of the Neo4j property graph data model. A graph projection can be seen as a materialized view over the stored graph, containing only analytically relevant, potentially aggregated, topological and property information. Graph projections are stored entirely in-memory using compressed data structures optimized for topology and property lookup operations.

The graph catalog is a concept within the GDS library that allows managing multiple graph projections by name. Using its name, a graph projection can be used many times in the analytical workflow. Named graphs can be projected using either a Native projection or a Cypher projection. After usage, named graphs can be removed from the catalog to free up main memory.

The graph catalog exists as long as the Neo4j instance is running. When Neo4j is restarted, graphs stored in the catalog are lost. See Backup and Restore to learn how to persist your graph projections.

This chapter explains the available graph catalog operations.

Table 1. Graph projections, adding additional graphs to the catalog:
Name Description

gds.graph.project

Adds a graph to the catalog using Native projection.

gds.graph.project.cypher

Adds a graph to the catalog using Cypher projection.

gds.alpha.graph.project

Adds a graph to the catalog using Cypher Aggregation.

gds.beta.graph.project.subgraph

Adds a graph to the catalog by filtering an existing graph using node and relationship predicates.

gds.alpha.graph.sample.rwr

Adds a graph to the catalog by sampling an existing graph using random walk with restarts.

gds.beta.graph.generate

Creates a new random graph projection of the user-defined properties and dimensions.

Table 2. Graph catalog inspection operations:
Name Description

gds.graph.list

Prints information about graphs that are currently stored in the catalog.

gds.graph.exists

Checks if a named graph is stored in the catalog.

Table 3. Graph catalog export operations:
Name Description

gds.graph.nodeProperty.stream

Streams a single node property stored in a named graph.

gds.graph.nodeProperties.stream

Streams node properties stored in a named graph.

gds.beta.graph.relationships.stream

Streams relationship topologies stored in a named graph.

gds.graph.relationshipProperty.stream

Streams a single relationship property stored in a named graph.

gds.graph.relationshipProperties.stream

Streams relationship properties stored in a named graph.

gds.graph.nodeProperties.write

Writes node properties stored in a named graph to Neo4j.

gds.graph.relationship.write

Writes relationships stored in a named graph to Neo4j.

gds.graph.export

Exports a named graph into a new offline Neo4j database.

gds.beta.graph.export.csv

Exports a named graph into CSV files.

Table 4. Graph catalog removal operations:
Name Description

gds.graph.drop

Drops a named graph from the catalog.

gds.graph.nodeProperties.drop

Removes node properties from a named graph.

gds.graph.relationships.drop

Deletes relationships of a given relationship type from a named graph.

Projecting, using, listing, and dropping named graphs are management operations bound to a Neo4j user. Graphs projected by a different Neo4j user are not accessible at any time.