[orientdb] Re: How to get the value of a vertex in json, java graph api?

2016-11-22 Thread alessandrorota04
Hi,
you could use

Iterable resultEhr = g.command( new OCommandSQL("select 
@this.toJSON() as this from EHR where ehrId = '" + ehrId + "'") ).execute();
if (resultEhr.iterator().hasNext()){
   Vertex ehr = (Vertex) resultEhr.iterator().next(); 
   System.out.println(ehr.getProperty("this"));
}

You get for example 

{"@type":"d","@rid":"#21:0","@version":1,"@class":"EHR","name":"name1","ehrId":"id1"}


Best regards,
Alessandro

-- 

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


[orientdb] How to get the value of a vertex in json, java graph api?

2016-11-22 Thread Academia Learning Centro de inglés y de formación
I am using this but I can not get its json value, only the OrientVertex

Iterable resultEhr = graph.command( new OCommandSQL("select 
from EHR where ehrId = '" + ehrId + "'") ).execute();
if (resultEhr.iterator().hasNext()){
Vertex ehr = (Vertex) resultEhr.iterator().next();  
}


Any suggestions? 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-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] How do I get an embedded Object in a select query using ObjectApi?

2016-11-22 Thread John G
I am using ObjectApi to handle documents as objects.
Let's say we have a parent entity of class "Parent" and a child entity of 
class "Child" where child is an embedded object kept under Parent object.

I want to create a select query such as 
select child from Parent 
and have the child as instance of "Child" class.
Currently if you do this query what it returns is *object Object* and does 
not recognize the class of the Object.

Should this work like this? Any ideas?

-- 

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


Re: [orientdb] OrientDB SQL

2016-11-22 Thread 'Hans-Jürgen Otto' via OrientDB
Hi Luigi,

thank you! That was the problem.

Regards,

Hans.

Am Dienstag, 22. November 2016 12:21:28 UTC+1 schrieb Luigi Dell'Aquila:
>
> Hi,
>
> by default OrientDB Studio Graph panel displays only 20 records. You can 
> override this behavior adding a "limit" at the end of the query, eg.
>
> SELECT FROM V LIMIT -1
>
> Thanks
>
> Luigi
>
> 2016-11-22 12:03 GMT+01:00 'Hans-Jürgen Otto' via OrientDB <
> orient-...@googlegroups.com >:
>
>> Hey guys,
>>
>> I use a modified version of Teva-Gremlin (
>> https://github.com/effyteva/CSharpLibraries/tree/master/Teva.Common.Data.Gremlin)
>>  
>> with Gremlin-Server (3.2.3) that is connected to OrientDB (with 
>> OrientDB-Gremlin https://github.com/orientechnologies/orientdb-gremlin). 
>> I've created a graph and the creation went off normal.
>> So i wanted to get some Data in OrientStudio. First I used Gremlin and i 
>> got all vertices that i wanted. Then i used this SQL-Like query-language 
>> from OrientDB and i got only a part of the vertices that i wanted. 
>> For instance:
>> I used "*g.V()*" and got all 221 vertices. 
>> Then i used SELECT FROM V and got only 20 vertices.
>> However if I count all vertices with SELECT COUNT(*) FROM V I get the 
>> right number 221. 
>> Am I missing something?
>>
>> Regards
>>
>> -- 
>>
>> --- 
>> 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.
>>
>
>

-- 

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


Re: [orientdb] OrientDB SQL

2016-11-22 Thread Luigi Dell'Aquila
Hi,

by default OrientDB Studio Graph panel displays only 20 records. You can
override this behavior adding a "limit" at the end of the query, eg.

SELECT FROM V LIMIT -1

Thanks

Luigi

2016-11-22 12:03 GMT+01:00 'Hans-Jürgen Otto' via OrientDB <
orient-database@googlegroups.com>:

> Hey guys,
>
> I use a modified version of Teva-Gremlin (https://github.com/effyteva/
> CSharpLibraries/tree/master/Teva.Common.Data.Gremlin) with Gremlin-Server
> (3.2.3) that is connected to OrientDB (with OrientDB-Gremlin
> https://github.com/orientechnologies/orientdb-gremlin).
> I've created a graph and the creation went off normal.
> So i wanted to get some Data in OrientStudio. First I used Gremlin and i
> got all vertices that i wanted. Then i used this SQL-Like query-language
> from OrientDB and i got only a part of the vertices that i wanted.
> For instance:
> I used "*g.V()*" and got all 221 vertices.
> Then i used SELECT FROM V and got only 20 vertices.
> However if I count all vertices with SELECT COUNT(*) FROM V I get the
> right number 221.
> Am I missing something?
>
> Regards
>
> --
>
> ---
> 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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] OrientDB SQL

2016-11-22 Thread 'Hans-Jürgen Otto' via OrientDB
Hey guys,

I use a modified version of Teva-Gremlin 
(https://github.com/effyteva/CSharpLibraries/tree/master/Teva.Common.Data.Gremlin)
 
with Gremlin-Server (3.2.3) that is connected to OrientDB (with 
OrientDB-Gremlin https://github.com/orientechnologies/orientdb-gremlin). 
I've created a graph and the creation went off normal.
So i wanted to get some Data in OrientStudio. First I used Gremlin and i 
got all vertices that i wanted. Then i used this SQL-Like query-language 
from OrientDB and i got only a part of the vertices that i wanted. 
For instance:
I used "*g.V()*" and got all 221 vertices. 
Then i used SELECT FROM V and got only 20 vertices.
However if I count all vertices with SELECT COUNT(*) FROM V I get the right 
number 221. 
Am I missing something?

Regards

-- 

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


[orientdb] Using orientdb JDBC drive to excutequery not return resultset

2016-11-22 Thread jaya raj
Hi,

I am using orientdb 2.0.18 jdbc driver trying to insert record in vertex 
but not return inserted record.

Statement stmt = conn.createStatement();
String sql = "insert into package_master set name='test'";
ResultSet rs = stmt.executeQuery(sql);
it return null;

i don't know what i am missing.






-- 

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


[orientdb] Re: How to insert JSON with Java Graph API?

2016-11-22 Thread Academia Learning Centro de inglés y de formación
Help, I need to create two vertices with json content and then join them 
using an edge

El jueves, 17 de noviembre de 2016, 15:11:52 (UTC+1), Academia Learning 
Centro de inglés y de formación escribió:
>
> I'm doing it like this
>
> Vertex pruebaJson = graph.addVertex("class:Person");
> JSONObject json = new JSONObject();
>
> json.put("name","someone");
> json.put("address","somewhere");
> json.put("value","{'archetype_details':{'class':'ARCHETYPED','archetype_id':{'class':'ARCHETYPE_ID','value':'openEHR-EHR-COMPOSITION.report-mnd.v1'},'template_id':{'class':'TEMPLATE_ID','value':'Laboratory
>  
> Report'},'rm_version':'1.0.1'}}");
>
> pruebaJson.setProperty("data", json.toString());
>
> *This works but inserts it as a string inside the vertex instead of as an 
> embedded document*, and then I can not use the type queries:
> Select * from Person where data.name = 'someone'
>
> How can I make it to insert it as an embedded document instead of as a 
> text string?
>

-- 

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


[orientdb] Re: [orient-database] Fastest way to empty a graph database?

2016-11-22 Thread Academia Learning Centro de inglés y de formación
And if there are many classes, is there any way to do it through a for? 
Getting all kinds of classes and truncating?

El jueves, 16 de diciembre de 2010, 10:38:56 (UTC+1), Lvc@ escribió:
>
> Hi,
> you could truncate an entire class in this way:
>
> OClass cls = currentDatabase.getMetadata().getSchema().getClass("Vehicle");
> cls.truncate();
>
> If you're not using polymorphism against vertexes and edges type just:
>
>
> currentDatabase.getMetadata().getSchema().getClass("OGraphVertex").truncate();
>
> currentDatabase.getMetadata().getSchema().getClass("OGraphEdge").truncate();
>
> For the number of files probably you've a lot of classes. You could use 
> LOGICAL cluster instead of PHYSICAL (default): 
> http://code.google.com/p/orient/wiki/Concepts#Cluster
>
> Lvc@
>
> On 16 December 2010 10:32, Konrad  
> wrote:
>
>> Hi,
>>
>> I'm wondering what is the fastest way of emptying a ODatabaseGraphTx
>> of all vertexes and edges?
>> (would be nice if schema still stays).
>>
>> Actually deleting the database and re-creating it takes quite some
>> time (like 10 sec) (OrientDB deleting and creating a bunch of files on
>> disk).
>>
>>
>>
>> Kind regards,
>> Konrad Eriksson
>> InfraSight Labs AB - Insight Into IT Infrastructure
>> Web:http://www.infrasightlabs.com
>
>
>

-- 

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


[orientdb] Re: How to insert JSON with Java Graph API?

2016-11-22 Thread Academia Learning Centro de inglés y de formación
I do not understand what you mean, sorry.

I created a document to insert a json, but how do I insert this in my 
vertex?

El lunes, 21 de noviembre de 2016, 16:02:08 (UTC+1), alessand...@gmail.com 
escribió:
>
> You could use
>
> alter class yourclass superclasses v
>
>
>

-- 

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