Hello all,
I've been trying to model a graph problem and up until now OrientDb has
been very helpful in getting to the solution.
One of the use case involves modelling nodes as a hierarchy of class
relations. I've been using the blueprints api for query.
The hierarchy example is very simple:
OrientVertex
|
Student
|
/ \
/ \
Graduate Post-Grad
The schema creation mentions super class as Student for both Graduate and
Post-Grad classes.
Here is a simple query i'm trying to fire using the Java api:
[insertion of vertices is always for *Graduate or Post-Grad* type]
OrientGraph graph = new OrientGraph(dbUrl);
OrientGraphQuery queryBuilder = (OrientGraphQuery) graph.query();
Iterable<Vertex> studentVertices =
queryBuilder.labels("Student").has("_id",
Compare.EQUAL,"graduateSha123").vertices();
I looked into the code and the effect of labels does not seem to consider
polymorphism. Also it does not work in synonymous with the
getVerticesOfClass api which is there at the graph level i.e from the above
example
boolean isPolymorphic = true;
graph.getVerticesOfClass("Student", isPolymorphic);
I also see that this class provides the impl for the polymorphic query
execution from the native layer *OrientElementScanIterable.*
*My question is, is there a way to mention the polymorphism bit in
this(above mentioned blueprints api) query interface? if not what are the
other ways of achieving this?*
Any insight regarding this will be very much appreciated.
Thanks in advance.
P.S: It'd be very useful if the solution does not involve construction of
string SQL queries(atleast not directly)
Pramod N <http://atmachinelearner.blogspot.in>
@machinelearner <https://twitter.com/machinelearner>
--
--
---
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.