Aggregating edges based on the source & target vertex attributes

vishnu gajendran <ggvis...@...>


I request your help regarding the janus graph query which I am trying to construct. Let's consider the following graph where each vertex denotes a person and the edge between any two vertex denotes collaboration between them.

p1 = graph.addVertex('person')'personId', 1)'organization', "engineering")

p2 = graph.addVertex('person')'personId', 2)'organization', "sales")

p3 = graph.addVertex('person')'personId', 3)'organization', "marketing")

p4 = graph.addVertex('person')'personId', 4)'organization', "engineering")

p1.addEdge('collaboration', p2, 'collaborationHours', 1)
p1.addEdge('collaboration', p3, 'collaborationHours', 2)

p2.addEdge('collaboration', p3, 'collaborationHours', 2)

p3.addEdge('collaboration', p4, ' collaborationHours', 2)

p4.addEdge('collaboration', p2, ' collaborationHours', 2)

Expected Result is the following table:

Organization1  Organization2 Total Collaboration Hours
Engineering      Sales                 4
Engineering      Marketing         2
Sales                 Marketing          2
Marketing         Engineering       2

Here, I am trying to aggregate the "person to person" graph into "organization to organization" graph. Does JanusGraph support such aggregation queries? If yes, can you please help me with the query for the same?


Join { to automatically receive all group messages.