You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@graphar.apache.org by Muniraju Pulipalyam <mu...@hotmail.com> on 2024/08/06 05:51:31 UTC
Creating graphs from CSV files of nodes and edges
Hi All,
I have seen samples showing how to read and update graphs in graphAr, but couldn't find a sample that shows how to create a new graph given CSV files of vertices and edges. I saw person_0_0.csv and person_knows_person_0_0.csv, but I could not find any sample that is loading that data to create a new graph. Any sample c++ code snippet to create a graph from CSV files will help a lot.
Thanks,
Muni
Re: Creating graphs from CSV files of nodes and edges
Posted by Muniraju Pulipalyam <mu...@hotmail.com>.
Thanks a ton Weibin.
________________________________
From: Weibin Zeng <we...@apache.org>
Sent: Tuesday, August 6, 2024 11:48 AM
To: dev@graphar.apache.org <de...@graphar.apache.org>
Subject: Re: Creating graphs from CSV files of nodes and edges
Hi, there is a example[1] that use high-level writer to create graph from CSV
[1] https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fincubator-graphar%2Fblob%2Fmain%2Fcpp%2Fexamples%2Fsnap_dataset_to_graphar.cc&data=05%7C02%7C%7C4e898f80019447ce5ac408dcb5df9106%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638585219022989624%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=bg0kt3djL%2BGL1nY6n9YUYB%2FagkjLLHwYQ1jnz6HX38Y%3D&reserved=0<https://github.com/apache/incubator-graphar/blob/main/cpp/examples/snap_dataset_to_graphar.cc>
On 2024/08/06 05:51:31 Muniraju Pulipalyam wrote:
> Hi All,
>
> I have seen samples showing how to read and update graphs in graphAr, but couldn't find a sample that shows how to create a new graph given CSV files of vertices and edges. I saw person_0_0.csv and person_knows_person_0_0.csv, but I could not find any sample that is loading that data to create a new graph. Any sample c++ code snippet to create a graph from CSV files will help a lot.
>
> Thanks,
> Muni
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@graphar.apache.org
For additional commands, e-mail: dev-help@graphar.apache.org
Re: Creating graphs from CSV files of nodes and edges
Posted by Weibin Zeng <we...@apache.org>.
Hi, there is a example[1] that use high-level writer to create graph from CSV
[1] https://github.com/apache/incubator-graphar/blob/main/cpp/examples/snap_dataset_to_graphar.cc
On 2024/08/06 05:51:31 Muniraju Pulipalyam wrote:
> Hi All,
>
> I have seen samples showing how to read and update graphs in graphAr, but couldn't find a sample that shows how to create a new graph given CSV files of vertices and edges. I saw person_0_0.csv and person_knows_person_0_0.csv, but I could not find any sample that is loading that data to create a new graph. Any sample c++ code snippet to create a graph from CSV files will help a lot.
>
> Thanks,
> Muni
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@graphar.apache.org
For additional commands, e-mail: dev-help@graphar.apache.org
Re: Add property groups and different edge properties
Posted by Weibin Zeng <we...@apache.org>.
You can use the `find_src` or `find_dst` method in `EdgeCollection`[1] to find the first edge of the vertex and iterate the edges. There is a bfs example[2] that demonstrates how to construct the `EdgeCollection` and iterate the edges of certain vertex.
[1] https://graphar.apache.org/docs/cpp/classgraphar_1_1_edges_collection.html
[2] https://github.com/apache/incubator-graphar/blob/main/cpp/examples/bfs_push_example.cc
Best,
Weibin Zeng
On 2024/08/18 14:38:14 Muniraju Pulipalyam wrote:
> Thanks Jingbo. I am OK to retrieve a vertex just by ID. Can you point me if there are any sample that shows how to use various retrieval APIs? Given a vertex by it's ID in a graph of 1000s of elements, I want to address that vertex and get all the edges and vertices connected to it at various depths. Any pointers to sample code will help.
>
>
>
> ________________________________
> From: Jingbo Xu <xu...@gmail.com>
> Sent: Wednesday, August 14, 2024 8:36 AM
> To: dev@graphar.apache.org <de...@graphar.apache.org>
> Subject: Re: Add property groups and different edge properties
>
> I try to discuss these with my own understanding:
>
> For the first question, I think it is a reasonable requirement. We may
> consider supporting this. :)
> The second question is a bit complicated:
> - in your example, it should be supported. Since GraphAr supports a set of
> retrieval APIs and even can serve as out-of-core storage. Getting vertex by
> its unique ID is essential.
> - However, you mentioned "on a certain property", I think its efficient
> implementation may require archive indexes (on certain properties), which
> lack support in the current version I am afraid.
>
> Best,
> Jingbo
>
> On Tue, 13 Aug 2024 at 18:33, Muniraju Pulipalyam <mu...@hotmail.com>
> wrote:
>
> >
> > Hi All,
> >
> > Can I have a property group for a vertex that is of different file
> > formats? That is, if I have property group of id and name, can I create it
> > in both CSV and parquet, for example? In a graph, can different vertices be
> > connected with edges of different properties?
> >
> > Also, given a graph, is there a method to search for a vertex on a certain
> > property in the vertex property group? Say I have a 1000 vertex graph with
> > 20000 edges, I would like to get a vertex by it's ID through lookup and
> > traverse all it's edges.
> >
> > Thanks,
> > Muni
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@graphar.apache.org
For additional commands, e-mail: dev-help@graphar.apache.org
Re: Add property groups and different edge properties
Posted by Muniraju Pulipalyam <mu...@hotmail.com>.
Thanks Jingbo. I am OK to retrieve a vertex just by ID. Can you point me if there are any sample that shows how to use various retrieval APIs? Given a vertex by it's ID in a graph of 1000s of elements, I want to address that vertex and get all the edges and vertices connected to it at various depths. Any pointers to sample code will help.
________________________________
From: Jingbo Xu <xu...@gmail.com>
Sent: Wednesday, August 14, 2024 8:36 AM
To: dev@graphar.apache.org <de...@graphar.apache.org>
Subject: Re: Add property groups and different edge properties
I try to discuss these with my own understanding:
For the first question, I think it is a reasonable requirement. We may
consider supporting this. :)
The second question is a bit complicated:
- in your example, it should be supported. Since GraphAr supports a set of
retrieval APIs and even can serve as out-of-core storage. Getting vertex by
its unique ID is essential.
- However, you mentioned "on a certain property", I think its efficient
implementation may require archive indexes (on certain properties), which
lack support in the current version I am afraid.
Best,
Jingbo
On Tue, 13 Aug 2024 at 18:33, Muniraju Pulipalyam <mu...@hotmail.com>
wrote:
>
> Hi All,
>
> Can I have a property group for a vertex that is of different file
> formats? That is, if I have property group of id and name, can I create it
> in both CSV and parquet, for example? In a graph, can different vertices be
> connected with edges of different properties?
>
> Also, given a graph, is there a method to search for a vertex on a certain
> property in the vertex property group? Say I have a 1000 vertex graph with
> 20000 edges, I would like to get a vertex by it's ID through lookup and
> traverse all it's edges.
>
> Thanks,
> Muni
>
Re: Add property groups and different edge properties
Posted by Jingbo Xu <xu...@gmail.com>.
I try to discuss these with my own understanding:
For the first question, I think it is a reasonable requirement. We may
consider supporting this. :)
The second question is a bit complicated:
- in your example, it should be supported. Since GraphAr supports a set of
retrieval APIs and even can serve as out-of-core storage. Getting vertex by
its unique ID is essential.
- However, you mentioned "on a certain property", I think its efficient
implementation may require archive indexes (on certain properties), which
lack support in the current version I am afraid.
Best,
Jingbo
On Tue, 13 Aug 2024 at 18:33, Muniraju Pulipalyam <mu...@hotmail.com>
wrote:
>
> Hi All,
>
> Can I have a property group for a vertex that is of different file
> formats? That is, if I have property group of id and name, can I create it
> in both CSV and parquet, for example? In a graph, can different vertices be
> connected with edges of different properties?
>
> Also, given a graph, is there a method to search for a vertex on a certain
> property in the vertex property group? Say I have a 1000 vertex graph with
> 20000 edges, I would like to get a vertex by it's ID through lookup and
> traverse all it's edges.
>
> Thanks,
> Muni
>
Add property groups and different edge properties
Posted by Muniraju Pulipalyam <mu...@hotmail.com>.
Hi All,
Can I have a property group for a vertex that is of different file formats? That is, if I have property group of id and name, can I create it in both CSV and parquet, for example? In a graph, can different vertices be connected with edges of different properties?
Also, given a graph, is there a method to search for a vertex on a certain property in the vertex property group? Say I have a 1000 vertex graph with 20000 edges, I would like to get a vertex by it's ID through lookup and traverse all it's edges.
Thanks,
Muni