blob: f577c5292f1af8a7ee16187bd846747c85680e7f [file] [log] [blame]
genia.likes.science@gmail.com6d6aa8e2013-07-23 01:23:21 -07001drop dataverse twitter if exists;
2create dataverse twitter;
3use dataverse twitter;
4
5create type TweetbookEntry as open {
6 tweetid: string,
7 comment-text: string
8}
9
10create type TwitterUserType as open {
11 screen-name: string,
12 lang: string,
13 friends_count: int32,
14 statuses_count: int32,
15 name: string,
16 followers_count: int32
17}
18
19create type TweetMessageType as closed {
20 tweetid: string,
21 user: TwitterUserType,
22 sender-location: point?,
23 send-time: datetime,
24 referred-topics: {{ string }},
25 message-text: string
26}
27
28create dataset TweetMessages(TweetMessageType)
29primary key tweetid;
30
genia.likes.science@gmail.com1b30f3d2013-08-17 23:53:37 -070031create dataset TweetMessagesShifted(TweetMessageType)
32primary key tweetid;
33
genia.likes.science@gmail.com6d6aa8e2013-07-23 01:23:21 -070034load dataset TweetMessages using localfs
35(("path"="localhost://FULL_PATH/twm.adm"),("format"="adm"));
genia.likes.science@gmail.com1b30f3d2013-08-17 23:53:37 -070036
37insert into dataset TweetMessagesShifted
38(
39for $t in dataset TweetMessages return {
40 "tweetid" : $t.tweetid,
41 "user" : $t.user,
42 "sender-location" : create-point(get-x($t.sender-location), -1*get-y($t.sender-location)),
43 "send-time" : $t.send-time,
44 "referred-topics": $t.referred-topics,
45 "message-text": $t.message-text
46}
47);