Query installation failed

Running the adjusted version of page_rank for a test graph (very small one) failed without any meaningful logs.

Start installing queries, about 1 minute …
pageRank_wt query: curl -X GET ‘[max_change=VALUE]&[max_iter=VALUE]&[damping=VALUE]&[result_attr=VALUE]&[display_edges=VALUE]’. Add -H “Authorization: Bearer TOKEN” if authentication is enabled.

[ ] 0% (0/1)
[ ] 0% (0/1) Query test_graph_pageRank_wt compilation failed!
Query installation failed!

gsql code:

CREATE QUERY pageRank_wt (FLOAT max_change=0.001, INT max_iter=25, FLOAT damping=0.85, STRING result_attr = “page_rank_score”, BOOL display_edges = FALSE) for Graph test_graph syntax V2{

HeapAccum<Vertex_Score>(top_k, score DESC) @@topScores;
MaxAccum<FLOAT> @@max_diff = 9999;    # max score change in an iteration
SumAccum<FLOAT> @recvd_score = 0; # sum of scores each vertex receives FROM neighbors
SumAccum<FLOAT> @score = 1;           # initial score for every vertex is 1.
SetAccum<EDGE> @@edgeSet;             # list of all edges, if display is needed
SumAccum<FLOAT> @total_wt;

Calculate the total weight for each vertex

Start = SELECT s
        FROM Company:s -((LINK>):e) - Company:t
        ACCUM s.@total_wt += e.weight;

PageRank iterations

                 # Start with all vertices of specified type(s)
WHILE @@max_diff > max_change LIMIT max_iter DO
		@@max_diff = 0;
		V = SELECT s
			FROM Start:s -((LINK>):e)- Company:t
			ACCUM t.@recvd_score += s.@score * e.weight/s.@total_wt
			POST-ACCUM s.@score = (1.0-damping) + damping * s.@recvd_score,
					   s.@recvd_score = 0,
					   @@max_diff += abs(s.@score - s.@score');

V = SELECT s FROM Start:s
		IF result_attr != "" THEN s.setAttr(result_attr, s.@score) END;


Graph schema: Company nodes, linked directed relationship between companies
gadmin status shows all green
running a free version of TG using docker on MAC

Hi yaakovtayeb,

Still going through the query fully, but do you have the Tuple Vertex_Score created already on your TigerGraph solution? I don’t see it here and that’s the first thing standing out to me. It also looks like you’re not using that heap accum currently, so it might be worth commenting out that line to see if the query will install.

I commented out both the heapaccum and the vertex_score but still same results.

any other ideA?

Hi All,

Apparently, the query failed due to “previous Accum value tic”.
In my code, it was this line:

@@max_diff += abs(s.@score - s.@score’);

changing the order of the lines to this:
POST-ACCUM @@max_diff += abs(s.@score - ((1.0-damping) + damping * s.@recvd_score)),
s.@score = (1.0-damping) + damping * s.@recvd_score,
s.@recvd_score = 0;

solved the problem.

Does anyone know why / when “previous value of Accum tic” won’t work?