You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Labels are a integral part of tinkerpop graphs, with the option to add vertexes with g.addV(label).
With this issue I am asking on input on ways to make it a more integral part in this project. In the text below I go over why it is that I would like to see it added. The current way of doing it and some possible solutions to implement it.
Labels are used to distinguish between vertexes. While it is not needed for Ferma as you can use the class structure to distinguish between vertexes, it would be nice to have a easy way to set them so that programs that rely on the graph output can use these.
Currently you have to do it with framedGraph.addFramedVertex(new DefaultClassInitializer<>(className), T.label, labelName); and the recetlly added (#56) framedGraph.addFramedVertex(className, T.label, labelName);
I have made an attempt to have a better way to add these with annotations on the vertex class as labels are generally used to distinguish between types of nodes. This one is visible in a pull request on my own repo. But I am not yet convinced that this is the way to go. (this implementation is just a proof of concept and still needs a bit of work. Like checking if no label is given as argument when adding the vertex)
Some other ways that i have thought of was to add the function framedGraph.addV(className, labelName); To more closely mirror the Tinkerpop implementation.
The last options would be a breaking change that would split the current @GraphElement into two separate annotations, one being @GraphVertex and the other @GraphEdge, where GraphVertex has a optional label.
I would love to hear thoughts on this subject as I have to use labels in a project that I am currently working on. I therefore also have some time to spare to implement this into this library.
The text was updated successfully, but these errors were encountered:
Labels are a integral part of tinkerpop graphs, with the option to add vertexes with
g.addV(label)
.With this issue I am asking on input on ways to make it a more integral part in this project. In the text below I go over why it is that I would like to see it added. The current way of doing it and some possible solutions to implement it.
Labels are used to distinguish between vertexes. While it is not needed for Ferma as you can use the class structure to distinguish between vertexes, it would be nice to have a easy way to set them so that programs that rely on the graph output can use these.
Currently you have to do it with
framedGraph.addFramedVertex(new DefaultClassInitializer<>(className), T.label, labelName);
and the recetlly added (#56)framedGraph.addFramedVertex(className, T.label, labelName);
I have made an attempt to have a better way to add these with annotations on the vertex class as labels are generally used to distinguish between types of nodes. This one is visible in a pull request on my own repo. But I am not yet convinced that this is the way to go. (this implementation is just a proof of concept and still needs a bit of work. Like checking if no label is given as argument when adding the vertex)
Some other ways that i have thought of was to add the function
framedGraph.addV(className, labelName);
To more closely mirror the Tinkerpop implementation.The last options would be a breaking change that would split the current
@GraphElement
into two separate annotations, one being@GraphVertex
and the other@GraphEdge
, where GraphVertex has a optional label.I would love to hear thoughts on this subject as I have to use labels in a project that I am currently working on. I therefore also have some time to spare to implement this into this library.
The text was updated successfully, but these errors were encountered: