The unit test fails as follows:
graph.compute().vertices(__.hasLabel("labelA"));
--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/13bfd79a-6944-4204-b038-06d56d80740e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
vertices() takes an anonymous traversal. This should work for you:graph.compute().vertices(__.hasLabel("labelA"));Cheers,Daniel
On Fri, Jan 5, 2018 at 9:21 AM, John J. Szucs <john.j...@gmail.com> wrote:
In a unit test, I have a graph that contains 7 vertices with label A and 48 vertices with label B. I need to run a GraphComputer VertexProgram over vertices with label A only, so I do this:
Traversal<Vertex, Vertex> vertices=graph.traversal().V().hasLabel("labelA");
GraphComputer computer=graph.compute().vertices(vertices);
VertexProgram<Double> program=new MyVertexProgram();
ComputerResult result=computer.program(program).submit().get();
The unit test fails as follows:org.janusgraph.core.JanusGraphException: Failed to process [48] vertices in vertex program iteration [1]. Computer is aborting.
Note that 48 in the exception message is exactly the number of vertices (with label B) that I intentionally filtered out.
I strongly suspect I am misunderstanding the API, as I am fairly new to Gremlin (but not Blueprints).
Can anyone offer advice on how to do this correctly? Thanks in advance!
-- John
--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-use...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/6c3686f2-b616-4161-9f7e-7d615a387685%40googlegroups.com.
computer.vertices(__.hasLabel(VERTEX));
computer.vertices(__.has(VERTEX_IDX));
computer.vertices(__.has(VERTEX_IDX, P.eq(0L)));
computer.vertices(__.has(VERTEX_IDX, P.test((a,b)->((Long) a) % 2 == 0L, 0L)));