use dataverse demo_aql; | |
declare type DBLPType as open { | |
id: int32, | |
dblpid: string, | |
title: string, | |
authors: string, | |
misc: string | |
} | |
declare nodegroup group1 on nc1, nc2; | |
declare dataset DBLP(DBLPType) | |
primary key id on group1; | |
write output to nc1:"/tmp/110-self-join-dblp.adm"; | |
set simthreshold '.5f'; | |
for $k in ( | |
for $i in dataset('DBLP') | |
for $j in dataset('DBLP') | |
where $i.title ~= $j.title | |
order by $i.id, $j.id | |
return {'dblp1': $i, 'dblp2': $j} | |
) | |
where $k.dblp1.id < $k.dblp2.id | |
return $k |