Hi I am kinda new to gremlin and trying to achieve some solve by finding all the paths between two nodes. In simple query on gremlin console I was able to do that using this query :
(Name of the first Node).loop(1){it.loops<100}{true}.has('name', (Name of the second node)).path{it.name}
But while I was trying to fetch that from java methods I am into sea of problems, like:
-- no clue on where to put the query exactly ? -- what data structure will be right to receive the array of rows. -- how to collect the first node and second node from the graph.
Here I have tried to proceed with this, but no clue :
Graph g = new OrientGraph(AppConstants.GRAPH_LOCATION);
List<String> vertexList = new ArrayList<String>();
try{
for (Vertex v : g.getVertices()) {
String vertexName = v.getProperty("name");
vertexList.add(vertexName);
}
return vertexList;
} catch (final Exception ex) {
throw new AppSystemException(ex);
}finally{
g.shutdown();
Thanks, Sagir