skip to Main Content

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:
enter image description here

Table View:
enter image description here

2

Answers


  1. 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);
    
    Login or Signup to reply.
  2. 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);
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search