Bundled functions: 'in()' 'out()' and 'both()' do not work with the last release

94 views
Skip to first unread message

KY

unread,
Apr 15, 2015, 2:36:29 AM4/15/15
to orient-...@googlegroups.com
Hi,

I've discovered that the bundled functions in(), out() and both() are not working in the last release 2.0.6.
I've also tried with a recent snapshot (2.1-20150414.070620-90) but I've had the same problems.

Concretely, I've tried the examples mentioned in: http://orientdb.com/docs/last/Tutorial-Working-with-graphs.html
Commands:
select in() from Restaurant where name = 'Dante'
select in() from V
select out() from V

The results are not the same: @CLASS = null, and in/out = 0/1

I've also noticed special columns when querying the Restaurant or Person classes: in_Eat, out_Eat.

Does it mean that the API has changed but not the documentation?

Thanks



ccas...@axway.com

unread,
Apr 15, 2015, 4:30:17 AM4/15/15
to orient-...@googlegroups.com
Hi,

I've created the schema with Restaurant/Person/Eat and populated the base as described in the tutorial with release 2.0.6.

I don't see any columns in Restaurant or Person called in_Eat or out_Eat.

select in() from Restaurant where name = 'Dante' returns a list of Person as expected.

Where do you see @class = null and what is this in/out = 0/1 ?

Regards.

KY

unread,
Apr 15, 2015, 6:12:19 AM4/15/15
to orient-...@googlegroups.com
Hi,

Here all the details.
- installed orientdb-2.0.6 on my windows 7-64bit
 and created a new db: create database plocal:../databases/WorkingWithGraphs admin admin plocal
- connected to the new db: connect plocal:../databases/WorkingWithGraphs admin admin

- created Person, Restaurant and Eat classes:
create class Person extends V
create class Restaurant extends V
create class Eat extends E

- populated the db as described (create vertex, create edge)
  
- executed two queries:
select from Restaurant => select-restaurant-in_Eat screenshot
select in() from Restaurant where name = 'Dante' => select-in-restaurant screenshot

Thanks!
select-in-restaurant.png
select-restaurant-in_Eat.png

ky...@ovguideinc.com

unread,
Apr 15, 2015, 4:03:44 PM4/15/15
to orient-...@googlegroups.com
I'm not entirely certain what your expected input/output is.

Notice in the tutorial the "expand" function was used.
select expand(in()) from Restaurant where name = 'Dante'
instead of 
select in() from Restaurant where name = 'Dante'

orientdb> select in() from Restaurant where name = 'Dante'

+-------+----------------+
| @RID  | in             |
+-------+----------------+
| #-2:1 | [#11:0, #11:1] |
+-------+----------------+
the [2] in your screenshots is a shorted version of the [#11:0, #11:1] above.

so try:

orientdb> select expand( in() ) from Restaurant where name = 'Dante'

+-------+-------------+-------------+---------+
| @RID  | @CLASS      | Name        | out_Eat |
+-------+-------------+-------------+---------+
| #11:0 | Person      | Luca        | #12:0   |
| #11:1 | Person      | Bill        | #12:0   |
+-------+-------------+-------------+---------+

hope that is helpful! 

KY

unread,
Apr 17, 2015, 3:21:11 PM4/17/15
to orient-...@googlegroups.com

Thanks Kyle for your relevant answer.


>I'm not entirely certain what your expected input/output is.
I expected to see the results mentioned in the documentation (the same ones you copied to your post )
Reply all
Reply to author
Forward
0 new messages