0

with gremlin I want to show a graph with vertex name a field name end not the label name. How can do it?

If I use this my graph

I see the label name and not a specific value field, for example Name field value How I can modify my query? Thanks a lot

I want a specific value field for vertex

Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38
Diego R
  • 5
  • 3

1 Answers1

0

That looks like you are using the graph-notebook Jupyter notebooks. You can use the -d and -de flags to tell the notebook how to label the diagram. For example:

%%gremlin -d name -de weight

will label nodes using a "name" property, and edges using a "weight" property.

Note that most of the magic commands, like %%gremlin support asking for help. You just need to put at least one character in the cell body. For example:

%%gremlin --help
x

There is additional documentation available here and here

There are also a number of sample notebooks that come included with the graph-notebook open source package. Several of those contain examples of how to customize graph visualizations. You may find those useful.

Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38
  • Hi Kelvin, your example works fine. Now I just want one vertex and all edges. How can I do it? – Diego R Dec 13 '22 at 10:37
  • Do you mean there are multiple edges between the same vertex pair, or something else? – Kelvin Lawrence Dec 13 '22 at 15:53
  • multiple edges between the same vertex pair. I find this and it works fine for OUT edge from specific vertex: g.V().has('name','my_value').outE().inV().path().by(elementMap()). Now I want to see all IN edge for specific vertex – Diego R Dec 13 '22 at 15:57
  • Does the example in this issue (also now included in the sample notebooks) help? https://github.com/aws/graph-notebook/issues/157 – Kelvin Lawrence Dec 13 '22 at 16:19
  • it doesn't work :-( I have an error – Diego R Dec 13 '22 at 16:35
  • As this is really a different question, it might be best, if the original question is answered, to accept the answer to this question and create a new question that includes what you tried and the error you received. – Kelvin Lawrence Dec 13 '22 at 17:32