H-i, I want to display a force directed graph using in D3. I'm trying to model it with Neo4j.
The requirements are to decorate "Topics" and "Edges" with "Attachments". Topics and Edges display in the D3 graph. Attachments in a detail view of a Topic or Edge.
This is the conceptual model (Topics and Edges graphed in D3):
(attach1) -> (topic1) --edge12--> (topic2) <--edge23-- (topic3) <- (attach2)
| | | |
(attach3) (attach4) (attach4) (attach5)
The simplest thing that doesn't seem to work is:
Topics -> Nodes
Edges -> Relationships
Attachments -> Nodes
Neo4j doesn't have "hyperedges", so this instead:
Topics -> Nodes
Edges -> Nodes that relate only to Topics
Attachments -> Nodes that relate to Topics and Edges
That's wonky, but workable. An alternative would be make an Edge property with Attachment Ids, but that seems messy.
The next requirement is to do "Multi-topic search", which is a list of shortest paths between 2+ Topics - but only over Topics and Edges.
I found these questions that give I don't completely grok, but seem to explain how to filter the results. They don't seem very performant for an OLAP.
Is there a better way to model this directed graph in Neo4j?
Is there a better way to do the filtered multi-node search?
Thanks!