查找时间段内一个顶点与其他顶点每天存在三条以上关系的顶点

请教大佬们一个 ngql 语句,最好是使用 MATCH 语句实现,以下是相关数据结构:

  • VERTEX
person(
  id, # person 的唯一属性字段,和 tag 的 id 是一样的,string 类型
)
room(
  id,# room 的唯一属性字段,和 tag 的 id 是一样的,string 类型
)
  • EDGE
# person_room 的 id 是 person.id --> room.id,rank 是 rzsj 的时间戳
person_room(
  rzsj, # 时间字段 datetime 类型
)

我现在需要NGQL,查询参数是 room 的 id,start_time(datetime类型),end_time(datetime类型);

  1. 在同一天与 3 个及以上不同 person 存在关系;
  2. 且在 start_time-end_time 时间段内,如果查询的 id 超过十天满足 ① 条件,就返回一个true,否则就返回 false

感觉你在干大事 :stuck_out_tongue_closed_eyes:

match (v1:room)-[e:person_room]-(v2:person) where id(v1) == "xxxxx" and e. rzsj > "2017-03-04 22:30:40.003000" and e. rzsj < "2023-03-04 22:30:40.003000" with distinct v2, DATE({year:datetime(e. rzsj).year, month:datetime(e. rzsj).month, day:datetime(e. rzsj).day}) as day with day,count(*) as cnt where cnt > 10 return day

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。