Question

I'm trying to print a graph in Faunus (v0.4.0) where a node has any edges (incoming or outgoing). From the gremlin shell, I tried:

g = FaunusFactory.open('faunus.properties')
g.V.filter("{it.bothE.hasNext()}").sideEffect("{println it}")

When I do this, I get a printout of all the nodes as I expected

But without the println, I do not.

According to How do I write a for loop in gremlin?, the gremlin terminal should print this info out for me, but it does not seem to.

Is there something specific I need to do to enable the printing from the console?

Était-ce utile?

La solution

Faunus and Gremlin are close to each other in terms of purpose and functionality but not identical. The filter isn't producing a side-effect, which will be written to HDFS. If you did:

g.V.filter("{it.bothE.hasNext()}").id

You could then view the list of ids matching that filter with something like:

hdfs.head('output',100)

to see the first 100 lines of the output. If you need more than just the element identifier you could do a transform to get some of the element properties in there as well. You might find these hdfs helper tips helpful.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top