英文:
Graph is not showing in AGE Viewer for Edges
问题
当我运行以下查询时:
SELECT *
FROM cypher('university', $$
MATCH ()-[e]->()
RETURN e
$$) as (v agtype);
结果只显示在表格视图中,图形视图为空。如何解决这个问题?
英文:
I am connecting the instance of AGE running on WSL to AGE Viewer running on Window. It is working fine. When I run query:
SELECT *
FROM cypher('university', $$
MATCH (v)
RETURN v
$$) as (v agtype);
It works fine and show all the nodes in the university
Graph in both Table and Graph View. But when I run:
SELECT *
FROM cypher('university', $$
MATCH ()-[e]->()
RETURN e
$$) as (v agtype);
It shows result in only Table View and Graph View shows nothing. How can I solve this issue?
答案1
得分: 1
问题可以通过以下代码解决,要在图形视图中查看关系,需要修改查询以包括连接的节点。如何检索它:
SELECT *
FROM cypher('university', $$
MATCH (n1)-[e]->(n2)
RETURN n1, e, n2
$$) as (n1 agtype, e agtype, n2 agtype);
英文:
The issue can be resolved with the below code and to see the relationship in the graph view, a modification in query is needed to include the connected nodes. This is how to retrieve it:
SELECT *
FROM cypher('university', $$
MATCH (n1)-[e]->(n2)
RETURN n1, e, n2
$$) as (n1 agtype, e agtype, n2 agtype);
答案2
得分: -1
因为在第二个查询中,你只想返回边缘而不包括它们关联的顶点,而 Apache AGE Viewer 将无法绘制没有关联顶点的边缘。
所以你可以修改你的查询,以返回边缘和顶点,如下所示:
SELECT *
FROM cypher('university', $$
MATCH (v1)-[e]->(v2)
RETURN v1, e, v2
$$) as (v1 agtype, e agtype, v2 agtype);
英文:
Because in the second query you want to return the edges only with out their associated vertices and Apache AGE Viewer will not be able to draw the edges without their associated vertices.
So you can modify your query to return the edges and vertices like the following :
SELECT *
FROM cypher('university', $$
MATCH (v1)-[e]->(v2)
RETURN v1,e,v2
$$) as (v1 agtype, e agtype, v2 agtype);
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论