liveBook · Manning

Gds.graph.project

As explained in Graph Algorithms for Data Science

gds.graph.project is a Neo4j Graph Data Science procedure that creates and stores a named in-memory graph projection.

gds.graph.project creates and stores a named in-memory graph in the GDS graph catalog so graph algorithms can access a selected network. Native projection uses a CALL statement with a graph name, node projection, relationship projection, and optional configuration. section 5.2.1

Native projection defines the graph by selecting:

  • The graph name used when executing algorithms. section 5.2.1
  • The node subset, such as User nodes. section 5.2.1
  • The relationship subset, such as FOLLOWS relationships; relationships are skipped when either adjacent node is excluded. section 5.2.1
  • Optional node, relationship, and property configuration for richer or weighted networks. section 5.2.1

Project a followers network

CALL gds.graph.project('follower-network', 'User', 'FOLLOWS') creates a cataloged in-memory graph containing User nodes connected by FOLLOWS relationships. section 5.2.1

The same procedure also supports Cypher projection, which describes source and target nodes with Cypher and can filter, transform, or create virtual connections without first materializing them. This form uses gds.graph.project in a WITH or RETURN clause, is more expressive, and performs worse than native projection on larger or production graphs. section 6.1.1

Build a weighted retweet network

A Cypher projection matches publishing and retweet paths, counts each source-target connection as weight, and returns the projected graph. The amplify example contains 1,828 nodes and 2,719 relationships. section 6.1.1

Listing 5.4 Native projection syntax to create a named graph in the graph catalog
CALL gds.graph.project(
   graphName,
   nodeProjection,
   relationshipProjection,
   optional configuration
)

Use the syntax listing to inspect the procedure’s required arguments and optional configuration position. section 5.2.1

How Graph Algorithms for Data Science covers it

How deep it goes
Explains native and Cypher projection parameters, filtering behavior, properties, syntax, and performance trade-offs.
Examples
Uses a User-FOLLOWS followers network and a weighted amplify retweet network.
What it assumes
Assumes basic Cypher patterns and CALL usage while teaching projection parameters through concrete network examples.
What you can do after
Apply it via Neo4j Graph Data Science to create named in-memory graphs from selected nodes and relationships.
How it connects
Connects graph catalogs, in-memory graphs, native projection, Cypher projection, node projections, and relationship projections.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Algorithms for Data Science. The section links point to the parts of the book it draws on.