I am able to achieve this as 
GremlinPipeline<String, List> sources =new 
GremlinPipeline().start((graph.getVertices("name", "HEY BO 
DIDDLEY"))).bothE().bothV().simplePath().path();
Iterator iter = sources.iterator();
Object element =null;
while(iter.hasNext()) {
element = iter.next();
                 ArrayList<Object> newObj = (ArrayList<Object>) (element);
                 OrientVertex source = (OrientVertex) newObj.get(0);
                 OrientVertex target = (OrientVertex) newObj.get(2);
                 System.out.println("source"+source);
                 System.out.println("target"+target);
               
                 OrientEdge link = (OrientEdge) newObj.get(1);
                 System.out.println("link"+link);
}
finally if i am getting vertex id and i can get the properties from it by 
using graph.getVertices(rid, value).iterator().next()


On Monday, July 4, 2016 at 10:05:54 PM UTC+5:30, Amrutha Valli wrote:
>
> Hi,
>
> I am trying to get all the in and out nodes from the node using java and 
> gremlin i tried bel;ow and able to get all the node ids now i want to get 
> the properties also.
>
> below is the  code and output
>
>
> GremlinPipeline<String, List> sources =new 
> GremlinPipeline().start((graph.getVertices("name", "HEY BO 
> DIDDLEY"))).bothE().outV().path();
> Iterator iter = sources.iterator();
>    while(iter.hasNext()) {
>        System.out.println("-it--"+iter.next());
>    }
>
> }
>
>
>
> output:
> -it--[v[#9:1], e[#11:0][#9:1-followed_by->#9:2], v[#9:1]] -it--[v[#9:1], 
> e[#11:1][#9:1-followed_by->#9:3], v[#9:1]] -it--[v[#9:1], 
> e[#11:2][#9:1-followed_by->#9:4], v[#9:1]] -it--[v[#9:1], 
> e[#11:3][#9:1-followed_by->#9:5], v[#9:1]] -it--[v[#9:1], 
> e[#11:4][#9:1-followed_by->#9:6], v[#9:1]] -it--[v[#9:1], 
> e[#12:0][#9:1-written_by->#9:7], v[#9:1]] -it--[v[#9:1], 
> e[#13:0][#9:1-sung_by->#9:8], v[#9:1]] -it--[v[#9:1], 
> e[#11:745][#9:3-followed_by->#9:1], v[#9:3]] -it--[v[#9:1], 
> e[#11:713][#9:5-followed_by->#9:1], v[#9:5]] -it--[v[#9:1], 
> e[#11:2407][#9:145-followed_by->#9:1], v[#9:145]] -it--[v[#9:1], 
> e[#11:6235][#9:124-followed_by->#9:1], v[#9:124]]    
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to