smita padhy
2018-09-10 05:58:41 UTC
Hi All,
I have a db model which follows OrientDB oops concept. I am using gremlin
to query the db. If i use following code i am able to get all the children
of the class test.
OrientDB orientDB = new
OrientDB("remote:localhost","root","root",OrientDBConfig.defaultConfig());
ODatabasePool pool = new ODatabasePool(orientDB,"OOPSDemo","root","root");
try (ODatabaseSession db = pool.acquire()) {
ORecordIteratorClass<ODocument> cls = db.browseClass("test");
Iterator<ODocument> itr = cls.iterator();
while(itr.hasNext())
{
ODocument v = itr.next();
System.out.println("class name"+v.getClassName());
System.out.println("id"+v.getIdentity());
System.out.println("json"+v.toJSON());
}
}
pool.close();
orientDB.close();
But when i use gremlin i am unable to get all the children -
List<Vertex> edgeList = g.traversal().V().hasLabel("test").bothV().toList();
i just have vertex and no edges. I am trying to do a POC to see if we can
achieve the model designed in neo4j using orient db oops.
Please let me know if i am missing something in gremlin.
Regards
Smita
I have a db model which follows OrientDB oops concept. I am using gremlin
to query the db. If i use following code i am able to get all the children
of the class test.
OrientDB orientDB = new
OrientDB("remote:localhost","root","root",OrientDBConfig.defaultConfig());
ODatabasePool pool = new ODatabasePool(orientDB,"OOPSDemo","root","root");
try (ODatabaseSession db = pool.acquire()) {
ORecordIteratorClass<ODocument> cls = db.browseClass("test");
Iterator<ODocument> itr = cls.iterator();
while(itr.hasNext())
{
ODocument v = itr.next();
System.out.println("class name"+v.getClassName());
System.out.println("id"+v.getIdentity());
System.out.println("json"+v.toJSON());
}
}
pool.close();
orientDB.close();
But when i use gremlin i am unable to get all the children -
List<Vertex> edgeList = g.traversal().V().hasLabel("test").bothV().toList();
i just have vertex and no edges. I am trying to do a POC to see if we can
achieve the model designed in neo4j using orient db oops.
Please let me know if i am missing something in gremlin.
Regards
Smita
--
---
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-database+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
---
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-database+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.