Home Blog Attivio More on Triples and Graphs

One of the follow-up questions I've received regarding the post on Triples and Graphs concerns using the GRAPH operator to identify nodes in a graph who are within a certain number of links (edges) to another node. This is a typically important use case, especially when dealing with social networks, and you want to find a list of people who are one or two nodes away from a specific person.

The answer is that the GRAPH operator does support this type of querying. Let's update the graph from the last post to add a few more "knows" links:

GRAPH Data Sample

If we want to find all the people Bob knows, we can query it like so:

GRAPH(name:Bob, ON="knows=entityId")

This returns Peter, Henry and Steve. Steve is included only because he knows Henry, and Henry knows Bob.
If this definition of "knows" is too broad, we can rewrite the query to find only people who Joe knows himself, as follows:

GRAPH(name:Bob, ON="knows=entityId", depth=1)

This returns Peter and Henry only, as they are one link away. Steve is two links away and so is not returned in the result set.

Perhaps we want to find people up to three links away, but give a relevancy boost to those one link away in the result list:

BOOST(GRAPH(name:Bob, ON="knows=entityId", depth=3), 
GRAPH(name:Bob, ON="knows=entityId", depth=1))

This would return Peter and Henry, first, each one link away from Bob, then Steve, who is two links away.

The GRAPH operator makes it very easy to explore social relationships and create scenarios similar to the Oracle of Bacon. Government and law enforcement applications are easy to imagine. Social analytics significantly increase conversion rates in eBusiness as well.

Thanks for the great question!

Trackback(0)
Comments (0)add comment

Write comment
smaller | bigger

security image
Write the displayed characters


busy