You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by "Munmud (via GitHub)" <gi...@apache.org> on 2023/07/13 12:55:10 UTC

[GitHub] [age] Munmud opened a new issue, #1031: node/edges with different label combined store

Munmud opened a new issue, #1031:
URL: https://github.com/apache/age/issues/1031

   Is there any table that AGE use to store node/edges different label combined? If there is how to access it ? Can you give me with example code ? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] Zainab-Saad commented on issue #1031: node/edges with different label combined store

Posted by "Zainab-Saad (via GitHub)" <gi...@apache.org>.
Zainab-Saad commented on issue #1031:
URL: https://github.com/apache/age/issues/1031#issuecomment-1634382218

   Whenever you create a graph, two tables are created under the postgres namespace for that graph. These tables are `_ag_label_vertex` and `_ag_label_edge`. These tables contain all the vertices and edges respectively irrespective of their label and any table that is created on the creation of a new label inherits this default table (vertex label tables inherit `_ag_label_vertex` and edge label tables inherit `ag_label_edge`)
   You can find these tables using
   `SELECT * FROM ag_catalog.ag_label;`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] Munmud closed issue #1031: node/edges with different label combined store

Posted by "Munmud (via GitHub)" <gi...@apache.org>.
Munmud closed issue #1031: node/edges with different label combined store
URL: https://github.com/apache/age/issues/1031


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] Zainab-Saad commented on issue #1031: node/edges with different label combined store

Posted by "Zainab-Saad (via GitHub)" <gi...@apache.org>.
Zainab-Saad commented on issue #1031:
URL: https://github.com/apache/age/issues/1031#issuecomment-1635436039

   Have you looked into the table `graph_name._ag_label_vertex` and `graph_name._ag_label_edge` ?
   From what I understood initially is that you want to query the table that has **all the vertices** or **all the edges**. In that case, querying the above two tables should do the work.
   
   For example, I have created vertices, edges as:
   ```
   SELECT * FROM cypher('graph', $$
   CREATE (n: VertexA {prop: "VertexA"})-[e1: EDGE_1 {prop: "EDGE_1"}]->(m: VertexB {prop: "VertexB"})-[e2: EDGE_2 {prop: "EDGE_2"}]->(o: VertexC {prop: "VertexC"})
   $$) AS (result agtype);
   ```
   
   The tables `graph."VertexA"`, `graph."VertexB"`, `graph."VertexC"` each contains the individual label's vertices but the table `graph._ag_label_vertex` contains all the vertices (because `graph._ag_label_vertex` is the default table for storing vertices irrespective of the label)
   Same is the case with edges, `graph."EDGE_1"` and `graph."EDGE_2"` contain the edges belonging to each of these labels but the table `graph._ag_label_edge` contains all these edges irrespective of the label they have
   
   P.S: `_ag_label_vertex` and `_ag_label_edge` is not associated to any label 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] Munmud commented on issue #1031: node/edges with different label combined store

Posted by "Munmud (via GitHub)" <gi...@apache.org>.
Munmud commented on issue #1031:
URL: https://github.com/apache/age/issues/1031#issuecomment-1635084176

   > Whenever you create a graph, two tables are created under the postgres namespace for that graph. These tables are `_ag_label_vertex` and `_ag_label_edge`. These tables contain all the vertices and edges respectively irrespective of their label and any table that is created on the creation of a new label inherits this default table (vertex label tables inherit `_ag_label_vertex` and edge label tables inherit `ag_label_edge`) You can find these tables using `SELECT * FROM ag_catalog.ag_label;`
   
   Thank you @Zainab-Saad . But this isn't actually what I was looking. The nodes and edges are stored with table name as `graph_name."label_name"`. So to view all the nodes and edges I was going through every table with different label. But @muhammadshoaib told me that there is already a table that store all nodes and edges. I don't have to go through different label name. Do you know anything about it ? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] MatheusFarias03 commented on issue #1031: node/edges with different label combined store

Posted by "MatheusFarias03 (via GitHub)" <gi...@apache.org>.
MatheusFarias03 commented on issue #1031:
URL: https://github.com/apache/age/issues/1031#issuecomment-1640667015

   > Is there any table that AGE use to store node/edges different label combined? 
   
   You can see which tables AGE creates by default, and all it's functions, in the [age--1.3.0.sql](https://github.com/apache/age/blob/master/age--1.3.0.sql) file. If you want to see all the available labels created for the graphs in your database, you can check the `ag_label` table for that. It's going to store all the labels, not every node or every edge all together. For that, as Zainab Saad stated, there are two parent tables: `_ag_label_vertex` and `_ag_label_edge` for the respective graph.
   
   So, to see all the labels, nodes and edges combined, execute the following query:
   ```sql
   SELECT * FROM ag_catalog.ag_label;
   ```  
   And, if you have already created a graph, it will show this:
   ```
          name       | graph | id | kind |          relation           |        seq_name         
   ------------------+-------+----+------+-----------------------------+-------------------------
    _ag_label_vertex | 18128 |  1 | v    | graph_name._ag_label_vertex | _ag_label_vertex_id_seq
    _ag_label_edge   | 18128 |  2 | e    | graph_name._ag_label_edge   | _ag_label_edge_id_seq
   (2 rows)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org