GitHub user Sober7135 created a discussion: Question about how to get all the 
adjacent list types of a `EdgeInfo`

Since `EdgeInfo` only provides two functions related to adjacent list. 
https://github.com/apache/incubator-graphar/blob/b7768ad09ece6941a32e65e436f765fdf3c1a0fc/cpp/src/graphar/graph_info.h#L506
https://github.com/apache/incubator-graphar/blob/b7768ad09ece6941a32e65e436f765fdf3c1a0fc/cpp/src/graphar/graph_info.h#L522-L523
If we want to know what adjacent list types the edge info contains, we might 
write codes like this:
```C++
void example(const EdgeInfo& info) {
  if (info.HasAdjacentListType(AdjListType::ordered_by_source)) {
    // do something
  }
  if (info.HasAdjacentListType(AdjListType::ordered_by_dest)) {
    // do something
  }
  if (info.HasAdjacentListType(AdjListType::unordered_by_source)) {
    // do something
  }
  if (info.HasAdjacentListType(AdjListType::unordered_by_dest)) {
    // do something
  }
}
```
So i wonder if there is any other way to get adjacent list types of edge info. 
Or maybe we should provide a function like `GetPropertyGroups` to return a list 
of adjacent list types. 

(This situation mainly occurs when reading graphar format from disk. We need to 
first construct `GraphInfo`, then `VertexInfo` and `EdgeInfo`, finally 
construct `VerticeCollection` and `EdgesCollection` to iterate over vertices 
and edges. Constructing an `EdgesCollection` requires knowing the adjacent list 
type)

If I said something incorrect, please point it out. Thanks! 


GitHub link: https://github.com/apache/incubator-graphar/discussions/775

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to