[orientdb] Re: Get element by array in json

2016-12-19 Thread Academia Learning Centro de inglés y de formación

>
> I've got it using
>

select from CompositionVersions "
+ "where (select distinct (id) from (select id, date, events.data.items as 
items "
+ "from (select id, value.data.origin.value as date, value.data.events as 
events "
+ "from (select value.uid.value as id, value.content as value "
+ "from CompositionVersions unwind value) "
+ "where value.archetype_node_id = 
'openEHR-EHR-OBSERVATION.body_temperature.v1' "
+ "and value.data.origin.value >= '2013-01-17' and 
value.data.archetype_node_id ='at0002' unwind events) "
+ "where events.archetype_node_id ='at0003' and 
events.data.archetype_node_id = 'at0001' unwind items) "
+ "where items.archetype_node_id = 'at0004' and items.value.magnitude <= 40 
and items.value.magnitude >= 35 "
+ "and items.value.units !='°F' order by date ASC) "
+ "in value.uid.value

 

-- 

--- 
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 can I complete this query? arrays inside arrays

2016-12-05 Thread Academia Learning Centro de inglés y de formación
So if it works to me (add [0]) but how could I know in which position is 
the array is the temperature field, or how else could I get it?

select value.content.data.events.data.items.value.magnitude*[0]*
from CompositionVersions
where 'Temperature' in value.content.data.events.data.items.name.value


El lunes, 5 de diciembre de 2016, 11:08:03 (UTC+1), Academia Learning 
Centro de inglés y de formación escribió:
>
> Hello guys I have an element with a json value and inside it has several 
> arrays inside arrays.
>
> I want to retrieve the values of the field Temperature *only *of the 
> arrays that are of the temperature type. 
>
> But this query returns all the values with only one of the arrays is of 
> type Temperature.
>
> select value.content.data.events.data.items.value.magnitude 
> from CompositionVersions 
> where 'Temperature' in value.content.data.events.data.items.name.value
>
>
> 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 can I complete this query? arrays inside arrays

2016-12-05 Thread Academia Learning Centro de inglés y de formación
Hello guys I have an element with a json value and inside it has several 
arrays inside arrays.

I want to retrieve the values of the field Temperature *only *of the arrays 
that are of the temperature type. 

But this query returns all the values with only one of the arrays is of 
type Temperature.

select value.content.data.events.data.items.value.magnitude 
from CompositionVersions 
where 'Temperature' in value.content.data.events.data.items.name.value


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] Re: [HELP] find document inside list

2016-12-05 Thread Academia Learning Centro de inglés y de formación
This does not work, I need to find a field inside a json value, which 
inside has more nested fields and values, but I do not know the path

El viernes, 2 de diciembre de 2016, 11:51:36 (UTC+1), user.w...@gmail.com 
escribió:
>
> Hi,
>
> try this:
>
> select from EHR where compositionsList.class contains "composition"
>
> Hope it helps
>
> Regards,
> Michela
>

-- 

--- 
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] find document inside list

2016-12-02 Thread Academia Learning Centro de inglés y de formación
yes are list embedded

El jueves, 1 de diciembre de 2016, 15:03:58 (UTC+1), Oleksandr Gubchenko 
escribió:
>
> What is a type of compositionList? Is it an embedded list?
>
> Il giorno giovedì 1 dicembre 2016 14:27:12 UTC+1, Academia Learning Centro 
> de inglés y de formación ha scritto:
>>
>> Hi, I want to look for a document within a list, but I can not find the 
>> way, I'm trying this but it gives me error
>>
>> *select from object where compositionsList traverse ( class = 
>> 'composition' ),* 
>>
>> but this not working
>>
>> *select from EHR where compositionsList['class'] like 'comp%'*
>>
>> { "object" :{
>>
>> "compositionList" : [
>>{"class" : "composition"},
>>{"class" : "example"}
>>
>> ]
>> }
>>
>

-- 

--- 
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] find document inside list

2016-12-02 Thread Academia Learning Centro de inglés y de formación
not working

El jueves, 1 de diciembre de 2016, 15:06:34 (UTC+1), Oleksandr Gubchenko 
escribió:
>
> Try this one:
>
> select from EHR where 'composition' in compositionList.class
>
> Il giorno giovedì 1 dicembre 2016 15:03:58 UTC+1, Oleksandr Gubchenko ha 
> scritto:
>>
>> What is a type of compositionList? Is it an embedded list?
>>
>> Il giorno giovedì 1 dicembre 2016 14:27:12 UTC+1, Academia Learning 
>> Centro de inglés y de formación ha scritto:
>>>
>>> Hi, I want to look for a document within a list, but I can not find the 
>>> way, I'm trying this but it gives me error
>>>
>>> *select from object where compositionsList traverse ( class = 
>>> 'composition' ),* 
>>>
>>> but this not working
>>>
>>> *select from EHR where compositionsList['class'] like 'comp%'*
>>>
>>> { "object" :{
>>>
>>> "compositionList" : [
>>>{"class" : "composition"},
>>>{"class" : "example"}
>>>
>>> ]
>>> }
>>>
>>

-- 

--- 
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] find document inside list

2016-12-01 Thread Academia Learning Centro de inglés y de formación
Hi, I want to look for a document within a list, but I can not find the 
way, I'm trying this but it gives me error

*select from object where compositionsList traverse ( class = 'composition' 
),* 

but this not working

{ "object" :{

"compositionList" : [
   {"class" : "composition"},
   {"class" : "example"}

]
}

-- 

--- 
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: It is possible to find a field in an array without knowing the path

2016-11-30 Thread Academia Learning Centro de inglés y de formación
Yes, 

select from CompositionsVersions where any() like '%temperature%'

But as the field is inside a value json does not find it, I have tried with 
fields / properties that are not in a json value and if it works




El miércoles, 30 de noviembre de 2016, 23:02:47 (UTC+1), Ivan Mainetti 
escribió:
>
> could you add examples of query you tried?
>
>
> Il giorno mercoledì 30 novembre 2016 12:50:43 UTC+1, Academia Learning 
> Centro de inglés y de formación ha scritto:
>>
>> I need to retrieve all Compositions that have the temperature field but 
>> do not get their path since they are inside nested arrays
>>
>>
>> <https://lh3.googleusercontent.com/-kncu-RQ8o2E/WD69D359uRI/Css/4srQNy7ZjpsRML2OtzJuJRzJoIjEdBS0ACLcB/s1600/Sin%2Bt%25C3%25ADtu3lo.png>
>>
>>

-- 

--- 
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] Re: Mass insertion of vertices very slow, is it necessary Performance Tuning?

2016-11-30 Thread Academia Learning Centro de inglés y de formación
ok but I need to know if there is any way to improve performance

El miércoles, 30 de noviembre de 2016, 12:59:59 (UTC+1), Andrey Lomakin 
escribió:
>
> Once you will have slowdown during insertion of data, just measure size of 
> the database directory.
>
>
> On Wed, Nov 30, 2016 at 10:11 AM Academia Learning Centro de inglés y de 
> formación <learning...@gmail.com > wrote:
>
>> How can I consult that? Is installed on my local hard drive, this has a 
>> capacity of 15.5GB free
>>
>>
>> El miércoles, 30 de noviembre de 2016, 7:59:10 (UTC+1), Andrey Lomakin 
>> escribió:
>>
>>> Hi,
>>>
>> I also need to know the size of  your database on disk.
>>>
>>> On Tue, Nov 29, 2016 at 3:18 PM Aceitunas y encurtidos Quijote <
>>> encurtid...@gmail.com> wrote:
>>>
>> Help
>>>>
>>>>
>>>> El lunes, 28 de noviembre de 2016, 9:02:49 (UTC+1), Aceitunas y 
>>>> encurtidos Quijote escribió:
>>>>>
>>>>> Hi, I have to do a massive insertion of vertices:
>>>>> 1000 vertices type A
>>>>> 100,000 type B vertices
>>>>> With its corresponding edges.
>>>>>
>>>>> But the performance is very slow, never ends, I must permormance 
>>>>> tuning?
>>>>> How should I do it? 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-databa...@googlegroups.com.
>>>
>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> -- 
>>> Best regards,
>>> Andrey Lomakin, R lead. 
>>> OrientDB Ltd
>>>
>>> twitter: @Andrey_Lomakin 
>>> linkedin: https://ua.linkedin.com/in/andreylomakin
>>> blogger: http://andreylomakin.blogspot.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-databa...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
> -- 
> Best regards,
> Andrey Lomakin, R lead. 
> OrientDB Ltd
>
> twitter: @Andrey_Lomakin 
> linkedin: https://ua.linkedin.com/in/andreylomakin
> blogger: http://andreylomakin.blogspot.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: It is possible to find a field in an array without knowing the path

2016-11-30 Thread Academia Learning Centro de inglés y de formación
I have tried with any() but not working

El miércoles, 30 de noviembre de 2016, 12:50:43 (UTC+1), Academia Learning 
Centro de inglés y de formación escribió:
>
> I need to retrieve all Compositions that have the temperature field but do 
> not get their path since they are inside nested arrays
>
>
> <https://lh3.googleusercontent.com/-kncu-RQ8o2E/WD69D359uRI/Css/4srQNy7ZjpsRML2OtzJuJRzJoIjEdBS0ACLcB/s1600/Sin%2Bt%25C3%25ADtu3lo.png>
>
>

-- 

--- 
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] It is possible to find a field in an array without knowing the path

2016-11-30 Thread Academia Learning Centro de inglés y de formación
I need to retrieve all Compositions that have the temperature field but do 
not get their path since they are inside nested arrays



-- 

--- 
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] Re: Mass insertion of vertices very slow, is it necessary Performance Tuning?

2016-11-30 Thread Academia Learning Centro de inglés y de formación
How can I consult that? Is installed on my local hard drive, this has a 
capacity of 15.5GB free

El miércoles, 30 de noviembre de 2016, 7:59:10 (UTC+1), Andrey Lomakin 
escribió:
>
> Hi,
> I also need to know the size of  your database on disk.
>
> On Tue, Nov 29, 2016 at 3:18 PM Aceitunas y encurtidos Quijote <
> encurtid...@gmail.com > wrote:
>
>> Help
>>
>>
>> El lunes, 28 de noviembre de 2016, 9:02:49 (UTC+1), Aceitunas y 
>> encurtidos Quijote escribió:
>>>
>>> Hi, I have to do a massive insertion of vertices:
>>> 1000 vertices type A
>>> 100,000 type B vertices
>>> With its corresponding edges.
>>>
>>> But the performance is very slow, never ends, I must permormance tuning?
>>> How should I do it? 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-databa...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
> -- 
> Best regards,
> Andrey Lomakin, R lead. 
> OrientDB Ltd
>
> twitter: @Andrey_Lomakin 
> linkedin: https://ua.linkedin.com/in/andreylomakin
> blogger: http://andreylomakin.blogspot.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: [HELP] Order by date not working

2016-11-30 Thread Academia Learning Centro de inglés y de formación
Thanks, this works


El martes, 29 de noviembre de 2016, 23:05:48 (UTC+1), Ivan Mainetti 
escribió:
>
> please try with
>
> select value.uid.value as id, value.context.start_time.value as date from 
> CompositionVersions order by date desc limit 5
>
>
>
>
>>

-- 

--- 
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] Order by date not working

2016-11-30 Thread Academia Learning Centro de inglés y de formación
This says the console:

OrientDB console v.2.2.12-SNAPSHOT (build 
2.2.x@r2a76ee1efc4487d9dc5f43e1ddc2fba
1c5a0167c; 2016-10-20 13:55:08+) www.orientdb.com
Type 'help' to display all the supported commands.
Installing extensions for GREMLIN language v.2.6.0



El martes, 29 de noviembre de 2016, 14:39:03 (UTC+1), Oleksandr Gubchenko 
escribió:
>
> Which version are you using?
>
> Il giorno martedì 29 novembre 2016 14:18:25 UTC+1, Academia Learning 
> Centro de inglés y de formación ha scritto:
>>
>> I have tried with this query and I get this results (not ordered):
>>
>> *select value.uid.value as id, value.context.start_time.value as date*
>> *from CompositionVersions order by value.context.start_time.value desc 
>> limit 5*
>>
>> id
>> date
>> fe9e6036
>> 2014-02-23T12:33:10.000+01:00
>> 80eee423
>> 2014-03-08T11:35:25.000+01:00
>> 0600c7bd
>> 2014-01-27T22:49:36.000+01:00
>> 291c1e1e
>> 2014-03-08T04:28:15.000+01:00
>> a8b7d7c9
>> 2014-01-04T03:31:02.000+01:00
>>
>>

-- 

--- 
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] Order by date not working

2016-11-29 Thread Academia Learning Centro de inglés y de formación
I have tried with this query and I get this results (not ordered):

*select value.uid.value as id, value.context.start_time.value as date*
*from CompositionVersions order by value.context.start_time.value desc 
limit 5*

id
date
fe9e6036
2014-02-23T12:33:10.000+01:00
80eee423
2014-03-08T11:35:25.000+01:00
0600c7bd
2014-01-27T22:49:36.000+01:00
291c1e1e
2014-03-08T04:28:15.000+01:00
a8b7d7c9
2014-01-04T03:31:02.000+01:00

-- 

--- 
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: Database is closed Exception

2016-11-24 Thread Academia Learning Centro de inglés y de formación
The last version, I downloaded it recently

El jueves, 24 de noviembre de 2016, 22:51:46 (UTC+1), Oleksandr Gubchenko 
escribió:
>
> Which version are you using?
>
> Il giorno giovedì 24 novembre 2016 14:01:38 UTC+1, Academia Learning 
> Centro de inglés y de formación ha scritto:
>>
>> yes,
>>
>> [com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.makeActive(OrientBaseGraph.java:361),
>>  
>> com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.command(OrientBaseGraph.java:1783),
>>  
>> com.indra.mymed.drm.openehr.test.orientdb.OrientDBOperations.getComposition(OrientDBOperations.java:252),
>>  
>> com.indra.mymed.drm.openehr.test.OpenEHRBaseTest.test4CompositionInsertAndRetrieve(OpenEHRBaseTest.java:137),
>>  
>> com.indra.mymed.drm.openehr.test.orientdb.OrientDBTest.test4CompositionInsertAndRetrieve(OrientDBTest.java:42),
>>  
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57),
>>  
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43),
>>  
>> java.lang.reflect.Method.invoke(Method.java:606), 
>> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50),
>>  
>> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12),
>>  
>> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47),
>>  
>> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17),
>>  
>> org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75),
>>  
>> org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86),
>>  
>> org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84),
>>  
>> org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325), 
>> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252),
>>  
>> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94),
>>  
>> org.junit.runners.ParentRunner$3.run(ParentRunner.java:290), 
>> org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71), 
>> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288), 
>> org.junit.runners.ParentRunner.access$000(ParentRunner.java:58), 
>> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268), 
>> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26),
>>  
>> org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61),
>>  
>> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27), 
>> org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70),
>>  
>> org.junit.runners.ParentRunner.run(ParentRunner.java:363), 
>> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191),
>>  
>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86),
>>  
>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38),
>>  
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459),
>>  
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675),
>>  
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382),
>>  
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)]
>>
>> El jueves, 24 de noviembre de 2016, 13:24:27 (UTC+1), Ivan Mainetti 
>> escribió:
>>>
>>> please post at least the full stacktrace
>>>
>>> Il giorno giovedì 24 novembre 2016 13:03:23 UTC+1, Academia Learning 
>>> Centro de inglés y de formación ha scritto:
>>>>
>>>> In the 2º function when tries to run the command sql, give exception: 
>>>> Database is closed (because in ther first function I have done 
>>>> graph.shutdown();)
>>>>
>>>>
>>>>
>>>> El jueves, 24 de noviembre de 2016, 12:05:38 (UTC+1), Ivan Mainetti 
>>>> escribió:
>>>>>
>>>>> could you post the exception?
>>>>> which part of the code throws it?
>>>>>
>>>>>
>>>>> Il giorno giovedì 24 novembre 2016 11:04:08 UTC+1, Academia Learning 
>>>>> Centro de inglés y de formación ha scritto:
>>>>>>
>>>>>>
>>>>>>

-- 

--- 
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: Database is closed Exception

2016-11-24 Thread Academia Learning Centro de inglés y de formación
In the 2º function when tries to run the command sql, give exception: 
Database is closed

El jueves, 24 de noviembre de 2016, 12:05:38 (UTC+1), Ivan Mainetti 
escribió:
>
> could you post the exception?
> which part of the code throws it?
>
>
> Il giorno giovedì 24 novembre 2016 11:04:08 UTC+1, Academia Learning 
> Centro de inglés y de formación ha scritto:
>>
>> Hello I wanted to ask if I am doing this correctly or am doing something 
>> wrong, I initialize it like this:
>> *Class orientDBService*
>> OrientGraphFactory oFactory = new OrientGraphFactory 
>> (this.databaseURI).setupPool(1,10);;
>> this.graph = oFactory.getTx();
>>
>>
>> Then I have two methods one to create a Vertex and another to recover it
>> public void insertComposition(EhrId ehrId, CompositionData 
>> compositionData) { 
>> OrientGraph graph = orientDBService.getGraph(); 
>> try{ 
>> Vertex compositionVersion = (Vertex) graph.command( new 
>> OCommandSQL("insert into CompositionVersions set value = " + 
>> compositionData.asJSON()) ).execute();
>> 
>> }catch( Exception e ) { 
>> graph.rollback();
>> }finally {
>> graph.shutdown();
>> }
>> }
>>
>>
>> recover function
>> public CompositionData getComposition(String compositionId) {
>> OrientGraph graph = orientDBService.getGraph();
>> Vertex composition = null;
>> try{ 
>> Iterable resultComposition = graph
>> .command( new OCommandSQL("SELECT expand (out('hasVersions')) as 
>> this FROM Composition WHERE idComposition = "5") ).execute();
>> if (resultComposition.iterator().hasNext()){
>> composition = (Vertex) resultComposition.iterator().next();
>> }
>> 
>> }catch( Exception e ) { 
>> graph.rollback();
>> }finally {
>>  graph.shutdown();
>> }
>> 
>> return 
>> CompositionData.fromJSON(composition.getProperty("this").toString());
>> }
>>
>>
>>
>> *This gives me the exception: Database is closed, However if I do not use 
>> graph.shutdown the data is not yet persistent*
>>
>

-- 

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

2016-11-24 Thread Academia Learning Centro de inglés y de formación
 I have the same problem, any solutions?

El miércoles, 23 de noviembre de 2016, 13:28:25 (UTC+1), Luigi Dell'Aquila 
escribió:
>
> Hi,
>
> No, I'm afraid it's not possible in general, the ODocument keeps fields in 
> a map, that by default does not preserve the order
>
> Thanks
>
> Luigi
>
> 2016-11-23 11:42 GMT+01:00 Academia Learning Centro de inglés y de 
> formación <learning...@gmail.com >:
>
>> 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-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.


[orientdb] Database is closed Exception

2016-11-24 Thread Academia Learning Centro de inglés y de formación
Hello I wanted to ask if I am doing this correctly or am doing something 
wrong, I initialize it like this:
*Class orientDBService*
OrientGraphFactory oFactory = new OrientGraphFactory 
(this.databaseURI).setupPool(1,10);;
this.graph = oFactory.getTx();

Then I have two methods one to create a Vertex and another to recover it
public void insertComposition(EhrId ehrId, CompositionData compositionData) 
{
System.out.println("Insertando composition en bbdd");
OrientGraph graph = orientDBService.getGraph();

try{
String idComposition = 
compositionData.getCompositionId().toString().split(":")[0];
Vertex compositionVersion = (Vertex) graph.command( new 
OCommandSQL("insert into CompositionVersions set value = " + 
compositionData.asJSON()) ).execute();

}catch( Exception e ) {
System.out.println("Error: " + e.getMessage());
graph.rollback();
}finally {
graph.shutdown();
}
}

recover function
public CompositionData getComposition(String compositionId) {
OrientGraph graph = orientDBService.getGraph();
Vertex composition = null;
try{
//enlazamos al EHR
Iterable resultComposition = graph
.command( new OCommandSQL("SELECT @this.value.toJson('') FROM ( SELECT 
expand (out('hasVersions')) as this FROM Composition WHERE idComposition = 
'" + compositionId  + "')") ).execute();
if (resultComposition.iterator().hasNext()){
composition = (Vertex) resultComposition.iterator().next();
}

}catch( Exception e ) {
System.out.println("Error: " + e.getMessage());
graph.rollback();
}finally {
// graph.shutdown();
}

return 
CompositionData.fromJSON(composition.getProperty("this").toString());
}


*This gives me the exception: Database is closed, However if I do not use 
graph.shutdown the data is not yet persistent*

-- 

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


[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] 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] 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] 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.


[orientdb] Re: How to get the type of class from a vertex?

2016-11-21 Thread Academia Learning Centro de inglés y de formación
Mm I do not know, I think truncate is more appropriate, but I do not know ..

El lunes, 21 de noviembre de 2016, 13:50:43 (UTC+1), Ivan Mainetti escribió:
>
> what about something like:
>
> Iterable resultIteratorEdges = g.getEdges(true);
> for (Edge e : resultIteratorEdges){
> e.remove();
> }
>
> Iterable resultIteratorVertices = g.getVertices(true);
> for (Vertex v : resultIteratorVertices){
> v.remove();
> }
>
>
>
>
> Il giorno lunedì 21 novembre 2016 11:01:42 UTC+1, Academia Learning Centro 
> de inglés y de formación ha scritto:
>>
>> To not delete all classes / schemas / tables only the records
>>
>> El lunes, 21 de noviembre de 2016, 10:52:38 (UTC+1), Ivan Mainetti 
>> escribió:
>>>
>>> why you don't just delete and recreate the entire db?
>>>
>>> Il giorno lunedì 21 novembre 2016 10:28:55 UTC+1, Academia Learning 
>>> Centro de inglés y de formación ha scritto:
>>>>
>>>> Hello, I want to empty the db and I was testing this way (I do not know 
>>>> if it's the right one)
>>>>
>>>> Iterable resultIteratorVertices = graph.getVertices(true);
>>>> for (Vertex v : resultIteratorVertices){
>>>>graph.command( new OCommandSQL("TRUNCATE CLASS "+ *v.getClass* + " 
>>>> POLYMORPHIC UNSAFE") ).execute();
>>>> }
>>>>
>>>> To remove all records from all classes, but I can not figure out how to 
>>>> get the type of class from each record
>>>>
>>>

-- 

--- 
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-21 Thread Academia Learning Centro de inglés y de formación
How can I convert that document class to graph then? If I can not create 
edges

El jueves, 17 de noviembre de 2016, 15:45:42 (UTC+1), alessand...@gmail.com 
escribió:
>
> Hi, you could try with
>
> OrientGraph g=new OrientGraph(yourPath); 
>   
> ODocument pruebaJson = new ODocument("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.fromJSON("{ 'data' : " + json.toString() + "}");
> pruebaJson.save();
>  
> g.commit();
>
>
>

-- 

--- 
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 type of class from a vertex?

2016-11-21 Thread Academia Learning Centro de inglés y de formación
To not delete all classes / schemas / tables only the records

El lunes, 21 de noviembre de 2016, 10:52:38 (UTC+1), Ivan Mainetti escribió:
>
> why you don't just delete and recreate the entire db?
>
> Il giorno lunedì 21 novembre 2016 10:28:55 UTC+1, Academia Learning Centro 
> de inglés y de formación ha scritto:
>>
>> Hello, I want to empty the db and I was testing this way (I do not know 
>> if it's the right one)
>>
>> Iterable resultIteratorVertices = graph.getVertices(true);
>> for (Vertex v : resultIteratorVertices){
>>graph.command( new OCommandSQL("TRUNCATE CLASS "+ *v.getClass* + " 
>> POLYMORPHIC UNSAFE") ).execute();
>> }
>>
>> To remove all records from all classes, but I can not figure out how to 
>> get the type of class from each record
>>
>

-- 

--- 
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 type of class from a vertex?

2016-11-21 Thread Academia Learning Centro de inglés y de formación
Hello, I want to empty the db and I was testing this way (I do not know if 
it's the right one)

Iterable resultIteratorVertices = graph.getVertices(true);
for (Vertex v : resultIteratorVertices){
   graph.command( new OCommandSQL("TRUNCATE CLASS "+ *v.getClass* + " 
POLYMORPHIC UNSAFE") ).execute();
}

To remove all records from all classes, but I can not figure out how to get 
the type of class from each record

-- 

--- 
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-18 Thread Academia Learning Centro de inglés y de formación
Thanks, I tried it and with the Odocument class it works, but with the 
JSONObject class the same thing is saved this time as an embedded document 
but then I can not retrieve the attributes by query (I attached image)

I've only done it this way, but I do not think it's correct:

OrientGraph g=new OrientGraph(yourPath);   
ODocument pruebaJson = new ODocument("Person");

String jsonValue = 
"{'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.field("name", "nombre de Prueba");
pruebaJson.field("adress", "adress de Prueba");
pruebaJson.fromJSON(jsonValue);

pruebaJson.save();
 
g.commit();




El jueves, 17 de noviembre de 2016, 15:45:42 (UTC+1), alessand...@gmail.com 
escribió:
>
> Hi, you could try with
>
> OrientGraph g=new OrientGraph(yourPath); 
>   
> ODocument pruebaJson = new ODocument("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.fromJSON("{ 'data' : " + json.toString() + "}");
> pruebaJson.save();
>  
> g.commit();
>
>
>

-- 

--- 
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] HELP to Query with json attributes

2016-11-16 Thread Academia Learning Centro de inglés y de formación
I just saw that my doubt is when there is more than one level for example:

select * from CompositeVersion where value.name = "Roberto"
 {
  "nombre": "Roberto",
  "edad": 28
}

It´s ok but:

select * from CompositeVersion where value.name.en = "Roberto"
 {
  "nombre": {
"es": "Roberto",
"en": "Roberto"
  },
  "edad": 28
}

 This no working




El miércoles, 16 de noviembre de 2016, 11:02:39 (UTC+1), Luigi Dell'Aquila 
escribió:
>
> Hi 
>
> That's the right syntax, it's supposed to work fine. 
> Could you please post a simple script to create a db that reproduces the 
> problem?
>
> Thanks
>
> Luigi
>
> 2016-11-16 10:58 GMT+01:00 Academia Learning Centro de inglés y de 
> formación <learning...@gmail.com >:
>
>> Hi,
>>
>> I have this vertex of class CompositeVersion, 
>>
>> How can I get all the vertices whose value has the property name equal to 
>> Laboratory 
>> report? 
>>
>> I had tried with select from CompositeVersion where value.name.value = 
>> 'Laboratory report'  but not working
>>
>> select from CompositeVersion
>> METADATAPROPERTIESIN
>>
>> @rid
>> @version
>> @class
>> name
>> version
>> value
>> Has
>> #25:0 
>> <http://localhost:2480/studio/index.html#/database/EHC_Vertices/browse/edit/25:0>
>> 7
>> CompositeVersion 
>> <http://localhost:2480/studio/index.html#/database/EHC_Vertices/schema/editclass/CompositeVersion>
>> Composicion1-Version1
>> 1
>> {"@class":"COMPOSITION",
>> "
>>
>> *name":{"@class":"DV_TEXT","value":"Laboratory report"*},
>> "uid":{"@class":"OBJECT_VERSION_ID","value":
>> "4288d24d-e176-48ba-b85a-4b80523b07d2::demo::1"},"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"},
>> "archetype_node_id":"openEHR-EHR-COMPOSITION.report-mnd.v1","language":]}
>>
>>
>> -- 
>>
>> --- 
>> 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] HELP to Query with json attributes

2016-11-16 Thread Academia Learning Centro de inglés y de formación
Many thanks luigi I have already found because, in CompositeVersion is 
declared as string and in Person as embedded

That's why i did not work

El miércoles, 16 de noviembre de 2016, 11:02:39 (UTC+1), Luigi Dell'Aquila 
escribió:
>
> Hi 
>
> That's the right syntax, it's supposed to work fine. 
> Could you please post a simple script to create a db that reproduces the 
> problem?
>
> Thanks
>
> Luigi
>
> 2016-11-16 10:58 GMT+01:00 Academia Learning Centro de inglés y de 
> formación <learning...@gmail.com >:
>
>> Hi,
>>
>> I have this vertex of class CompositeVersion, 
>>
>> How can I get all the vertices whose value has the property name equal to 
>> Laboratory 
>> report? 
>>
>> I had tried with select from CompositeVersion where value.name.value = 
>> 'Laboratory report'  but not working
>>
>> select from CompositeVersion
>> METADATAPROPERTIESIN
>>
>> @rid
>> @version
>> @class
>> name
>> version
>> value
>> Has
>> #25:0 
>> <http://localhost:2480/studio/index.html#/database/EHC_Vertices/browse/edit/25:0>
>> 7
>> CompositeVersion 
>> <http://localhost:2480/studio/index.html#/database/EHC_Vertices/schema/editclass/CompositeVersion>
>> Composicion1-Version1
>> 1
>> {"@class":"COMPOSITION",
>> "
>>
>> *name":{"@class":"DV_TEXT","value":"Laboratory report"*},
>> "uid":{"@class":"OBJECT_VERSION_ID","value":
>> "4288d24d-e176-48ba-b85a-4b80523b07d2::demo::1"},"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"},
>> "archetype_node_id":"openEHR-EHR-COMPOSITION.report-mnd.v1","language":]}
>>
>>
>> -- 
>>
>> --- 
>> 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.


[orientdb] Re: HELP to Query with json attributes

2016-11-16 Thread Academia Learning Centro de inglés y de formación
I have created another vertex of the Person class, with the same json value 
and in this case this query if that works

 
  Select * from Person where value.name.value = 'Laboratory report'


But with CompositeVersion no working, i don´t understand

select * from CompositeVersion where value.name.value = 'Laboratory report'

El miércoles, 16 de noviembre de 2016, 10:58:21 (UTC+1), Academia Learning 
Centro de inglés y de formación escribió:
>
> Hi,
>
> I have this vertex of class CompositeVersion, 
>
> How can I get all the vertices whose value has the property name equal to 
> Laboratory 
> report? 
>
> I had tried with select from CompositeVersion where value.name.value = 
> 'Laboratory report'  but not working
>
> select from CompositeVersion
> METADATAPROPERTIESIN
>
> @rid
> @version
> @class
> name
> version
> value
> Has
> #25:0 
> <http://localhost:2480/studio/index.html#/database/EHC_Vertices/browse/edit/25:0>
> 7
> CompositeVersion 
> <http://localhost:2480/studio/index.html#/database/EHC_Vertices/schema/editclass/CompositeVersion>
> Composicion1-Version1
> 1
> {"@class":"COMPOSITION",
> "
>
> *name":{"@class":"DV_TEXT","value":"Laboratory report"*},
> "uid":{"@class":"OBJECT_VERSION_ID","value":
> "4288d24d-e176-48ba-b85a-4b80523b07d2::demo::1"},"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"},
> "archetype_node_id":"openEHR-EHR-COMPOSITION.report-mnd.v1","language":]}
>
>
>

-- 

--- 
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] Edge vs Link, question and help (Example Inside)

2016-11-16 Thread Academia Learning Centro de inglés y de formación
Each EHR will have an EHR_status (without properties) but I do not know if 
it should be an edge or link

El miércoles, 16 de noviembre de 2016, 11:30:20 (UTC+1), Luigi Dell'Aquila 
escribió:
>
> Hi,
>
> What is EHR_Status? Is it a link property? 
> In general the answer is yes, you can mix document and graph models and 
> you should have no problems with this, so I suppose there is something 
> else...
>
> Thanks
>
> Luigi
>
>
> 2016-11-16 11:10 GMT+01:00 Academia Learning Centro de inglés y de 
> formación <learning...@gmail.com >:
>
>> Sorry but I'm a bit confused, a model of graph may have links or always 
>> have edges?
>>
>> I have this model (pic) done with edges, (without properties) but I can 
>> not get for example this:
>> SELECT * FROM EHR WHERE EHR_Status.name = 'Paloma'
>>
>> This does not work, is it because they are not united with vertices if 
>> not with edges?
>>
>>
>> Using this model, how could I get the CompositeVersion whose 
>> EHR_Status.name = 'Paloma'
>>
>> Would it be something like this query?
>> select expand( in() ) from CompositeVersion where ...  
>> EHR_Status.name = 'Paloma'?
>>
>>
>> Thank you so much
>>
>> -- 
>>
>> --- 
>> 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] HELP to Query with json attributes

2016-11-16 Thread Academia Learning Centro de inglés y de formación
Hi Luigi, I attach an export db and an image of the model. Thanks!!

El miércoles, 16 de noviembre de 2016, 11:02:39 (UTC+1), Luigi Dell'Aquila 
escribió:
>
> Hi 
>
> That's the right syntax, it's supposed to work fine. 
> Could you please post a simple script to create a db that reproduces the 
> problem?
>
> Thanks
>
> Luigi
>
> 2016-11-16 10:58 GMT+01:00 Academia Learning Centro de inglés y de 
> formación <learning...@gmail.com >:
>
>> Hi,
>>
>> I have this vertex of class CompositeVersion, 
>>
>> How can I get all the vertices whose value has the property name equal to 
>> Laboratory 
>> report? 
>>
>> I had tried with select from CompositeVersion where value.name.value = 
>> 'Laboratory report'  but not working
>>
>> select from CompositeVersion
>> METADATAPROPERTIESIN
>>
>> @rid
>> @version
>> @class
>> name
>> version
>> value
>> Has
>> #25:0 
>> <http://localhost:2480/studio/index.html#/database/EHC_Vertices/browse/edit/25:0>
>> 7
>> CompositeVersion 
>> <http://localhost:2480/studio/index.html#/database/EHC_Vertices/schema/editclass/CompositeVersion>
>> Composicion1-Version1
>> 1
>> {"@class":"COMPOSITION",
>> "
>>
>> *name":{"@class":"DV_TEXT","value":"Laboratory report"*},
>> "uid":{"@class":"OBJECT_VERSION_ID","value":
>> "4288d24d-e176-48ba-b85a-4b80523b07d2::demo::1"},"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"},
>> "archetype_node_id":"openEHR-EHR-COMPOSITION.report-mnd.v1","language":]}
>>
>>
>> -- 
>>
>> --- 
>> 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.


Example.gz
Description: Binary data


[orientdb] Re: Is it possible to get records without meta-information?

2016-11-16 Thread Academia Learning Centro de inglés y de formación
HELP

El lunes, 14 de noviembre de 2016, 14:27:27 (UTC+1), Academia Learning 
Centro de inglés y de formación escribió:
>
> Can I get records without this parameters?
>
> "@type": "d",
> "@rid": "#21:2",
> "@version": 1,
> "@class": "EHR",
>
> 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] HELP to Query with json attributes

2016-11-16 Thread Academia Learning Centro de inglés y de formación
Hi,

I have this vertex of class CompositeVersion, 

How can I get all the vertices whose value has the property name equal to 
Laboratory 
report? 

I had tried with select from CompositeVersion where value.name.value = 
'Laboratory report'  but not working

select from CompositeVersion
METADATAPROPERTIESIN

@rid
@version
@class
name
version
value
Has
#25:0 

7
CompositeVersion 

Composicion1-Version1
1
{"@class":"COMPOSITION",
"

*name":{"@class":"DV_TEXT","value":"Laboratory report"*},
"uid":{"@class":"OBJECT_VERSION_ID","value":
"4288d24d-e176-48ba-b85a-4b80523b07d2::demo::1"},"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"},
"archetype_node_id":"openEHR-EHR-COMPOSITION.report-mnd.v1","language":]}


-- 

--- 
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: Is it possible to get records without meta-information?

2016-11-15 Thread Academia Learning Centro de inglés y de formación
The problem is that the resulting json with these attributes does not 
validate my application schema.

El lunes, 14 de noviembre de 2016, 15:35:21 (UTC+1), Oleksandr Gubchenko 
escribió:
>
> I think you can't do it, because when you use select you get always back a 
> document("@type": "d",) with its version.
>
> Il giorno lunedì 14 novembre 2016 15:13:25 UTC+1, Academia Learning Centro 
> de inglés y de formación ha scritto:
>>
>> Hi,
>>
>> I have tried, it has worked with some properties and with others, you 
>> would not know why?
>>
>>
>> select * from pueblo
>> {
>> "result": [
>> {
>> "@type": "d",
>> "@rid": "#67:0",
>> "@version": 1,
>> "@class": "pueblo",
>> "name": "malagon"
>> },
>> {
>> "@type": "d",
>> "@rid": "#68:0",
>> "@version": 1,
>> "@class": "pueblo",
>> "name": "pozuelo"
>> },
>> {
>> "@type": "d",
>> "@rid": "#69:0",
>> "@version": 1,
>> "@class": "pueblo",
>> "name": "valenzuela"
>> }
>> ],
>> "notification": "Query executed in 0.038 sec. Returned 3 record(s)"
>> }
>>
>>
>>
>> select expand(@this.exclude('@type','@rid','@version','@class')) from 
>> pueblo
>> {
>> "result": [
>> {
>> "@type": "d",
>> "@version": 1,
>> "name": "malagon"
>>     },
>>         {
>> "@type": "d",
>> "@version": 1,
>> "name": "pozuelo"
>> },
>> {
>> "@type": "d",
>> "@version": 1,
>> "name": "valenzuela"
>> }
>> ],
>> "notification": "Query executed in 0.039 sec. Returned 3 record(s)"
>> }
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> El lunes, 14 de noviembre de 2016, 14:51:48 (UTC+1), Oleksandr Gubchenko 
>> escribió:
>>>
>>> Try this query:
>>>
>>> select expand(@this.exclude('@type','@rid','@version','@class')) from v
>>>
>>>
>>>
>>>
>>> Il giorno lunedì 14 novembre 2016 14:27:27 UTC+1, Academia Learning 
>>> Centro de inglés y de formación ha scritto:
>>>>
>>>> Can I get records without this parameters?
>>>>
>>>> "@type": "d",
>>>> "@rid": "#21:2",
>>>> "@version": 1,
>>>> "@class": "EHR",
>>>>
>>>> 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] Re: Is it possible to get records without meta-information?

2016-11-14 Thread Academia Learning Centro de inglés y de formación
Hi,

I have tried, it has worked with some properties and with others, you would 
not know why?


select * from pueblo
{
"result": [
{
"@type": "d",
"@rid": "#67:0",
"@version": 1,
"@class": "pueblo",
"name": "malagon"
},
{
"@type": "d",
"@rid": "#68:0",
"@version": 1,
"@class": "pueblo",
"name": "pozuelo"
},
{
"@type": "d",
"@rid": "#69:0",
"@version": 1,
"@class": "pueblo",
"name": "valenzuela"
}
],
"notification": "Query executed in 0.038 sec. Returned 3 record(s)"
}

select expand(@this.exclude('@type','@rid','@version','@class')) from pueblo
{
"result": [
{
"@type": "d",
"@version": 1,
"name": "malagon"
},
{
"@type": "d",
"@version": 1,
"name": "pozuelo"
},
{
    "@type": "d",
        "@version": 1,
"name": "valenzuela"
}
],
"notification": "Query executed in 0.039 sec. Returned 3 record(s)"
}




El lunes, 14 de noviembre de 2016, 14:51:48 (UTC+1), Oleksandr Gubchenko 
escribió:
>
> Try this query:
>
> select expand(@this.exclude('@type','@rid','@version','@class')) from v
>
>
>
>
> Il giorno lunedì 14 novembre 2016 14:27:27 UTC+1, Academia Learning Centro 
> de inglés y de formación ha scritto:
>>
>> Can I get records without this parameters?
>>
>> "@type": "d",
>> "@rid": "#21:2",
>> "@version": 1,
>> "@class": "EHR",
>>
>> 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] Is it possible to get records without meta-information?

2016-11-14 Thread Academia Learning Centro de inglés y de formación
Can I get records without this parameters?

"@type": "d",
"@rid": "#21:2",
"@version": 1,
"@class": "EHR",

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] Re: Recover all embedded records in any class

2016-11-10 Thread Academia Learning Centro de inglés y de formación

Hi, I just tried and yes, inheriting from class V, you can get all classes 
City, in the documents model just like in the graphs using the query:
Select expand ($ c)
Let $ a = (select expand from v),
$ B = (select from City),
$ C = unionAll ($ a, $ b)


El jueves, 10 de noviembre de 2016, 9:13:39 (UTC+1), Academia Learning 
Centro de inglés y de formación escribió:
>
> OK thanks. One last question, in the document model, can also be inherited 
> from class V?
> If so then it would be easier to find the city class, right? With the 
> query of the previous example:
> Select expand (City) from v
>
> Or in the document model this is not possible?
>
> Thank you!
>
> El miércoles, 9 de noviembre de 2016, 16:56:00 (UTC+1), 
> alessand...@gmail.com escribió:
>>
>> Hi,
>> you could use this javascript function
>>
>> var db=orient.getDatabase();
>> var classes=db.query('select name from (select expand(classes) from 
>> metadata:schema) where name not in 
>> ["_studio","OUser","OSchedule","E","V","OFunction","OIdentity","OTriggered","ORole","ORestricted","OSequence"]'
>> ); 
>>
>> var result=[];
>>
>> for (var i = 0; i < classes.length; i++) { 
>>var className = classes[i].field('name');
>>if(className=="City"){
>>   var cities=db.query("select from " + className);
>>   for (var j = 0; j < cities.length; j++) { 
>>   result.push(cities[j]);
>>   }
>>}
>>else{
>>   var cities=db.query("select expand(City) from " + className);
>>   for (var j = 0; j < cities.length; j++) { 
>>  result.push(cities[j]);
>>   } 
>>}
>> }
>> return result;
>>
>> Hope it helps.
>>
>>

-- 

--- 
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: Recover all embedded records in any class

2016-11-10 Thread Academia Learning Centro de inglés y de formación
OK thanks. One last question, in the document model, can also be inherited 
from class V?
If so then it would be easier to find the city class, right? With the query 
of the previous example:
Select expand (City) from v

Or in the document model this is not possible?

Thank you!

El miércoles, 9 de noviembre de 2016, 16:56:00 (UTC+1), 
alessand...@gmail.com escribió:
>
> Hi,
> you could use this javascript function
>
> var db=orient.getDatabase();
> var classes=db.query('select name from (select expand(classes) from 
> metadata:schema) where name not in 
> ["_studio","OUser","OSchedule","E","V","OFunction","OIdentity","OTriggered","ORole","ORestricted","OSequence"]'
> ); 
>
> var result=[];
>
> for (var i = 0; i < classes.length; i++) { 
>var className = classes[i].field('name');
>if(className=="City"){
>   var cities=db.query("select from " + className);
>   for (var j = 0; j < cities.length; j++) { 
>   result.push(cities[j]);
>   }
>}
>else{
>   var cities=db.query("select expand(City) from " + className);
>   for (var j = 0; j < cities.length; j++) { 
>  result.push(cities[j]);
>   } 
>}
> }
> return result;
>
> Hope it helps.
>
>

-- 

--- 
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: Recover all embedded records in any class

2016-11-09 Thread Academia Learning Centro de inglés y de formación
Hi, thanks!!

I mean get all the records of the city class just like in the previous 
example but instead of using the graph model using the documents model (the 
classes are not inheriting from V)

El miércoles, 9 de noviembre de 2016, 12:28:28 (UTC+1), 
alessand...@gmail.com escribió:
>
> Hi,
> I think there isn't such command available to get all your documents with 
> a query.
> Could be useful to you a javascript function?
>
> 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: Recover all embedded records in any class

2016-11-09 Thread Academia Learning Centro de inglés y de formación
Thank you,

One last question, if instead of using the graph model, I use the document 
model, where classes do not inherit from V.
How could I do this done previously (get all records embedded and not)? 

El martes, 8 de noviembre de 2016, 15:46:47 (UTC+1), alessand...@gmail.com 
escribió:
>
> Hi,
> you could use this query
>
> select expand($c)
> let $a = ( select expand(City) from v),
> $b = ( select from city ),
> $c = unionAll($a,$b)
>
> 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: Recover all embedded records in any class

2016-11-09 Thread Academia Learning Centro de inglés y de formación


Thank you, very much!!
>

One last question, if instead of using the graph model, I use the document 
model, where classes do not inherit from V.
How could I do this done previously (get all records embedded and not)? 



> El martes, 8 de noviembre de 2016, 15:46:47 (UTC+1), alessand...@gmail.com 
> escribió:
>>
>> Hi,
>> you could use this query
>>
>> select expand($c)
>> let $a = ( select expand(City) from v),
>> $b = ( select from city ),
>> $c = unionAll($a,$b)
>>
>> 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: Recover all embedded records in any class

2016-11-08 Thread Academia Learning Centro de inglés y de formación
Hi, thank you for answering me.
An example:

{
"result": [
{
"@type": "d",
"@rid": "#21:0",
"@version": 1,
"@class": "Curso",
"City": {
"@type": "d",
"@version": 0,
"@class": "City",
"name": "Valenzuela"
},
"name": "curso 1"
},
{
"@type": "d",
"@rid": "#25:0",
"@version": 1,
"@class": "City",
"name": "bolaños"
},
{
"@type": "d",
"@rid": "#26:0",
"@version": 1,
"@class": "City",
"name": "almagro"
},
{
"@type": "d",
"@rid": "#25:0",
"@version": 1,
"@class": "Country",
"City": {
"@type": "d",
"@version": 0,
"@class": "City",
"name": "Madrid"
},
"name": "curso 1"
},
]

}

I want to get all the cities, in total 4.
But I do not know what classes are embedded
I need something like:

Select * from City

Select * from V where @class = 'City'


And get the 4 cities (2 records and 2 embedded)

thanks





El martes, 8 de noviembre de 2016, 13:00:47 (UTC+1), user.w...@gmail.com 
escribió:
>
> Hi,
>
> can you explain it better? 
> can you give me an example of your structure?
>
> Thx in advance.
>
> Regards,
> Michela
>

-- 

--- 
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] Recover all embedded records in any class

2016-11-08 Thread Academia Learning Centro de inglés y de formación
Hello, I wanted to ask a question regarding the inscribed objects.

Is there a way to retrieve all the objects of a class, for example class 
City and retrieve all the City records, including those inscribed in other 
records?


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.