I'm using neo4j with wordnet to be able to calculate the similarity between words. However I'm not too good with cypher yet.
What I want is to be able to get the path between two nodes in a hierarchal pattern, but I need to know the ancestor in the middle of them. So if you consider this graph and assume each block is a word and we have the c node and b node already and want to get the path and for it to be able to return the ancestor node, a.
The query i was trying with was
MATCH
(synset:wdo#Synset
{id:"wn/100015568-n"}),
(synset1:wdo#Synset
{id:"wn/113957498-n"}),
path = shortestPath((synset)-[:wdo#hyponym
|wdo#hypernym
*]-(synset1))
return path
which got me the path but I can't get the shared ancestor from it. Any help would be appreciated thank you.