# use of a simple if statement which tests whether the list of collaborated papers is non-empty
function test (map $m) as list
function sharedAuthorship (string $a) as list return {
forall exists [ (is-author-of)
opus : $d
author : $a ]
and
exists [ (is-author-of)
opus : $d
author : $b ] in $m return
($b, $d)
}
return {
forall [ $p (person)
bn @ sort : $bn ] in $m return {
if fn:count (sharedAuthorship ($p)) = 0 then
{$bn}
}
}
function test (map $m) as list return
$m / is-author-of / author [ fn:count (. -> is-author-of) < 2 ] / bn