finding a vertex using @rid through the Java API - orientdb 2.1.2

313 views
Skip to first unread message

Mihai Ocneanu

unread,
Sep 25, 2015, 7:47:15 AM9/25/15
to orient-...@googlegroups.com
Hello,

I'm trying to find a vertex by @rid, using the Java Graph API:

Iterable<Vertex> vertices = txGraph.getVertices("@rid", "#12:0");

It gives no result.

If I try to find a vertex using a property, the above works:

Iterable<Vertex> vertices= txGraph.getVertices("name", "example-name");

How can I find the vertex by @rid?


After finding it, I want to link it to another created vertex, by way of adding a new edge, also through the Java Graph API
Edge newEdge= txGraph.addEdge("class:EdgeClass", newVertex, foundVertex, "EdgeClass");

Thanks!

Enrico Risa

unread,
Sep 25, 2015, 8:08:29 AM9/25/15
to orient-...@googlegroups.com
Hi Mihai


"#12-0" is invalid record id #12:0 is the correct one

You can use the api

Vertex v = txGraph.getVertex("#12:0")
 


2015-09-25 13:47 GMT+02:00 Mihai Ocneanu <mihai....@gmail.com>:
Hello,

I'm trying to find a vertex by @rid, using the Java Graph API:

Iterable<Vertex> vertices = txGraph.getVertices("@rid", "#12-0");

It gives no result.

If I try to find a vertex using a property, the above works:

Iterable<Vertex> vertices= txGraph.getVertices("name", "example-name");

How can I find the vertex by @rid?


After finding it, I want to link it to another created vertex, by way of adding a new edge, also through the Java Graph API
Edge newEdge= txGraph.addEdge("class:EdgeClass", newVertex, foundVertex, "EdgeClass");

Thanks!

--

---
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 orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages