Graph is not showing in AGE Viewer for Edges

huangapple go评论60阅读模式
英文:

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?

Graph View:
Graph is not showing in AGE Viewer for Edges

Table View:
Graph is not showing in AGE Viewer for Edges

答案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);

huangapple
  • 本文由 发表于 2023年5月18日 11:36:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/76277564.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定