maxkernbach / ZapierTest

0 stars 0 forks source link

arangodb select all where timestamp to build relation graph #19

Closed maxkernbach closed 4 years ago

maxkernbach commented 7 years ago

https://stackoverflow.com/questions/45651018/arangodb-select-all-where-timestamp-to-build-relation-graphI try to build relations graph based on social media content using ArangoDB. currently i have these document type collections :

content

user

and these edge type collections

comment

post

post_mentions

user_mentions

repost

each edge data collections is using _from and _to from content and user collection, for example, in my post collection, _from key is from user and _to key is from content (user to content), and so on for the others edge collection

my goal is simply to get all node and edge where timestamp is provided as filter value, and build a graph from it.

i'm aware of this documentation , which stated that graph traversal to follow edges connected to a start vertex, up to a variable depth. but in my case, i would like to do it without start vertex, rather using timestamp as filter value. is this possible?

currently, this is what i got so far for query with start vertex :

with user, content FOR node, edge, path IN 0..10

ANY 'user/twitter_xxx'

post,

repost,

comment,

user_mention,

post_mention

OPTIONS {uniqueEdges: "path"}

LIMIT 0,100

RETURN path

and this is my sample document data :

{

"created_at": 1502335201000,

"emotions": [

"neutral"

],

"hashtags": [],

"id": "xxx",

"inserted_at": "Fri Aug 11 01:29:08 WIB 2017",

"language": "id",

"media": [],

"media_type": "twitter",

"mentions": [],

"origin_id": "twitter_xxx",

"sentiment": 0,

"text": "Some text from twitter post",

"type": "twitter_post",

"user_id": "twitter_xxx"

}

i'm a bit confused to change it to using timestamp.

any help or pointer would be highly appreciated, thanks!