Create a native graph projection
Create a native graph projection representing
Users
ratingMovies
and ensure theRATED
relationship is undirected.
What is the relationship count of the native projection?
✓200008
CALL gds.graph.drop( 'userRatedMovies', false);
CALL gds.graph.project(
'userRatedMovies',
['User', 'Movie'],
{ RATED: { orientation: 'UNDIRECTED' } }
);
╒══════════════════════════════════════════════════════════════════════╤══════════════════════════════════════════════════════════════════════╤═════════════════╤═══════════╤═══════════════════╤═══════════════╕
│"nodeProjection" │"relationshipProjection" │"graphName" │"nodeCount"│"relationshipCount"│"projectMillis"│
╞══════════════════════════════════════════════════════════════════════╪══════════════════════════════════════════════════════════════════════╪═════════════════╪═══════════╪═══════════════════╪═══════════════╡
│{"Movie":{"label":"Movie","properties":{}},"User":{"label":"User","pro│{"RATED":{"orientation":"UNDIRECTED","aggregation":"DEFAULT","type":"R│"userRatedMovies"│9796 │200008 │13 │
│perties":{}}} │ATED","properties":{}}} │ │ │ │ │
└──────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────────────┴─────────────────┴───────────┴───────────────────┴───────────────┘
You can run the following Cypher statement to create the graph projection.
The statement returns a single value from the procedure call, relationshipCount
, which can be copied and pasted into the textbox above.
CALL gds.graph.project(
// Name of the projection
'user-rated-movie',
// Labels of nodes to include in the projection
['User', 'Movie'],
// Relationship types to include in the projection
{
RATED: {
type: 'RATED',
orientation: 'UNDIRECTED'
}
}
)
YIELD relationshipCount;
╒═══════════════════╕
│"relationshipCount"│
╞═══════════════════╡
│200008 │
└───────────────────┘