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<OrientVertex> 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.