I'm new to Neo4j, and this is my first time posting. I'm trying to create a monopartite projection from a bipartite graph. I've only got two types of nodes:
My challenge is that I have a handful of different relationships. Some examples:
What I'm trying to do is
In other words, using the examples above:
I can find examples online that convert only one type of relationship to a monopartite but can't seem to get anything to work for multiple relationship or relationships that have an intervening node of a different type (i.e. two post nodes between an entity node). I've done the graph data science training and couldn't find exactly what I was looking for there either.
If you're using GDS for monopartite projections, you can write any arbitrary Cypher query for a node projection and a rel projection. This can navigate as many steps in whatever order you like.
You've already got the right patterns, abstracting a bit you might use this as a node projection:
MATCH (e:Entity) return id(e) as id
And this as a rel projection
MATCH (a:Entity)--(p:Post)--(b:Entity) RETURN id(a) as from, id(b) as to
Notice we're using blank, anonymous, un-ordered relationships
-- meaning we don't care the rel type, we don't care which direction. We just know these things are connected with something else (a post) in the middle
David: I have a slightly different situation where i want to project from a bipartite subgraph to a monopartite projection, where i want to avoid creating that monopartite on disk prior to projecting. Say on disk we have:
So a possible MATCH to set up the monopartite projection could be:
where s1.uuid <> s2.uuid
I'd like to project a monopartite graph for example:
Is this possible in GDS 2.1?