Good points. I would like to be able to do something like:
Map<String, ODocument> map = vertex.getProperty("map"); // returns a map,
not an iterable
map.remove("a");
map.put("b", new ODocument());
// change is saved when transaction is committed.
Also, since every vertex has an ID, just like an ODocument, I don't see the
problem with just adding the identifier to the map whether it's a vertex or
a document. Every vertex and edge (heavyweight) is a document underneath
anyway.
This is one of my least favourite aspects of OrientDB. The whole
multi-model thing is great in theory but there are too many ways of one
model bleeding into another. When I'm working with a graph database, I
don't want to have to deal with the document part of it.
Anyway, thanks again for your help.
On Monday, September 14, 2015 at 3:22:21 PM UTC-6, Jan Plaček wrote:
>
> Yea I fixed the example once again.
> I think that sticking with Graph API, would be quite complicated. The
> Graph API knows only verticies, edges and properties. It does not know the
> concept of ORecord, so it can't know the concept of LINK MAP.
> The LINK MAP can reference any ORecord, the problem is that OrientElement
> does not extend the ORecord, but aggregates it.
> This means that casting ORecord to Element/Vertex/Edge is not possible.
> (like it's possible with ODocument)
> So we would need a new concept - ELEMENT MAP.
> But that is actually a really complicated concept - how do you ensure that
> ID's stored in ELEMENT MAP actually points to Element (Edge or Vertex)? It
> would require costly integrity check.
> Maybe fallbacking to Document API follows KISS principle better in this
> case.
> On the other hand I bet there will be a lot of people trying to convert
> that Document back to Vertex (new OrientVertex(graph, record)), which
> isn't kosher as well...
>
>
--
---
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.