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

2016-11-23 Thread Academia Learning Centro de inglés y de formación
 Thanks, Could the same be done with the expand function?


SELECT expand (out('hasVersions'))*.toJson()* as this FROM Composition 
WHERE idComposition = '3'





El martes, 22 de noviembre de 2016, 17:11:35 (UTC+1), alessand...@gmail.com 
escribió:
>
> 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.


Re: [orientdb] What is the difference between INSERT and CREATE VERTEX in OrientDB?

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

The only difference is that CREATE VERTX also checks that the target class
is a vertex class. All the rest is exactly the same

Thanks

Luigi


2016-11-23 8:48 GMT+01:00 Jyothis K P :

> What is the difference between INSERT and CREATE VERTEX in OrientDB?
> 
>
> --
>
> ---
> 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] Re: [HELP] Can I retrieve them in the same order in which they were saved?

2016-11-23 Thread Academia Learning Centro de inglés y de formación
I have the same problem

El miércoles, 23 de noviembre de 2016, 12:23:34 (UTC+1), roberto carlos 
diaz justicia escribió:
>
> When I retrieve a json the fields are in different order than when saved
>
> Can I get them back in the same order?
>

-- 

--- 
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] [HELP] Can I retrieve them in the same order in which they were saved?

2016-11-23 Thread roberto carlos diaz justicia
When I retrieve a json the fields are in different order than when saved

Can I get them back in the same order?

-- 

--- 
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] What is the difference between INSERT and CREATE VERTEX in OrientDB?

2016-11-23 Thread Jyothis K P
What is the difference between INSERT and CREATE VERTEX in OrientDB? 


-- 

--- 
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] [HELP] Save fields in different order, (Example)

2016-11-23 Thread Academia Learning Centro de inglés y de formación
When I retrieve a json the fields are in different order than when saved

Can I get them back in the same order?

-- 

--- 
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 get the value of a vertex in json, java graph api?

2016-11-23 Thread Academia Learning Centro de inglés y de formación
Thanks, The problem is that when I use the toJson function, it's adding 
metainformation so I'm not worth it, I have to retrieve the information as 
it is, but I've encapsulated it in the value property

select value from prueba
{"Status":{"otherDetails":{"items":[{"items":[{"name":{"value":"Administrative 
Gender","class":"DV_TEXT"},"value":{"value":"MALE","class":"DV_CODED_TEXT",
"defining_code":{"terminology_id":{"value":"local","class":"TERMINOLOGY_ID"
},"class":"CODE_PHRASE","code_string":"at0009"}},"archetype_node_id":
"at0001","class":"ELEMENT"},{"name":{"value":"Birth Sex","class":"DV_TEXT"},
"value":{"value":"MALE","class":"DV_CODED_TEXT","defining_code":{
"terminology_id":{"value":"local","class":"TERMINOLOGY_ID"},"class":
"CODE_PHRASE","code_string":"at0009"}},"archetype_node_id":"at0002","class":
"ELEMENT"},{"name":{"value":"Vital Status","class":"DV_TEXT"},"value":{
"value":"Alive","class":"DV_CODED_TEXT","defining_code":{"terminology_id":{
"value":"local","class":"TERMINOLOGY_ID"},"class":"CODE_PHRASE",
"code_string":"at0004"}},"archetype_node_id":"at0003","class":"ELEMENT"},{
"name":{"value":"Birth Year","class":"DV_TEXT"},"value":{"magnitude":1981,
"class":"DV_COUNT"},"archetype_node_id":"at0014","class":"ELEMENT"}],"class"
:"CLUSTER","archetype_details":{"class":"ARCHETYPED"}},{"value":{"value":
"43","class":"DV_TEXT"},"archetype_node_id":"at0099","class":"ELEMENT"},{
"value":{"value":"MALE","class":"DV_CODED_TEXT","defining_code":{
"terminology_id":{"value":"local","class":"TERMINOLOGY_ID"},"class":
"CODE_PHRASE","code_string":"M"}},"archetype_node_id":"at0001","class":
"ELEMENT"},{"value":{"value":"1981-08-01T16:39:10.000+01:00","class":
"DV_DATE_TIME"},"archetype_node_id":"at0002","class":"ELEMENT"}],"class":
"ITEM_TREE"},"subjectNamespace":"MyMedEHR","modifiable":true,"subjectId":"1"
,"queryable":true},"ehrId":"2d903575-be12-4334-b1dc-35e3126830ca"}

select value.toJson() from prueba
*{"@type":"d","@version":0,*"status":{"otherDetails":{"items":[{"items":[{
"name":{"value":"Administrative Gender","class":"DV_TEXT"},"value":{"value":
"MALE","class":"DV_CODED_TEXT","defining_code":{"terminology_id":{"value":
"local","class":"TERMINOLOGY_ID"},"class":"CODE_PHRASE","code_string":
"at0009"}},"archetype_node_id":"at0001","class":"ELEMENT"},{"name":{"value":"Birth
 
Sex","class":"DV_TEXT"},"value":{"value":"MALE","class":"DV_CODED_TEXT",
"defining_code":{"terminology_id":{"value":"local","class":"TERMINOLOGY_ID"
},"class":"CODE_PHRASE","code_string":"at0009"}},"archetype_node_id":
"at0002","class":"ELEMENT"},{"name":{"value":"Vital Status","class":
"DV_TEXT"},"value":{"value":"Alive","class":"DV_CODED_TEXT","defining_code"
:{"terminology_id":{"value":"local","class":"TERMINOLOGY_ID"},"class":
"CODE_PHRASE","code_string":"at0004"}},"archetype_node_id":"at0003","class":
"ELEMENT"},{"name":{"value":"Birth Year","class":"DV_TEXT"},"value":{
"magnitude":1981,"class":"DV_COUNT"},"archetype_node_id":"at0014","class":
"ELEMENT"}],"class":"CLUSTER","archetype_details":{"class":"ARCHETYPED"}},{
"value":{"value":"43","class":"DV_TEXT"},"archetype_node_id":"at0099",
"class":"ELEMENT"},{"value":{"value":"MALE","class":"DV_CODED_TEXT",
"defining_code":{"terminology_id":{"value":"local","class":"TERMINOLOGY_ID"
},"class":"CODE_PHRASE","code_string":"M"}},"archetype_node_id":"at0001",
"class":"ELEMENT"},{"value":{"value":"1981-08-01T16:39:10.000+01:00","class"
:"DV_DATE_TIME"},"archetype_node_id":"at0002","class":"ELEMENT"}],"class":
"ITEM_TREE"},"subjectNamespace":"MyMedEHR","modifiable":true,"subjectId":"1"
,"queryable":true},"ehrId":"2d903575-be12-4334-b1dc-35e3126830ca"}








El martes, 22 de noviembre de 2016, 17:11:35 (UTC+1), alessand...@gmail.com 
escribió:
>
> 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] Re: How do I get an embedded Object in a select query using ObjectApi?

2016-11-23 Thread alessandrorota04
Hi,
could you post your code ?

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.