GraphEngine icon indicating copy to clipboard operation
GraphEngine copied to clipboard

Question: The best way to assign labels to edges

Open eosfor opened this issue 7 years ago • 2 comments

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

eosfor avatar May 14 '18 13:05 eosfor

@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.

yatli avatar May 20 '18 08:05 yatli

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

TaviTruman avatar Dec 02 '22 20:12 TaviTruman