microsoft / GraphEngine

Microsoft Graph Engine
MIT License
2.2k stars 329 forks source link

Question: The best way to assign labels to edges #202

Open eosfor opened 6 years ago

eosfor commented 6 years ago

Hello colleagues,

what is the best way to describe nodes and edges in TSL to be able to mark edges, to be able to follow only specific edges.

For example i got the following node type

[GraphNode]
cell Node {
    string Label;
    [GraphEdge] CellId OutEdge;
}

I need to be able to differentiate between different type of relationships. For example if the node represents a group, it may have relationships like "members" and "memberof" pointing to other groups. So in my query i'd like to extract a subtree following the "members" type of relationship. Is it possible to achieve it with this node type or i need to define a "field" for each type of relationship?

Thanks

yatli commented 6 years ago

@eosfor if there's only OutEdge and a single node type Node, you'll have to do the check on the next hop, to examine the Label field, if I understand correctly. But I'd recommend you do it with the type system instead, like you mentioned, multiple node types and multiple edge types. That way you can write simpler queries with better performance.

TaviTruman commented 1 year ago

@eosfor I know this is an old post; did you get your question answered.