I'm learning to use Gremlin in Neo4j.
I have the following structure of tags: Sport - > (related) -> Football - > (related) -> Belgium.
At each Tag I have Feeds associated. At each Feed, I have several items feed (news) .
When I search the feeds of Sport, also want to pull all related to Football and Belgium (his related Tags).
With Cypher I get result with this query:
START tag=node(106949) MATCH tag-[:FILHA*1..10]->fof WITH fof MATCH fof-[:USA]->feeds RETURN feeds LIMIT 10;
With Gremlin I get all the tags related to the Sport tag with this:
x=[];g.v(106949).as("tagsFilha").out("FILHA").aggregate(x).loop("tagsFilha"){it.loops < 10}.iterate();x
With Gremlin could catch the news feeds of a tag ( Sport ) as follows:
g.v(startNode).out("USA").out("CONTEM").sort{it.qtde_visualizacoes}._()[0..10]
But above query didn't return news associated to related Tag. ex : Searching for Sport also get the news of Tag Belgium too (his related Tag).
Can anyone point me an reference?
thanks!