Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
eosfor opened this issue May 14, 2018 · 2 comments
Open

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

eosfor opened this issue May 14, 2018 · 2 comments

Comments

@eosfor
Copy link

eosfor commented May 14, 2018

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
Copy link
Contributor

yatli commented May 20, 2018

@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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants