Files
2026-01-23 17:03:45 +08:00

28 lines
716 B
Plaintext

#open database pgraph2;
#query meminit (1524);
#query p2 loadgraph;
# Queries the top 5 co-authors of publications of "Ralf Hartmut Gueting"
# The results will be grouped and show the Authors with the sum of
# joint publications.
# The last optional argument forces to choose the doc node as start point.
# This will take a lot longer than match2-coauthors as this verson uses an index
# to find a startnode.
query p2
match2 ['
(
( a2 ( (Name "Ralf Hartmut Gueting") ))
( a )
(doc Document)
(a2 AUTHOR_OF doc)
(a AUTHOR_OF doc)
)',
'( ((a Name) <> "Ralf Hartmut Gueting") ) ',
'( ((a Name) Name) )'
,'doc']
sortby[Name] groupby[Name; Cnt:group count] sortby[Cnt:desc] head[5] consume;