Hello TigerGraph Team,

I need to find the number of common neighbors between any two vertex pairs of type “Car”. Then I want to add the number of common neighbors as an attribute to the edge SIMILAR_TO between vertices of type “Car”.

Here is my approach:

CREATE QUERY create_SIMILAR_TO() FOR GRAPH cbit_sna syntax v2 {

vertex common_v;

start = {Car.*};

res = select c from

start:s - () -:n - () - Car:c

where s != c

accum common_v = s.neighbors() INTERSECT c.neighbors();

insert into SIMILAR_TO (from, to, score) values (s Car, c Car, common_v.size());

print common_v.size();

}

The query returned null and inserted only one edge of type SIMILAR_TO was added. I don’t know how this was happening. Is there a way to fix this ? Or can someone propose an alternative to solve my problem? Thanks.