Tag: Cayley

1 entry found

A Gremlin query for Cayley

A Gremlin query for Cayley

1 min read

From Cayley we can make queries via REST in two “languages”: MQL and a reduced version of Gremlin

With the following example, we can obtain the most common skills of people who belong to an industry, within the “Edu” sector

GitHub Gist
var c = { } ;
var x = graph.V("edu").In('in_sector').In('in_industry').Out('has_skill').Tag("id").ForEach(
function ( d ) {
if ( c[d.id] ) {
c[d.id] ++;
} else {
c[d.id] = 1 ;
}
d.count = c[d.id] ;
}
) ;
g.Emit( c ) ;