everything which is not string is interpreted as TM content (AsTMa= notation)
function test (map $m) as map return {
forall [ $j (journal-paper) ]
return
{$j} (journal-paper)
bn: {$j/bn}
{$j/oc} # clone all url occurrences
{$j/in} # clone all internal occurrences
(was-published-in)
date : x-dates-{$j/in(publication-date)}
document : $j
{
forall $a [ (is-author-of)
opus : $j ] return
{$a/*} # clone the whole node
}
}evaluation context is now topic maps, it depends on the position whether variable are interpolated as items or as strings