Neo4j 2.0.0에서 제대로 작동하는 다음 사이퍼 쿼리가 있습니다.최단 경로에있는 모든 노드를 객체 목록으로 반환
MATCH (ab:Point { Latitude: 24.96325, Longitude: 67.11343 }),(cd:Point { Latitude: 24.95873, Longitude: 67.10335 }),
p = shortestPath((ab)-[*..150]-(cd))
RETURN p
다음 쿼리는 Neo4jClient에서 다음 오류를 제공합니다. Function Evaluation Timed out.
var pathsQuery =
client.Cypher
.Match("(ab:Point { Latitude: 24.96325, Longitude: 67.11343 }),(cd:Point { Latitude: 24.95873, Longitude: 67.10335 }), p = shortestPath((ab)-[*..150]-(cd))")
.Return<IEnumerable<PointEntity>>("extract(n in nodes(p) : id(n))");
및 Xclave 또 다른 유사 업무를 수행 한 후
:http://geekswithblogs.net/cskardon/archive/2013/07/23/neo4jclient-ndash-getting-path-results.aspx
같은 결과 값 : 기능 평가 시간 초과.
var pathsQuery =
client.Cypher
.Match("(ab:Point { Latitude: 24.96325, Longitude: 67.11343 }),(cd:Point { Latitude: 24.95873, Longitude: 67.10335 }), p = shortestPath((ab)-[*..150]-(cd))")
.Return(p => new PathsResult<PointEntity>
{
Nodes = Return.As<IEnumerable<Node<PointEntity>>>("nodes(p)"),
});
C#의 쿼리에서 반환 된 모든 노드를 PointEntity 유형 목록으로 가져 오는 방법은 무엇입니까?
편집 :
이 코드에서 노드와 관계의 URI를 다시 얻을 수 있었다 : I 시도 http://craigbrettdevden.blogspot.co.uk/2013/03/retrieving-paths-in-neo4jclient.html
:
var pathsQuery =
client.Cypher
.Match("(ab:Point { Latitude: 24.96325, Longitude: 67.11343 }),(cd:Point { Latitude: 24.95873, Longitude: 67.10335 }), p = shortestPath((ab)-[*..150]-(cd))")
var results = pathsQuery.Return<PathsResult>("p").Results;
것은 여기 크레이그 브렛의 블로그에 따라 POCO를 가져 오는데 오류가 발생했습니다 :
var paths = pathsQuery.Returns<PathsResult>("EXTRACT(n in nodes(p) : n) AS Nodes, EXTRACT(rel in rels(p) : rel) AS Relationships", CypherResultMode.Projection).Results;
오류 :
'Neo4jClient.Cypher.ICypherFluentQuery' does not contain a definition for 'Returns' and no extension method 'Returns' accepting a first argument of type 'Neo4jClient.Cypher.ICypherFluentQuery' could be found (are you missing a using directive or an assembly reference?)