tinkerpop-frames

How to Find Vertices of Specific class with Tinkerpop Frames

让人想犯罪 __ 提交于 2020-01-05 23:08:03
问题 I have a FramedGraph object with Vertices of different classes, for instance Person and Location. I would like to retrieve all vertices of the "Person" class. Here is my current method. public List<Person> listPeople() { List<Person> people = new ArrayList<Person>(); Iterator iterator = g.getVertices().iterator(); while (iterator.hasNext()) { Vertex v = (Vertex) iterator.next(); Person p = (Person) g.getVertex(v.getId(), Person.class); people.add(p); } return people; } This feels terrifically

How to Find Vertices of Specific class with Tinkerpop Frames

北城余情 提交于 2020-01-05 23:03:07
问题 I have a FramedGraph object with Vertices of different classes, for instance Person and Location. I would like to retrieve all vertices of the "Person" class. Here is my current method. public List<Person> listPeople() { List<Person> people = new ArrayList<Person>(); Iterator iterator = g.getVertices().iterator(); while (iterator.hasNext()) { Vertex v = (Vertex) iterator.next(); Person p = (Person) g.getVertex(v.getId(), Person.class); people.add(p); } return people; } This feels terrifically

Why simple set and then get on Dynamic Proxy does not persist? (using TinkerPop Frames JavaHandler)

醉酒当歌 提交于 2019-12-25 05:27:19
问题 I wanted to add simple getters and setters on a class that implements VertexFrame and I used JavaHandlers for those. For those methods I didn't want to have any interaction with the database. Unfortunately there is not something like @Ignore so I don't have unexpected annotation exceptions. When I set something on the proxy and immediately I do a get after it goes through reflection, nothing is stored. Could be that I shouldn't be using JavaHandlers but something else.. Btw manager.frame

What is the best practice to update a Vertex after is detached from DB with Tinkerpop Frames?

走远了吗. 提交于 2019-12-13 04:43:37
问题 Let's exemplify I receive a Vertex with Tinkerpop Blueprint, then I use Frames to convert it in an entity. I close the database (so from now the node is detached from the DB) and I show the node on a web page to let the user modify it. The user makes some modifications, then I shoud persist the changes. The problem is that the Instance of the database is already closed, so the entity is detached from the database: What is the best practice (considering performance and memory usage too) to

Tinkerpop Frames: Query vertices based on interface type

半世苍凉 提交于 2019-12-11 13:05:35
问题 I'm using Tinkerpop Frames to create a set of vertices and edges. Adding a new vertex is simple but retreiving vertices based on type seems a bit difficult. Assume I have a class A and B and I want to add a new one so: framedGraph.addVertex(null, A.class); framedGraph.addVertex(null, B.class); That's straight forward. But what if I want to retrieve all vertices with type A ? Doing this failed, because it returned all vertices (both A and B ). framedGraph.query().vertices(A.class); Is there