Hello, I started using Neo4j few days ago, I read all the
documentation but I still have few doubts.
I belive that what I'm trying to do is simple, but I'm having a hard
time figuring out how to do it.
I have nodes that represent articles and nodes that represent tags.
And I've 2 types of relations [article ---has_tags--> tag] and [tag --
has_article--> article].
What I want is, given a tag node, find all related tags, that are
those that share an article at first level (I did) or that has one or
more articles connecting them indirectly
tag ----> article ----> tag (first level) ----> article ---> tag ---
> ...
Finding the first tags was easy:
START tags=node(6)
MATCH tags-[:has_article]->article-[:has_tags]->related_tag
WHERE
tags.name !=
related_tag.name
RETURN
related_tag.name, COUNT(
related_tag.name)
I dont know how to travel deeper in the graph. I would like to some
how give more relevance to tags closer, but I could not even list tags
that are not direct linked by an article.
I tryed this (based on an example):
START tags=node(6)
MATCH tags-[:has_article*0..]->article-[:has_tags*0..]->related_tag
WHERE
tags.name !=
related_tag.name
RETURN
related_tag.name, COUNT(
related_tag.name)
but it was not what I expected...
Any help? please? =p