[orientdb] Re: Functions mostly broken in 2.1-rc3 ?

2015-06-03 Thread hartmut bischoff


On Thursday, June 4, 2015 at 12:15:11 AM UTC+2, Ziink A wrote:
>
> I'm not certain but I think there's a bug in Studio that is causing an 
> error with orient.getDatabase()
>
>
> This is what I thought first, too.
Then I tested the feature with the HTTP/REST-API  --- same result – even if 
I change getDatabase to getGraphNoTx, which worked for me in one single 
case:

uri:function/hc_database/myTest
{"result"=>[{"@type"=>"d", "@version"=>0, 
"value"=>"orient.getGraphNoTx().command('sql',\"select name, 
categories.subcategories.contracts from Industries where name containstext 
'ial'\" )"}]}
---



 

-- 

--- 
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: Functions mostly broken in 2.1-rc3 ?

2015-06-03 Thread Ziink A
I'm not certain but I think there's a bug in Studio that is causing an 
error with orient.getDatabase()

On Wednesday, June 3, 2015 at 1:32:40 PM UTC-7, hartmut bischoff wrote:
>
> Hi alltogether,
>
> is the feature of storing Funtions in the Database still usable?
>
> I followed documentation and got completely lost.
>
> First: I fired a simple SQL-Query
>
> Schema:  contracts [n<-link->1] subcategories  [n<-link->1] categories 
> [n<-link->1] industries
>
> To query all contracts belonging to a single industry, (just as in a 
> oldschool-sql-db) one can write
>
>  select name categories.subcategories.contracts from Industries  where 
> name containstext   'ial'
>
> which obviously returns an Array : 
>
> #"Basic 
> Materials", "categories"=>[["#21:1"]], "version"=>0, "cluster"=>"-2", 
> "record"=>"0", "fieldTypes"=>"null=e", "created_at"=>2015-06-02 14:11:46 
> +0200, "updated_at"=>2015-06-02 14:11:46 +0200}>
> #"Financial", 
> "categories"=>[["#21:2"]], "version"=>0, "cluster"=>"-2", "record"=>"1", 
> "fieldTypes"=>"null=e", "created_at"=>2015-06-02 14:11:46 +0200, 
> "updated_at"=>2015-06-02 14:11:46 +0200}>
> #"Industrial", 
> "categories"=>[["#23:0", "#23:1"]], "version"=>0, "cluster"=>"-2", 
> "record"=>"2", "fieldTypes"=>"null=e", "created_at"=>2015-06-02 14:11:46 
> +0200, "updated_at"=>2015-06-02 14:11:46 +0200}>
>
> So far, so good – the query is working perfect.
>
> Then I put the same query into a function:
> ( in Studio: )
> return orient.getDatabase().query("select name, 
> categories.subcategories.contracts from Industries  where name containstext 
> 'ial'");
> and saved it as »getContracts«
>
> But when I tried to fetch the result via REST I got:
>
> uri: function/hc_database/getContracts
> {"result":[{"@type":"d","@version":0,"value":"orient.getDatabase().query(\"select
>  
> name, categories.subcategories.contracts from Industries  where name 
> containstext 'ial'\")"}]}
>
> just the copy of the query-text
>
>
> It turned better.
>
> I switched to javascript:
>
> var gdb = orient.getDatabase();
>
> return gdb.command( "sql", "select name 
>
> ---> "code": 400,
> "reason": "Bad request",
> "content": "Error on parsing script at position #0: Error on 
> execution of the script\nScript: 
> allCategories\n--^\nsun.org.mozilla.javascript.WrappedException: 
> Wrapped 
> com.orientechnologies.orient.core.exception.OConfigurationException: No 
> database instance found in context (#10) in  source> at line number 10\nWrapped 
> com.orientechnologies.orient.core.exception.OConfigurationException: No 
> database instance found in context (#10)\nNo database 
> instance found in context"
>
> Ups.
>
> As only solution which works, I found 
>
> language: Javascript
> Database-Instance by getGraphNoTx()
>
> To me the consequences of using getGraphNoTx are not clear. The strange 
> behavior of the function-part should be noted as big bug in the 
> development-Version .
> strange. 
>
>
> (I am using the current stable 2.0 Version of OrientDB)
>
> Hartmut
>

-- 

--- 
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] Functions mostly broken in 2.1-rc3 ?

2015-06-03 Thread hartmut bischoff
Hi alltogether,

is the feature of storing Funtions in the Database still usable?

I followed documentation and got completely lost.

First: I fired a simple SQL-Query

Schema:  contracts [n<-link->1] subcategories  [n<-link->1] categories 
[n<-link->1] industries

To query all contracts belonging to a single industry, (just as in a 
oldschool-sql-db) one can write

 select name categories.subcategories.contracts from Industries  where name 
containstext   'ial'

which obviously returns an Array : 

#"Basic 
Materials", "categories"=>[["#21:1"]], "version"=>0, "cluster"=>"-2", 
"record"=>"0", "fieldTypes"=>"null=e", "created_at"=>2015-06-02 14:11:46 
+0200, "updated_at"=>2015-06-02 14:11:46 +0200}>
#"Financial", 
"categories"=>[["#21:2"]], "version"=>0, "cluster"=>"-2", "record"=>"1", 
"fieldTypes"=>"null=e", "created_at"=>2015-06-02 14:11:46 +0200, 
"updated_at"=>2015-06-02 14:11:46 +0200}>
#"Industrial", 
"categories"=>[["#23:0", "#23:1"]], "version"=>0, "cluster"=>"-2", 
"record"=>"2", "fieldTypes"=>"null=e", "created_at"=>2015-06-02 14:11:46 
+0200, "updated_at"=>2015-06-02 14:11:46 +0200}>

So far, so good – the query is working perfect.

Then I put the same query into a function:
( in Studio: )
return orient.getDatabase().query("select name, 
categories.subcategories.contracts from Industries  where name containstext 
'ial'");
and saved it as »getContracts«

But when I tried to fetch the result via REST I got:

uri: function/hc_database/getContracts
{"result":[{"@type":"d","@version":0,"value":"orient.getDatabase().query(\"select
 
name, categories.subcategories.contracts from Industries  where name 
containstext 'ial'\")"}]}

just the copy of the query-text


It turned better.

I switched to javascript:

var gdb = orient.getDatabase();

return gdb.command( "sql", "select name 

---> "code": 400,
"reason": "Bad request",
"content": "Error on parsing script at position #0: Error on 
execution of the script\nScript: 
allCategories\n--^\nsun.org.mozilla.javascript.WrappedException: 
Wrapped 
com.orientechnologies.orient.core.exception.OConfigurationException: No 
database instance found in context (#10) in  at line number 10\nWrapped 
com.orientechnologies.orient.core.exception.OConfigurationException: No 
database instance found in context (#10)\nNo database 
instance found in context"

Ups.

As only solution which works, I found 

language: Javascript
Database-Instance by getGraphNoTx()

To me the consequences of using getGraphNoTx are not clear. The strange 
behavior of the function-part should be noted as big bug in the 
development-Version .
strange. 


(I am using the current stable 2.0 Version of OrientDB)

Hartmut

-- 

--- 
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] The vertex has been deleted

2015-06-03 Thread Mohammad Naghavi
I'm experiencing a very strange behaviour when using the in-memory 
database. I'm using the graph java api and v2.0.10 of orientdb.
I have some code similar to following:

OrientGraph graph = graphFactory.getTx();

graph.executeOutsideTx(noTx -> {
noTx.createVertexType("test");
return null;
});

OrientVertex vertex = graph.addVertex("class:test");

OrientGraph graph2 = graphFactory.getTx();

vertex.setProperty("test", "value");

this code throws the following exception on the last line:

Exception in thread "main" java.lang.IllegalStateException: The vertex 
#11:-2 has been deleted
at 
com.tinkerpop.blueprints.impls.orient.OrientElement.setProperty(OrientElement.java:177)
at test.main(test.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

from what I understand out of documentation, the second call to factory 
should simply start a sub-transaction and should not interfere with the 
first instance as long as they both run on the same thread. 

interesting is that this does not happen when I use a remote database, 
however I'm using the memory db for testing and remote db is too slow for 
running my tests as it should be cleaned up and created each time. 

Is there something special about in-memory db?

-- 

--- 
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] Are Linkset's -entries robust?

2015-06-03 Thread hartmut bischoff

On Wednesday, June 3, 2015 at 5:12:24 PM UTC+2, Emanuele wrote:
>
>  In case of LINKLIST the order is maintened, the LINKSET not maintain the 
> order.
>

Thanks,

I just checked ... It loads an Array of RID-items and returns the same. 
Perfect   

-- 

--- 
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: Traverse and retrieve edges

2015-06-03 Thread Dan Fellars
HI Guilia - thanks for the reply.  Yes, that will do the job.  I had seen 
the inE(), outE() functions used in examples but never saw any 
documentation of what they were used for.  Now they make sense and exactly 
what I was looking for.

Thanks for the help!

Dan

On Wednesday, June 3, 2015 at 6:37:35 AM UTC-6, Giulia Brignoli wrote:
>
> Hi Dan,
>
> try this query: 
>
> select @rid as RidAccount, name, $path, $depth, outE().@rid as RidLink, 
> outE().link_quality as LinkQuality from (traverse out('link') from #14:14)
>
> Bye, Giulia
>
> Il giorno martedì 2 giugno 2015 00:24:21 UTC+2, Dan Fellars ha scritto:
>>
>> OrientDB noob,  having trouble with traverse and can't see any answers.
>>
>> Lets say you have a vertex called 'Account' and a Edge called 'Link'. 
>>  Account has just a 'name' property.  Link has  a link_quality property and 
>> in/out both reference the Account.
>>
>>
>> I can successfully traverse an account, but how do I collect edge 
>> information along with each item?
>>
>> This is what I'm using:
>> select @rid, name, $path, $depth from (traverse out('link') from #14:14) 
>>  //#14:14 is my starting account
>>
>>
>> how can I also get the link.@rid, link.link_quality for each row?
>>
>>
>>
>>

-- 

--- 
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: Does the AVG() method supports some parameter to return decimal values as well?

2015-06-03 Thread alessandrorota04
Hi,
if your rating is an integer variable, the method avg() will return an 
integer value. So either you change the type of the variable, or use this 
query
select AVG(rating.asFloat()) from Ratings

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: Complex query

2015-06-03 Thread SavioL
Hi Andrey,
i'm sorry for the name in the previous answers, I do some test then I tell 
you...

regards,
Luigi S.

-- 

--- 
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: Does the AVG() method supports some parameter to return decimal values as well?

2015-06-03 Thread Giulia Brignoli
Hi,



Il giorno mercoledì 3 giugno 2015 17:13:29 UTC+2, acsandeep ha scritto:
>
> Hi i am using OrientDB version 2.0.8 and as far as i can see the AVG() 
> method only returns the integer part of the result and discards the decimal 
> part.
>
> Would be helpful if it supports an optional param:
>
> Select AVG(rating, true) from Ratings will return the decimal part as well.
>
>
> Regards
> Sandeep
>
>

-- 

--- 
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] Does the AVG() method supports some parameter to return decimal values as well?

2015-06-03 Thread acsandeep
Hi i am using OrientDB version 2.0.8 and as far as i can see the AVG() 
method only returns the integer part of the result and discards the decimal 
part.

Would be helpful if it supports an optional param:

Select AVG(rating, true) from Ratings will return the decimal part as well.


Regards
Sandeep

-- 

--- 
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] Are Linkset's -entries robust?

2015-06-03 Thread Emanuel
In case of LINKLIST the order is maintened, the LINKSET not maintain the 
order.


by the way in a LINKLIST  you can add only LINKS

On 03/06/15 14:58, hartmut bischoff wrote:

Hi altogether,

I just discovered that its very easy to populate a linkset just by 
assigning an array of Record (or Vertex)-Links to it.


Unfortunatly I don't know enough java -

In ruby, hashes and arrays are robust ie:

a=  Array.new
a << 9
a << 3
a << 'z'

gives always [9,3,'z'], thus an explizit index can be avoided if no 
array-transformation is performed.


If I store a list of  RID's to the Database, and later retrieve the 
hole document, is the sequence of array-elements always maintained


or do I have to use a separate Index-field?




--

---
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: can't access record in ajax using orientdb-php

2015-06-03 Thread Prashant Mishra
i'm facing same problem while json_encode suggest me what to do
 

On Tuesday, April 22, 2014 at 7:23:34 PM UTC+5:30, jaya raj wrote:
>
> hi,
> 
> I can't access data of oreintdb record in ajax
>
>the below code i used
>
> *  server side code*
>  
>  try {
> $this->odb = new OrientDB('localhost',2424);
> $connect = $this->odb->connect('gms', 'gms123');
> $clusters = $this->odb->DBOpen('gms', 'gms', 'gms123');
> $records = $this->odb->query("select * from coupon_package where 
> is_deleted = 0");
> echo (json_encode($records));
>}catch (OrientDBException $e) {
>  die("internal");
>   }
>
> *response:*
> 
>
> [{"type":"d","version":1,"data":{}},{"type":"d","version":1,"data":{}},{"type":"d","version":1,"data":{}},{"type":"d","version":4,"data":{}}]
>
>
> *javascript code:*
>
> $http({
> url: baseurl + 'welcome/getPackages',
> method: "GET",
> datatype:"JSON",
>   }).success(function (pakagelist) { 
>  
>  alert(pakagelist[0].version);
>  alert(pakagelist[0].data.amount);
> });
>
>
>
> *the above java script code i can access version of the response json 
> array but i can`t access data values. pls help me *
>
>

-- 

--- 
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] Trying to emulate a directory structure

2015-06-03 Thread David Brown
Luigi,
Thanks for your reply.  My problem came from the way my code evolved and 
not understanding that you couldn't use labels AND heavy-weight edges.  I 
had originally started with lightweight edges and was actively using the 
'label' of the edge to represent information - in this case, the sub-path. 
 Then, when I migrated to heavyweight edges, in order to add more 
information about the edge itself, my assumption was that I could continue 
to use the 'label' in the way I had used it before.  

In your example, the sub-path is a property of the vertex , i.e. set name = 
'SubDir1'.  For items that are referenced that aren't directories that 
doesn't work. Like if I wanted to put a car in a directory but name it 
'MyCar'.  'MyCar' isn't a property of the car, its a property of the edge. 
 I was just trying to use the label to represent that instead of making it 
a property of the edge itself. The edge will have other properties too - 
that's why I wanted heavy-weight edges - so making the sub-path a property 
of the edge is a reasonable thing to do.

Thanks again for your assistance.

On Wednesday, June 3, 2015 at 4:32:49 AM UTC-7, Luigi Dell'Aquila wrote:
>
>
> Hi David,
>
> I'm not sure I understood your problem... are you having problems in 
> defining 1..N relationships with edges?
> If it's the case, you can just avoid to define schema for edge links and 
> the graph engine will do the job for you.
> Eg. 
>
> CREATE VERTEX Directory set name = 'ParentDir' 
> #12:0
>
> CREATE VERTEX Directory set name = 'SubDir1'
> #12:1
>
> CREATE VERTEX Directory set name = 'SubDir2'
> #12:2
>
> CREATE EDGE Child from #12:0 to #12:1
> CREATE EDGE Child from #12:0 to #12:2
>
>
> this way you will have two "Child" edges for the "ParentDir" directory, 
> pointing to two different subdirs
>
> Luigi
>
>
>
> 2015-06-02 4:41 GMT+02:00 David Brown >
> :
>
>> I'm hoping that someone can help recommend the correct configuration of 
>> classes to achieve this goal in OrientDB (running 2.1-rc3 at the moment).
>> My interface is through the Java Graph API.
>>
>> I want to have a vertex that is a directory.  I want to have multiple 
>> edge relationships between a directory, its sub-directories and the 
>> 'contents' of the directory.  When i was prototyping with light-weight 
>> edges, things were fine because the problem domain dictated the the label 
>> for each entry in the directory (and therefor the label for each edge) was 
>> unique.  But I would really like to have heavy-weight edges that capture 
>> more information about the nature of the directory entry (when it was 
>> created, and by whom for example).
>>
>> I am trying to use Schema-Hybrid mode for this directory object.  There 
>> are some defined properties, but the edges that get created will be 
>> extremely varied, potentially referencing any other vertex class in my 
>> system.
>>
>> When I tried this, I ran into the problem that an edge classNname and its 
>> label are conflated, and it seems impossible to set a label for a 
>> heavy-weight edge that is something other than its class name (this seems 
>> by design in the code and is mentioned in the docs).
>>
>> Then, it seems, by default, that an edge relationship is OType.LINK by 
>> default, so, if the labels are not unique, I will only get one instance of 
>> a relationship with each class - adding another entry over writes the first 
>> entry.  (Is this true or am I doing something wrong?)
>>
>> Now, I could go and create edge properties for a given type and create an 
>> edgeProperty that is of OType.LINKBAG.  Unfortunately, as I said, I could 
>> have multiple instance of just about any vertex class in my system stored 
>> in the directory, so I don't want to have to define edgeProperties for 
>> every potential class that could be stored in a directory.
>>
>> Thank you for any advice or corrections.  I'm also very interested in the 
>> reason behind forcing the labels to be the same as the class name.
>>
>> Dave
>>
>> -- 
>>
>> --- 
>> 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: Complex query

2015-06-03 Thread Andrey Yesyev
Hi SavioL,

It's not Ziink was asking it's me.
Thanks a lot for your answer, I'll try it shortly. This is quite a work 
you've done right there, I do appreciate it.

I have concerns regarding performance of this query on large sets of data...
And I still need to add one tweak, I don't know how many other vertices V1 
is connected to (either by in or out connection). So I need to traverse ALL 
its connection and calculate those number for each found vertex that is 
connected to some V1.

I was hoping to get any input from orientdb devs on this, unfortunately 
they keep being unresponsive.

On Wednesday, June 3, 2015 at 10:00:10 AM UTC-4, SavioL wrote:
>
> Hi Ziink,
>
> the result you were looking for, is return with (not easy:) query:
>
> select name, sum from (select expand($totale) 
> let $v2 = (select name, sum(sum) from (
> select expand($c) let $a = (select name, sum(count) from (select name, 
> count(*) from (select expand(out("Related")) from Vertex where name="V1") 
> group by name) group by name ), $b = (select name, sum(count) from (select 
> name, count(*) from (select expand(in("Related")) from Vertex where 
> name="V1") group by name) group by name ), $c = unionAll( $a, $b ) ) where 
> name = "V2"), 
> $v3 = (select name, sum(sum) from (
> select expand($c) let $a = (select name, sum(count) from (select name, 
> count(*) from (select expand(out("Related")) from Vertex where name="V1") 
> group by name) group by name ), $b = (select name, sum(count) from (select 
> name, count(*) from (select expand(in("Related")) from Vertex where 
> name="V1") group by name) group by name ), $c = unionAll( $a, $b ) ) where 
> name = "V3"), 
> $totale = unionAll( $v2, $v3 ))
>
> the result is:
>
>
> 
>

-- 

--- 
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] Time Series Last Node Link

2015-06-03 Thread Enrico Di Marco
Hi there,
is there any sample code or gist that show how to create a function wich 
handle time serie with graph api triggered by vertex creation?

i think this is a common pattern

thank you

Il giorno mercoledì 3 giugno 2015 15:55:43 UTC+2, Luigi Dell'Aquila ha 
scritto:
>
> Hi Thomas,
>
> it depends on following factors:
> - do you need bi-directional traversal? In case an edge is better
> - do you plan to store information on the links? in case an edge is 
> better; in case not, with linkset you will save some space and performance
> - do you plan to delete events? In case you do, graph API will remove 
> hanging edges for you
>
> Luigi
>
>
> 2015-06-03 0:14 GMT+02:00 Thomas Kennedy  >:
>
>> I have a time series modelled in the graph way
>>
>> year(linkmap)->month(linkmap)->day(linkmap)->hour(linkmap)
>>
>> I have two other vertices which are events and users
>>
>> I want to join events to the time series. Is this best achieved by using 
>> an edge or a linkset? 
>>
>> year(linkmap)->month(linkmap)->day(linkmap)->hour(linkmap)-> ?Edge|Linkset? 
>> Event -> User
>>
>>  -- 
>>
>> --- 
>> 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: Traverse all Vertecies without removing duplicates (orientdb-community-2.0)

2015-06-03 Thread SavioL
Hi Emin,

this is JavaScript function that you were looking for:

var gdb = orient.getGraphNoTx();
var list = gdb.command( "sql", "select expand(in('link_to_school')) from 
Scuola");

var start;
var scuola;
var lista;
var end;
var loadlist = 0;

var nomepersona
var nomescuola

for(i=0; i "+ 
nomescuola[0].getProperty("nameschool") +"; ";

  } else {
 nomepersona =  gdb.command( "sql",  "select name from persona where 
@rid='"+start+"' ");
 nomescuola =  gdb.command( "sql",  "select nameschool from scuola 
where @rid='"+end+"' ");

lista = lista + nomepersona[0].getProperty("name") +" --> "+ 
nomescuola[0].getProperty("nameschool") +"; ";
  } 
  
}

return lista;


The result returned is




Regards,

Luigi S.

-- 

--- 
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] Mailing List

2015-06-03 Thread Fabio Ricci
Hi

is there a way to get an answer of my 4 issues?

Please tell me whether I was asking too much.

I do not see any of my mails any more in this mailing list.

Thank you

-- 

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


signature.asc
Description: OpenPGP digital signature


[orientdb] Re: Complex query

2015-06-03 Thread SavioL
Hi Ziink,

the result you were looking for, is return with (not easy:) query:

select name, sum from (select expand($totale) 
let $v2 = (select name, sum(sum) from (
select expand($c) let $a = (select name, sum(count) from (select name, 
count(*) from (select expand(out("Related")) from Vertex where name="V1") 
group by name) group by name ), $b = (select name, sum(count) from (select 
name, count(*) from (select expand(in("Related")) from Vertex where 
name="V1") group by name) group by name ), $c = unionAll( $a, $b ) ) where 
name = "V2"), 
$v3 = (select name, sum(sum) from (
select expand($c) let $a = (select name, sum(count) from (select name, 
count(*) from (select expand(out("Related")) from Vertex where name="V1") 
group by name) group by name ), $b = (select name, sum(count) from (select 
name, count(*) from (select expand(in("Related")) from Vertex where 
name="V1") group by name) group by name ), $c = unionAll( $a, $b ) ) where 
name = "V3"), 
$totale = unionAll( $v2, $v3 ))

the result is:



-- 

--- 
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] Are Linkset's -entries robust?

2015-06-03 Thread hartmut bischoff
Hi altogether,

I just discovered that its very easy to populate a linkset just by 
assigning an array of Record (or Vertex)-Links to it.

Unfortunatly I don't know enough java - 

In ruby, hashes and arrays are robust ie:  

a=  Array.new
a << 9 
a << 3
a << 'z'

gives always [9,3,'z'], thus an explizit index can be avoided if no 
array-transformation is performed.

If I store a list of  RID's to the Database, and later retrieve the hole 
document, is the sequence of array-elements always maintained 

or do I have to use a separate Index-field? 




-- 

--- 
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] Time Series Last Node Link

2015-06-03 Thread Luigi Dell'Aquila
Hi Thomas,

it depends on following factors:
- do you need bi-directional traversal? In case an edge is better
- do you plan to store information on the links? in case an edge is better;
in case not, with linkset you will save some space and performance
- do you plan to delete events? In case you do, graph API will remove
hanging edges for you

Luigi


2015-06-03 0:14 GMT+02:00 Thomas Kennedy :

> I have a time series modelled in the graph way
>
> year(linkmap)->month(linkmap)->day(linkmap)->hour(linkmap)
>
> I have two other vertices which are events and users
>
> I want to join events to the time series. Is this best achieved by using
> an edge or a linkset?
>
> year(linkmap)->month(linkmap)->day(linkmap)->hour(linkmap)-> ?Edge|Linkset? 
> Event -> User
>
>  --
>
> ---
> 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: Newbiew SQL Question

2015-06-03 Thread nagaraja sosale ramaswamy
select * from Issue fetchPlan:-1


On Monday, June 1, 2015 at 12:10:14 PM UTC+5:30, SavioL wrote:
>
> Hi Sean,
>
> perhaps this is the query you were looking for:
>
> - insert with json parameters
> INSERT INTO PersonJson (my_prop) values ({"name": "James", "age": 23})
>
> - get parameters in json format
> SELECT my_prop FROM PersonJson  --> Result:  {"age":23,"name":"James"}
>
> Bye,
> Luigi S.
>
> Il giorno sabato 30 maggio 2015 17:54:49 UTC+2, Sean ha scritto:
>>
>> I'm just not getting this. I can do simple querys as long as everythings 
>> in the same document or vertex, the second I have an edge or a #R:ID 
>> instead of an actual value..I'm flat on my face. For example;
>>
>> I've set up a very simple two class, one entry each Document 
>> Database(I've got a second identical graph database set up with Vertices 
>> and Edges instead)
>>
>> First Class is Issue with one Record(using my old comic book collection 
>> as data) so, and I'm using  the Web Studio to see the Raw JSON data returned
>>
>> Select * from Issue 
>>
>> results in..
>>
>> }
>>
>> "@type": "d",
>> "@rid": "#10:0",
>> "@version": 8,
>> "@class": "Issue",
>> "issue_number": 1,
>> "issue_name": "Man of Steel",
>> "publisher": "#11:0"
>> }
>>
>>
>> and the same for publishers..
>>
>>  {
>> "@type": "d",
>> "@rid": "#11:0",
>> "@version": 5,
>> "@class": "publisher",
>> "name": "DC Comics"
>> }
>>
>>
>>
>> So what I'm trying to do is get the "Select from * issue" JSON to display 
>> something like  this...
>>
>> }
>>
>> "@type": "d",
>> "@rid": "#10:0",
>> "@version": 8,
>> "@class": "Issue",
>> "issue_number": 1,
>> "issue_name": "Man of Steel",
>> "publisher": "#11:0"
>> "name": "DC Comics"
>> }
>>
>>
>> Which is what I need to start playing around with the web site side or 
>> things, getting JSON queries and displaying them.
>>
>> Which seems like it should be the EASIEST THING IN THE WORLD TO DO. But 
>> I've spend hours trying to suss this out, numerous reads of the 
>> documentation, google searches up the wazoo..nothing. I'm 99% certain the 
>> records ARE joined, because in Studio when I do the "select * from issue* 
>> query, the result shows the #11:0 RID and I can click it to open the 
>> property's of #11:0. However I just cannot figure out how to query through 
>> it by SQL and get the contained information.
>>
>>
>>

-- 

--- 
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] Understanding the basic database types and how vertices and edges work

2015-06-03 Thread scott molinari
Hi,

I just want to be sure I understand the basics correctly. 

If I create a database as a document type, I cannot use vertices or edges. 
But, if I create a database as a graph type, I can, and I must use vertices 
as documents and create the relations between them with edges? 

If that is true, is there really any reason to use the document type 
database?

>From what I understand, traversing edges is very fast? So, let's say I have 
a need to retrieve a vertex, but also data from another vertex, which might 
be 3 edges away. ( I hope I am also using the right terminology here.) 
Would this kind of data gathering among edge relations be a correct use 
case? Could it be done relatively quickly for 1000's of results at a time?

Scott

-- 

--- 
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: Where's the github repository for the docs?

2015-06-03 Thread nagaraja sosale ramaswamy
try clicking on the 'wiki' link on 
https://github.com/orientechnologies/orientdb-docs


On Monday, June 1, 2015 at 7:47:00 PM UTC+5:30, Ziink A wrote:
>
> https://github.com/orientechnologies/orientdb-docs is empty.

-- 

--- 
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: OrientDB ETL tool

2015-06-03 Thread James Wang
Just wanna to share:

If run in stand alone (i.e. server.sh&), I managed to import 2500 vertices 
per seconds - 12 times quicker than running in the distributed mode 
(dserver.sh&)

Great.
:-D

On Friday, 29 May 2015 12:18:31 UTC+1, James Wang wrote:
>
> Hi All,
>
> I am new to OrientDB and trying to import data from a CSV file using the 
> ETL tool.
>
> Do I need to stop the OrientDB server firstly please?
> Please help.
>
> Thanks a lot in advance
> James
>

-- 

--- 
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: Sources for orientdb community 2.0.10

2015-06-03 Thread nagaraja sosale ramaswamy
you need to look for the tag 2.0.10, not branch.


On Wednesday, June 3, 2015 at 2:01:39 AM UTC+5:30, Andrey Yesyev wrote:
>
> Never mind, found them 
> https://github.com/orientechnologies/orientdb/releases
>
> On Tuesday, June 2, 2015 at 4:19:36 PM UTC-4, Andrey Yesyev wrote:
>>
>> How to get sources for the latest stable release 2.0.10.
>>
>> I looked at git, there is no specific branch for 2.0.10, I ended up 
>> getting 2.0.x, which doesn't fit to binaries from 2.0.10.
>>
>

-- 

--- 
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: Traverse and retrieve edges

2015-06-03 Thread Giulia Brignoli
Hi Dan,

try this query: 

select @rid as RidAccount, name, $path, $depth, outE().@rid as RidLink, 
outE().link_quality as LinkQuality from (traverse out('link') from #14:14)

Bye, Giulia

Il giorno martedì 2 giugno 2015 00:24:21 UTC+2, Dan Fellars ha scritto:
>
> OrientDB noob,  having trouble with traverse and can't see any answers.
>
> Lets say you have a vertex called 'Account' and a Edge called 'Link'. 
>  Account has just a 'name' property.  Link has  a link_quality property and 
> in/out both reference the Account.
>
>
> I can successfully traverse an account, but how do I collect edge 
> information along with each item?
>
> This is what I'm using:
> select @rid, name, $path, $depth from (traverse out('link') from #14:14) 
>  //#14:14 is my starting account
>
>
> how can I also get the link.@rid, link.link_quality for each row?
>
>
>
>

-- 

--- 
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: Complex query

2015-06-03 Thread nagaraja sosale ramaswamy
see if this helps:

select v,sum(count) from (select if(eval("in=#11:0"),out,in) as v,count 
from E where in=#11:0 or out=#11:0) group by v


~nagu.

On Wednesday, June 3, 2015 at 5:15:52 PM UTC+5:30, Andrey Yesyev wrote:
>
> Thanks Nagu!
>
> But I also need to group by vertices I related to.
>
> On 3 June 2015 at 07:02, nagaraja sosale ramaswamy  > wrote:
>
>> select sum(count) from RELATED where in = #11:0 or out = #11:0 
>>
>>
>> hope that helps...
>> ~nagu.
>>
>>
>> On Wednesday, June 3, 2015 at 2:26:24 PM UTC+5:30, SavioL wrote:
>>>
>>> Hi Ziink,
>>>
>>> I created V1 and V2, and i linked them so:
>>>
>>> V1 -->related --> V2  
>>> V1 -->related --> V2  
>>> V1 -->related --> V2  
>>> V2 -->related --> V1  
>>> V2 -->related --> V1  
>>>
>>> so i have 3 link from V1 to V2, and 2 link from V2 to V1.
>>>
>>> With this query:   select count(*) FROM Related LET $c = in.size()
>>> i get Count = 5. (five is number of total link with V1 and V2)
>>>
>>> i hope is this the answer you were looking for..
>>>
>>> Regards,
>>> Luigi S.
>>>
>>  -- 
>>
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "OrientDB" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/orient-database/CRR-simpmLg/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, 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: select all vertices with no incoming edges

2015-06-03 Thread Giulia Brignoli
Hi David,

try this query:

 select from V where @rid not in (select expand(out()) from V)

in this way you should find all the vertices that have no incoming edges.

Bye, Giulia

Il giorno mercoledì 3 giugno 2015 13:51:03 UTC+2, David de Sousa Seixas ha 
scritto:

hi
>
>   I'm trying to get all vertices that have no incoming edges. How do I do 
> that?
>
> 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: Edge Query Issue

2015-06-03 Thread Thomas Kennedy
The issue was that I had not extended the Hour vertex as superclass V

On Wednesday, 3 June 2015 11:15:39 UTC+1, SavioL wrote:
>
> Hi Thomas,
>
> you can try a query like this:
>
> select name_event from (select expand(out('registered')) from Hour where 
> value = '23')
>
> regards,
> Luigi S.
>

-- 

--- 
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] select all vertices with no incoming edges

2015-06-03 Thread David de Sousa Seixas
hi

  I'm trying to get all vertices that have no incoming edges. How do I do 
that?

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.


Re: [orientdb] Re: Complex query

2015-06-03 Thread Andrey Yesyev
Thanks Nagu!

But I also need to group by vertices I related to.

On 3 June 2015 at 07:02, nagaraja sosale ramaswamy 
wrote:

> select sum(count) from RELATED where in = #11:0 or out = #11:0
>
>
> hope that helps...
> ~nagu.
>
>
> On Wednesday, June 3, 2015 at 2:26:24 PM UTC+5:30, SavioL wrote:
>>
>> Hi Ziink,
>>
>> I created V1 and V2, and i linked them so:
>>
>> V1 -->related --> V2
>> V1 -->related --> V2
>> V1 -->related --> V2
>> V2 -->related --> V1
>> V2 -->related --> V1
>>
>> so i have 3 link from V1 to V2, and 2 link from V2 to V1.
>>
>> With this query:   select count(*) FROM Related LET $c = in.size()
>> i get Count = 5. (five is number of total link with V1 and V2)
>>
>> i hope is this the answer you were looking for..
>>
>> Regards,
>> Luigi S.
>>
>  --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "OrientDB" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/orient-database/CRR-simpmLg/unsubscribe.
> To unsubscribe from this group and all its topics, 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.


Re: [orientdb] Re: Complex query

2015-06-03 Thread Andrey Yesyev
Thanks Luigi!

How to add traverse to this query, lets say you have the next graph

V1 -->related --> V2
V1 -->related --> V2
V1 -->related --> V2
V2 -->related --> V1
V2 -->related --> V1
V1 -->related --> V3
V1 -->related --> V3
V3 -->related --> V1

So the result for query for V1 would be

V2 5
V3 3

On 3 June 2015 at 04:56, SavioL  wrote:

> Hi Ziink,
>
> I created V1 and V2, and i linked them so:
>
> V1 -->related --> V2
> V1 -->related --> V2
> V1 -->related --> V2
> V2 -->related --> V1
> V2 -->related --> V1
>
> so i have 3 link from V1 to V2, and 2 link from V2 to V1.
>
> With this query:   select count(*) FROM Related LET $c = in.size()
> i get Count = 5. (five is number of total link with V1 and V2)
>
> i hope is this the answer you were looking for..
>
> Regards,
> Luigi S.
>
>
> Il giorno martedì 2 giugno 2015 00:10:15 UTC+2, Andrey Yesyev ha scritto:
>>
>> Hi there,
>>
>> I need help with a query.
>> My schema is pretty simple. Vertices are connected with Edges of type
>> RELATED which have property count.
>> 2 vertices can have connection in both ways at the same time.
>>
>> V1--RELATED(count=17)-->V2
>>
>> V2--RELATED(count=3)-->V1
>>
>> I need to build a query that for vertex Vn, will find all vertices
>> connected with RELATED edge to this Vn and also, for each pair [Vn, Vx]
>> will calculate SUM of in_RELATED.count and out_RELATED.count.
>>
>> For that simple example above, this query result for V1 would be
>>
>> |  Vertex   |Count|
>> ||
>> |V2  |  20|
>>
>> Is it possible to do in one query at all?
>>
>> Any help is very much appreciated!
>>
>> -Andrey
>>
>  --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "OrientDB" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/orient-database/CRR-simpmLg/unsubscribe.
> To unsubscribe from this group and all its topics, 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.


Re: [orientdb] addEdge() to a 'remote' vertex introduces OTransactionException?

2015-06-03 Thread Luigi Dell'Aquila
Hi Clark,

yes, creating edges that involve different shards is supposed to work fine.
Could you please open an issue and provide a simple test case?

Thanks

Luigi


2015-06-02 10:40 GMT+02:00 Clark Peng :

>
> Hi all,
>
> I'm having issue while using OrientVertex.addEdge() API.
> My orientdb version is community 2.0.10 and it runs as distributed mode.
>
> The distributed-config.json has below configurations.
>
> "clusters":{
> ...
> "vertex1_server1":{ "servers":["server1"]}
> "edge1_server1"  :{ "servers":["server1"]}
> "vertex2_server2":{ "servers":["server2"]}
> ...
> }
>
> That means:
> 1. cluster "vertex1_server1" and "edge1_server1" will only reside in
> server1
> 2. cluster "vertex2_server2"  will only reside in server2
>
> Now when I wish to add vertex from cluster "vertex1_server1" to cluster
> "vertex2_server2", it always throws below exception.
>
> "ErrorType:[com.orientechnologies.orient.core.exception.OTransactionException]
> Msg:Error on committing distributed transaction"
>
> If I change distributed-config.json to have all clusters on all servers,
> then the program executes as expected.
>
> "clusters":{
> ...
> "vertex1_server1":{ "servers":["server1", "server2", ""]}
> "edge1_server1"  :{ "servers":["server1", "server2", ""]}
> "vertex2_server2":{ "servers":["server1", "server2", ""]}
> ...
> }
>
> So, my question is that, is it possible to add an edge that links to some
> vertex that's not reside in local clusters?
> It seems not work in my environment and I'm not sure if it's due to wrong
> configuration or it's current limitation?
>
> Thanks,
> Clark
>
> --
>
> ---
> 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.


Re: [orientdb] Trying to emulate a directory structure

2015-06-03 Thread Luigi Dell'Aquila
Hi David,

I'm not sure I understood your problem... are you having problems in
defining 1..N relationships with edges?
If it's the case, you can just avoid to define schema for edge links and
the graph engine will do the job for you.
Eg.

CREATE VERTEX Directory set name = 'ParentDir'
#12:0

CREATE VERTEX Directory set name = 'SubDir1'
#12:1

CREATE VERTEX Directory set name = 'SubDir2'
#12:2

CREATE EDGE Child from #12:0 to #12:1
CREATE EDGE Child from #12:0 to #12:2


this way you will have two "Child" edges for the "ParentDir" directory,
pointing to two different subdirs

Luigi



2015-06-02 4:41 GMT+02:00 David Brown :

> I'm hoping that someone can help recommend the correct configuration of
> classes to achieve this goal in OrientDB (running 2.1-rc3 at the moment).
> My interface is through the Java Graph API.
>
> I want to have a vertex that is a directory.  I want to have multiple edge
> relationships between a directory, its sub-directories and the 'contents'
> of the directory.  When i was prototyping with light-weight edges, things
> were fine because the problem domain dictated the the label for each entry
> in the directory (and therefor the label for each edge) was unique.  But I
> would really like to have heavy-weight edges that capture more information
> about the nature of the directory entry (when it was created, and by whom
> for example).
>
> I am trying to use Schema-Hybrid mode for this directory object.  There
> are some defined properties, but the edges that get created will be
> extremely varied, potentially referencing any other vertex class in my
> system.
>
> When I tried this, I ran into the problem that an edge classNname and its
> label are conflated, and it seems impossible to set a label for a
> heavy-weight edge that is something other than its class name (this seems
> by design in the code and is mentioned in the docs).
>
> Then, it seems, by default, that an edge relationship is OType.LINK by
> default, so, if the labels are not unique, I will only get one instance of
> a relationship with each class - adding another entry over writes the first
> entry.  (Is this true or am I doing something wrong?)
>
> Now, I could go and create edge properties for a given type and create an
> edgeProperty that is of OType.LINKBAG.  Unfortunately, as I said, I could
> have multiple instance of just about any vertex class in my system stored
> in the directory, so I don't want to have to define edgeProperties for
> every potential class that could be stored in a directory.
>
> Thank you for any advice or corrections.  I'm also very interested in the
> reason behind forcing the labels to be the same as the class name.
>
> Dave
>
> --
>
> ---
> 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.


Re: [orientdb] Preallocation of disk space to avoid moving documents

2015-06-03 Thread scott molinari
Ok. Thanks. I think I read somewhere that vertices in a graph db are 
automatically created with Oversize=2? 

Scott

-- 

--- 
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: Select distinct vertices according to edge filter

2015-06-03 Thread nagaraja sosale ramaswamy
perhaps you could try this:
select distinct(@rid) from (select expand(bothv()) from related)

let me know if it works for you.


regards,
~nagu.

On Wednesday, June 3, 2015 at 3:59:16 PM UTC+5:30, alessand...@gmail.com 
wrote:
>
> Hi Lior,
> try this query
>  
> select distinct(id) as id from (select expand( $c ) let $a = ( SELECT 
> outV() as id FROM Called WHERE start_time>10 AND end_time<11 ), $b = ( 
> SELECT inV() as id FROM Called 
> WHERE start_time>10 AND end_time<11 ), $c = unionAll( $a, $b ))
>
> 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: Complex query

2015-06-03 Thread nagaraja sosale ramaswamy
select sum(count) from RELATED where in = #11:0 or out = #11:0 


hope that helps...
~nagu.


On Wednesday, June 3, 2015 at 2:26:24 PM UTC+5:30, SavioL wrote:
>
> Hi Ziink,
>
> I created V1 and V2, and i linked them so:
>
> V1 -->related --> V2  
> V1 -->related --> V2  
> V1 -->related --> V2  
> V2 -->related --> V1  
> V2 -->related --> V1  
>
> so i have 3 link from V1 to V2, and 2 link from V2 to V1.
>
> With this query:   select count(*) FROM Related LET $c = in.size()
> i get Count = 5. (five is number of total link with V1 and V2)
>
> i hope is this the answer you were looking for..
>
> Regards,
> Luigi S.
>

-- 

--- 
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: OrientDB ETL tool

2015-06-03 Thread James Wang
Thanks a lot.

Tried to contact you via email (so as not to disturb others who may find my 
questions are not relevant or too simply)


On Friday, 29 May 2015 12:18:31 UTC+1, James Wang wrote:
>
> Hi All,
>
> I am new to OrientDB and trying to import data from a CSV file using the 
> ETL tool.
>
> Do I need to stop the OrientDB server firstly please?
> Please help.
>
> Thanks a lot in advance
> James
>

-- 

--- 
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: OrientDB ETL tool

2015-06-03 Thread Luigi Dell'Aquila
Hi James,

there is a lot of improvement in the roadmap of OETL, we know that right
now it is not optimized. If you are doing a one-shot import I suggest you
to go with embedded and after that start the server.

If you need very high performance you should consider Java API or
OGraphBatchInsert (for graphs)

Thanks

Luigi


2015-06-02 18:19 GMT+02:00 James Wang :

> Thanks, Luigi.
>
> More questions:  is it possible to speed up OETL speed please?
>
> In remote mode, I can only  import about 200 vertices per second
>
> Thanks a lot in advance
>
> On Friday, 29 May 2015 12:18:31 UTC+1, James Wang wrote:
>
>> Hi All,
>>
>> I am new to OrientDB and trying to import data from a CSV file using the
>> ETL tool.
>>
>> Do I need to stop the OrientDB server firstly please?
>> Please help.
>>
>> Thanks a lot in advance
>> James
>>
>  --
>
> ---
> 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: Select distinct vertices according to edge filter

2015-06-03 Thread alessandrorota04
Hi Lior,
try this query
 
select distinct(id) as id from (select expand( $c ) let $a = ( SELECT 
outV() as id FROM Called WHERE start_time>10 AND end_time<11 ), $b = ( 
SELECT inV() as id FROM Called 
WHERE start_time>10 AND end_time<11 ), $c = unionAll( $a, $b ))

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: Edge Query Issue

2015-06-03 Thread SavioL
Hi Thomas,

you can try a query like this:

select name_event from (select expand(out('registered')) from Hour where 
value = '23')

regards,
Luigi S.

-- 

--- 
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: Recommender Engine

2015-06-03 Thread Giulia Brignoli
Hi.
I have created your schema, the graph i get is: 





and the result of my query is like your example:


If your schema is different, send it to me to try solve your problem.

Bye Giulia

Il giorno venerdì 22 maggio 2015 21:47:35 UTC+2, ri...@hangwith.com ha 
scritto:
>
> How do I write a recommender engine to recommend who to follow based on 
> the people you've already followed?
>
> For example:
> A follows B, C, D.
> B follows C, D, E, F, G.
> C follows E, F, H.
> D follows E, I, J.
> Then the recommender engine should show something like:
> E (3 of your followers are following this person)
> F (2 of your followers are following this person)
> G, H, I, J (no particular order, since they're tied at 1 of your followers 
> is following this person)
>
> My schema:
>
> Vertex:
> User
>   - userID
>   - username
>   - fullName
>
> Edge:
> Friendship
>   - type (string, with enum values of: follow, block)
>   - createDate (date)
>   - isCloseFriend (boolean)
>
> Thanks in advance!
>

-- 

--- 
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] Migrating data from 1.7.9 to 2.0 and keep the same identifiers

2015-06-03 Thread ZAHID Med
 

Hi,

I want to migrate the data from the version 1.7.9 to 2.0. I am using two 
databases: one for data and another one for images. I am using also 
clusters in order to make the database sharding easier.

When saving data, the application choose the first cluster until reaching a 
record limit (20 per cluster), then it moves to the next one.

Actually, I want to upgrade orientdb version, but the problem I am facing 
now is when exporting and restoring the data, the database distributes the 
records overs all the clusters which is not my strategy. Also, when saving 
images, I keep the image identifier as reference in the image owner record.

I tried this, but it doesn't work: IMPORT DATABASE data.json.gz -merge=true 
-preserveClusterIDs=true  -rebuildIndexes=false 

Could you, please, provide me necessary commands to perform this migration?

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.


Re: [orientdb] Preallocation of disk space to avoid moving documents

2015-06-03 Thread Luca Garulli
Yes, the reason is the same. oversize is the factor: 0 or 1 means no
oversize. 2 means 2x, so double size, etc.

Best Regards,

Luca Garulli
CEO at Orient Technologies LTD
the Company behind OrientDB
http://about.me/luca.garulli


On 3 June 2015 at 11:31, scott molinari 
wrote:

> I did. And I still stand by what I said. The documentation is a bit thin
> on explaining it.
>
> What is the reason for oversizing? Is it the same as with MongoDB MMap and
> the avoidance of document movement on disk?
> What does Oversize do exactly? What are the differences in the settings?
> What happens differently?
>
> Scott
>
> --
>
> ---
> 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.


Re: [orientdb] Preallocation of disk space to avoid moving documents

2015-06-03 Thread scott molinari
I did. And I still stand by what I said. The documentation is a bit thin on 
explaining it.

What is the reason for oversizing? Is it the same as with MongoDB MMap and 
the avoidance of document movement on disk?
What does Oversize do exactly? What are the differences in the settings? 
What happens differently?

Scott

-- 

--- 
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] Preallocation of disk space to avoid moving documents

2015-06-03 Thread Luca Garulli
Hi Scott,
Try looking for "oversize" in Documentation search box.



Best Regards,

Luca Garulli
CEO at Orient Technologies LTD
the Company behind OrientDB
http://about.me/luca.garulli


On 3 June 2015 at 11:02, scott molinari 
wrote:

> I've now read in the docs there is an option to do preallocation
> (oversize) to, I think, basically pack on extra space for changing record
> sizes (through updates), in order to avoid movement of records. The
> documentation is a bit thin on explaining it. Could someone expand on this
> feature please?
>
> Scott
>
> --
>
> ---
> 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] Change Management OrientDB

2015-06-03 Thread Syos
Hi,

is it possible to implement a kind of Change Management in OrientDB to 
manage different Versions of records and to make them reproducible?
- how is this possible? ;-)

Thanks!
Sysos

-- 

--- 
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] Preallocation of disk space to avoid moving documents

2015-06-03 Thread scott molinari
I've now read in the docs there is an option to do preallocation (oversize) 
to, I think, basically pack on extra space for changing record sizes 
(through updates), in order to avoid movement of records. The documentation 
is a bit thin on explaining it. Could someone expand on this feature 
please? 

Scott 

-- 

--- 
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: Complex query

2015-06-03 Thread SavioL
Hi Ziink,

I created V1 and V2, and i linked them so:

V1 -->related --> V2  
V1 -->related --> V2  
V1 -->related --> V2  
V2 -->related --> V1  
V2 -->related --> V1  

so i have 3 link from V1 to V2, and 2 link from V2 to V1.

With this query:   select count(*) FROM Related LET $c = in.size()
i get Count = 5. (five is number of total link with V1 and V2)

i hope is this the answer you were looking for..

Regards,
Luigi S.


Il giorno martedì 2 giugno 2015 00:10:15 UTC+2, Andrey Yesyev ha scritto:
>
> Hi there,
>
> I need help with a query.
> My schema is pretty simple. Vertices are connected with Edges of type 
> RELATED which have property count.
> 2 vertices can have connection in both ways at the same time.
>
> V1--RELATED(count=17)-->V2
>
> V2--RELATED(count=3)-->V1
>
> I need to build a query that for vertex Vn, will find all vertices 
> connected with RELATED edge to this Vn and also, for each pair [Vn, Vx] 
> will calculate SUM of in_RELATED.count and out_RELATED.count.
>
> For that simple example above, this query result for V1 would be
>
> |  Vertex   |Count|
> ||
> |V2  |  20|
>
> Is it possible to do in one query at all?
>
> Any help is very much appreciated!
>
> -Andrey
>

-- 

--- 
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: Select distinct vertices according to edge filter

2015-06-03 Thread Lior Neudorfer
That's not enough - it only gives me one side. And I can't use bothV() 
instead - it will give me "distinct couples", which is not what I'm looking 
for.

On Wednesday, June 3, 2015 at 10:25:41 AM UTC+3, alessand...@gmail.com 
wrote:
>
> Hi,
> for the first question you can use the DISTINCT clause,
> for example : SELECT distinct(outV()) FROM Called WHERE start_time>X AND 
> end_time
> Bye, Alessandro
>
> Il giorno lunedì 1 giugno 2015 20:36:59 UTC+2, Lior Neudorfer ha scritto:
>>
>> Hi,
>>
>> two small questions from an OrientDB beginner... 
>>
>> I have a graph with one type of Vertices - "Person" - and one type of 
>> Edges - "Called".
>> The graph describes phone conversations between people, with each edge 
>> having a "start_time" and "end_time" properties which describe the call's 
>> start and end times.
>>
>> For example, to get all the ongoing conversations in a specific time, I 
>> can do SELECT FROM Called WHERE start_time>X AND end_time>
>> 1. 
>> I am looking for a query which will return *all people that were having 
>> a conversation in a specific hour*.
>> When I want to get the people themselves, I'm using SELECT bothV() FROM 
>> Called WHERE start_time>X AND end_time> The problem with this query is that I get duplicate results - if a person 
>> had multiple calls, I'll get his record multiple times. I don't want to 
>> remove duplicates in the application itself.
>>
>> I've tried several strategies to solve this, including dividing it to 
>> multiple queries with LET... but it seems too complicated for a rather 
>> simple query.
>> Any ideas?
>>
>> 2. Continuing that question - is there a single query which will return 
>> all filtered Edges *and* their attached Vertices? In order to optimize 
>> the edge filtering query and do it only once?
>>
>> Thanks so much for the help.
>> This seems like an active group - hope I'll be able to contribute to it 
>> in the future :)
>>
>> Lior
>>
>

-- 

--- 
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: Select distinct vertices according to edge filter

2015-06-03 Thread alessandrorota04
Hi,
for the first question you can use the DISTINCT clause,
for example : SELECT distinct(outV()) FROM Called WHERE start_time>X AND 
end_time
> Hi,
>
> two small questions from an OrientDB beginner... 
>
> I have a graph with one type of Vertices - "Person" - and one type of 
> Edges - "Called".
> The graph describes phone conversations between people, with each edge 
> having a "start_time" and "end_time" properties which describe the call's 
> start and end times.
>
> For example, to get all the ongoing conversations in a specific time, I 
> can do SELECT FROM Called WHERE start_time>X AND end_time
> 1. 
> I am looking for a query which will return *all people that were having a 
> conversation in a specific hour*.
> When I want to get the people themselves, I'm using SELECT bothV() FROM 
> Called WHERE start_time>X AND end_time The problem with this query is that I get duplicate results - if a person 
> had multiple calls, I'll get his record multiple times. I don't want to 
> remove duplicates in the application itself.
>
> I've tried several strategies to solve this, including dividing it to 
> multiple queries with LET... but it seems too complicated for a rather 
> simple query.
> Any ideas?
>
> 2. Continuing that question - is there a single query which will return 
> all filtered Edges *and* their attached Vertices? In order to optimize 
> the edge filtering query and do it only once?
>
> Thanks so much for the help.
> This seems like an active group - hope I'll be able to contribute to it in 
> the future :)
>
> Lior
>

-- 

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