genia.likes.science@gmail.com | 6d6aa8e | 2013-07-23 01:23:21 -0700 | [diff] [blame] | 1 | drop dataverse twitter if exists; |
| 2 | create dataverse twitter; |
| 3 | use dataverse twitter; |
| 4 | |
| 5 | create type TweetbookEntry as open { |
| 6 | tweetid: string, |
| 7 | comment-text: string |
| 8 | } |
| 9 | |
| 10 | create 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 | |
| 19 | create 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 | |
| 28 | create dataset TweetMessages(TweetMessageType) |
| 29 | primary key tweetid; |
| 30 | |
genia.likes.science@gmail.com | 1b30f3d | 2013-08-17 23:53:37 -0700 | [diff] [blame] | 31 | create dataset TweetMessagesShifted(TweetMessageType) |
| 32 | primary key tweetid; |
| 33 | |
genia.likes.science@gmail.com | 6d6aa8e | 2013-07-23 01:23:21 -0700 | [diff] [blame] | 34 | load dataset TweetMessages using localfs |
| 35 | (("path"="localhost://FULL_PATH/twm.adm"),("format"="adm")); |
genia.likes.science@gmail.com | 1b30f3d | 2013-08-17 23:53:37 -0700 | [diff] [blame] | 36 | |
| 37 | insert into dataset TweetMessagesShifted |
| 38 | ( |
| 39 | for $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 | ); |