New to cayley and have cannot figure out how to display a multi level query with unknown amount of levels.
For example Lets say all predicates/relations between nodes are "likes". If I have a graph shaped this way.
A --> B
B --> C
C --> D
D --> E
...
I would like to follow the train and display the entire likes graph. What query would I use? This is what I have tried.
function getLikes(x) {
return g.V(x).As("source").Out("likes").As("target)
}
getLikes("A").ForEach( function(d) {
g.Emit(getLikes(d))
})
This only returns
{
"result": [
{
"All": {},
"And": {},
"As": {},
"Back": {},
... And all other path options
I have also tried
return g.V(x).As("source").Out("likes").As("target).All()
Instead of the second line of code. Just added the .All() at the end to finalize the query. This returns query results, but the visualization tool shows nothing. Any guidance on how to show this like graph would be much appreciated!