Implementing Apriori Algorithm with XQuery
-
Hi, I am trying to implement Apriori Algorithm(Mining Association Rules from XML Data) with XQuery. Unfortunately, I am not familiar with XQuery language. So, I need your help to fix the bug in the code given below
xquery version "1.0";
declare function apriori($l, $L, $minsup, $total, $src)
{
let $C := removeDuplicate(candidateGen($l))
let $l := getLargeItemsets($C, $minsup, $total, $src)
let $L := $l union $L
return if (empty($l)) then
$L
else
apriori($l, $L, $minsup, $total, $src)
}let $src := doc(/transactions.xml)//items
let $minsup := 0.4
let $total := count($src) * 1.00
let $C := distinct-values($src/*)
let $l :=(for $itemset in $C
let $items := (for $item in $src/*
where $itemset = $item
return $item)
let $sup := (count($items) * 1.00) div $total
where $sup >= $minsup
return {$itemset}
{$sup}
)
let $L := $l
return {apriori($l, $L,$minsup, $total, $src)}Error: [DataDirect][XQuery][err:XPST0003]Error at line 14, column 1. Expected ";", but encountered "let" Thanks for any help :)