I was wondering if it is possible to generate a single mode graph projection from a bipartite (2-mode) graph via a Cypher query?
e.g., http://upload.wikimedia.org/wikipedia/commons/f/f9/Bipartite_network_projection.png
So let's say I have text mining related data such as entities
(X) linked to documents (Y) in a neo4j graph database. And I want a query result set that links X's
to X's (for example) based on links to common Y's. Can such be done via a Cypher query sequence?
Thanks, Dan
--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks for info Michael. I believe that query will return the list of entities common to each document. What I’m really after is generating dynamically (via Cypher) a new graph result (relationships) comprised of only one node type derived from the underlying bipartite graph (two node types).
e.g.,
So if neo4j database includes links between entities and documents, I want to generate a new graph result that would just contain links between one entity type: entities to entities or documents to documents. These new dynamic (query time) links would be based on shared connections between entities and documents in the underlying graph database.
So if E1 is linked to D1 and D2, E2 is linked to D1, and E3 is linked to D3, a Cypher query would return:
1) 1) For a entity only graph result: E1 linked to E2 and E3 by itself.
2) 2) For a document only graph result: D1 linked to D2 and D3 by itself.
Thanks, Dan
MATCH (entity:Entity)-[:LINKS_TO]->(doc:Document)
FOREACH (e1 in entities | FOREACH (e2 in filter(e in entities WHERE id(e) > id(e1)) | CREATE (e1)-[:RELATED_TO]->(e2)))WITH doc, collect(entity) as entities