blob: 7dfe8176b11d5b3eaecd0ea5bcdbdbc8320a0bfa [file] [log] [blame]
alexander.behmc576c602012-07-06 02:41:15 +00001drop dataverse test if exists;
2create dataverse test;
3use dataverse test;
4
5create type DBLPType as closed {
6 id: int32,
7 dblpid: string,
8 title: string,
9 authors: string,
10 misc: string
11}
12
13create nodegroup group1 if not exists on nc1, nc2;
14
15create dataset DBLP(DBLPType)
ramangrover29669d8f62013-02-11 06:03:32 +000016 primary key id on group1;
alexander.behmc576c602012-07-06 02:41:15 +000017
18load dataset DBLP
19using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
20(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
21
22write output to nc1:"rttest/consolidate-complex-selects.aql";
23
24for $paper in dataset('DBLP')
25let $paper_tokens := word-tokens($paper.title)
26let $query_tokens := word-tokens("Transactions for Cooperative Environments")
27let $jacca := similarity-jaccard-check($paper_tokens, $query_tokens, 0.8f)
28let $jaccb := similarity-jaccard-check($paper_tokens, $query_tokens, 0.5f)
29let $jaccc := similarity-jaccard-check($paper_tokens, $query_tokens, 0.3f)
30where $jacca[0] and $jaccb[0] and $paper.authors = "testauth" and $jaccc
31return {"Paper": $paper_tokens, "Query": $query_tokens }