0

我已经安装了 graphaware 时间树,并尝试使用密码运行范围查询。下面的查询并没有给我最好的表现。你能告诉我这是否是正确的方法吗?

MATCH ps=(n:Event)-[:VISIT_ON]-(m:Minute{value:0})--(h:Hour{value:0})--(d:Day{value:8})--(M:Month{value:2})--(y:Year{value:2016})  
match pe=(n1:Event)-[:VISIT_ON]-(m1:Minute{value:59})--(h1:Hour{value:23})--(d1:Day{value:8})--(M1:Month{value:2})--(y1:Year{value:2016})  
MATCH ph=shortestPath((m)-[:NEXT*]->(m1)) 
WITH nodes(ph) AS minutes
UNWIND minutes as minute 
MATCH (minute)-[:VISIT_ON]->(e:Event) 
.....
return ...
4

1 回答 1

0

在明确添加关系名称之后,最后又不同了,它运行得更好..我把它留在这里以备将来参考..:

MATCH ps=(n:Event)-[:VISIT_ON]->(m:Minute{value:0})<-[:CHILD]-(h:Hour{value:0})<-[:CHILD]-(d:Day{value:8})<-[:CHILD]-(M:Month{value:2})<-[:CHILD]-(y:Year{value:2016})  
match pe=(n1:Event)-[:VISIT_ON]->(m1:Minute{value:59})<-[:CHILD]-(h1:Hour{value:23})<-[:CHILD]-(d1:Day{value:8})<-[:CHILD]-(M1:Month{value:2})<-[:CHILD]-(y1:Year{value:2016})  
MATCH ph=shortestPath((m)-[:NEXT*]->(m1)) 
with distinct nodes(ph) as minutes
return size(minutes)
于 2016-04-04T13:27:04.920 回答