Neo4j 基于边缘特性的过滤度

Neo4j 基于边缘特性的过滤度,neo4j,cypher,Neo4j,Cypher,在电影数据库中,我想找到演员,并统计他们在一个时间范围内播放的电影数量。目前我没有集成时间范围过滤,我正在使用下面的查询 MATCH (n:Person)-[r:ACTED_IN]->(:Movie) WITH n, r, SIZE( (n)-[:ACTED_IN]->(:Movie) ) as degree WHERE degree > 3 RETURN DISTINCT ID(n) as id, n.name as Actor, degree as Count ORDER

在电影数据库中,我想找到演员,并统计他们在一个时间范围内播放的电影数量。目前我没有集成时间范围过滤,我正在使用下面的查询

MATCH (n:Person)-[r:ACTED_IN]->(:Movie)
WITH n, r, SIZE( (n)-[:ACTED_IN]->(:Movie) ) as degree
WHERE degree > 3 
RETURN DISTINCT ID(n) as id, n.name as Actor, degree as Count
ORDER BY degree DESC SKIP 0 LIMIT 100
如果我能做这样的查询

MATCH (n:Person)-[r:ACTED_IN]->(:Movie)
WITH n, r, SIZE( (n)-[r2:ACTED_IN where r2.released > 1990 and r2.released < 2000 ]->(:Movie) ) as degree
WHERE degree > 3 
RETURN DISTINCT ID(n) as id, n.name as Actor, degree as Count
ORDER BY degree DESC SKIP 0 LIMIT 100
MATCH(n:Person)-[r:ACTED_IN]->(:Movie)
以n,r,SIZE((n)-[r2:active_,其中r2.released>1990和r2.released<2000]->(:Movie))作为度
其中学位>3
返回不同的ID(n)作为ID,n.name作为Actor,degree作为Count
按度顺序描述跳过0限制100
这会奏效的。在度计算过程中如何对边属性进行过滤?

我想我找到了

MATCH (n:Person)-[r:ACTED_IN]->(:Movie)
WHERE r.begin_datetime > 0 AND r.end_datetime < 1560755054828
WITH n, SIZE(COLLECT(r)) as degree
WHERE degree > 3
RETURN DISTINCT ID(n) as id, n.name as Actor, degree as Count 
ORDER BY degree DESC SKIP 0 LIMIT 100
MATCH(n:Person)-[r:ACTED_IN]->(:Movie)
其中r.begin_datetime>0,r.end_datetime<156075054828
以n表示,大小(收集(r))为度
其中学位>3
返回不同的ID(n)作为ID,n.name作为Actor,degree作为Count
按度顺序描述跳过0限制100
我想我找到了

MATCH (n:Person)-[r:ACTED_IN]->(:Movie)
WHERE r.begin_datetime > 0 AND r.end_datetime < 1560755054828
WITH n, SIZE(COLLECT(r)) as degree
WHERE degree > 3
RETURN DISTINCT ID(n) as id, n.name as Actor, degree as Count 
ORDER BY degree DESC SKIP 0 LIMIT 100
MATCH(n:Person)-[r:ACTED_IN]->(:Movie)
其中r.begin_datetime>0,r.end_datetime<156075054828
以n表示,大小(收集(r))为度
其中学位>3
返回不同的ID(n)作为ID,n.name作为Actor,degree作为Count
按度顺序描述跳过0限制100

您可以通过电影数据库中的
released
属性进行筛选,最后使用来获取1990-2000年间每位演员所演电影的数量

MATCH (n:Person)-[r:ACTED_IN]->(m:Movie)
WHERE m.released > 1990 AND m.released < 2000
RETURN n.name as Actor, COUNT (DISTINCT m) as Count

您可以通过电影数据库中的
released
属性进行筛选,最后使用来获取1990-2000年间每位演员拍摄的电影数量

MATCH (n:Person)-[r:ACTED_IN]->(m:Movie)
WHERE m.released > 1990 AND m.released < 2000
RETURN n.name as Actor, COUNT (DISTINCT m) as Count