Find All Vertices

Find All Vertices #

Problem #

How can I list all the nodes (subjects, predicates and objects) of the graph?

Test Data #

Fig 1.: Graph diagram of test data

Show the test data in nquads format
<alice> <follows> <bob> .
<bob> <follows> <fred> .
<bob> <status> "cool_person" .
<dani> <follows> <bob> .
<charlie> <follows> <bob> .
<charlie> <follows> <dani> .
<dani> <follows> <greg> .
<dani> <status> "cool_person" .
<emily> <follows> <fred> .
<fred> <follows> <greg> .
<greg> <status> "cool_person" .
<predicates> <are> <follows> .
<predicates> <are> <status> .
<emily> <status> "smart_person" <smart_graph> .
<greg> <status> "smart_person" <smart_graph> .

Gizmo Query #

g.V().All();


Results:

{"id":"alice"}
{"id":"follows"}
{"id":"bob"}
{"id":"fred"}
{"id":"status"}
{"id":"cool_person"}
{"id":"dani"}
{"id":"charlie"}
{"id":"greg"}
{"id":"emily"}
{"id":"predicates"}
{"id":"are"}
{"id":"smart_person"}
{"id":"smart_graph"}