Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select not returning out vertices #7885

Closed
tomazk8 opened this issue Nov 15, 2017 · 6 comments
Closed

Select not returning out vertices #7885

tomazk8 opened this issue Nov 15, 2017 · 6 comments
Assignees
Labels

Comments

@tomazk8
Copy link

tomazk8 commented Nov 15, 2017

OrientDB Version: 2.2.27 and 2.2.30

Java Version: 1.8.0_151

OS: Windows 10 Pro

Expected behavior

Select should return out vertices giving an source vertex id.

Actual behavior

Using SELECT to get the out vertices returns nothing, but TRAVERSE returns them.

Steps to reproduce

I deleted the whole OrientDB installation and all of the databases and installed version 2.2.30. I have created the database from scratch, no extras, I just registered two classes, Person and Card, both derived from V. I added two vertices, Person (Name=Mike, @Rid=25:0) and Card (UID=123, @Rid=34:0) and one IdentifiesWith edge going from Person to the Card. When I run this query, I get nothing:
select out('IdentifiesWith') from V where @Rid == #25:0
but if I run this query, it finds the card:
traverse out('IdentifiesWith') from #25:0

From the online documentation the select clause should return the result. I can reproduce this problem every time and I have a database that I can share if needed.

Thank you and best regards
Tomaz

@luigidellaquila luigidellaquila self-assigned this Nov 15, 2017
@luigidellaquila
Copy link
Member

Hi @tomazk8

I just tried it and it seems to work fine.
Could you please try the following:

select expand(out('IdentifiesWith')) from V where @Rid == #25:0

Thanks

Luigi

@tomazk8
Copy link
Author

tomazk8 commented Nov 15, 2017

Hi Luigi

Sorry, I made a mistake above. The Id of the Person is #33:0, not #25:0. But also in this case the select I wrote previously returns nothing. Your query on the other hand (but with @Rid == #33:0) does return the Card vertex.

I've ran my original query also in a test .NET Core application (using a OrientDB .NET client) and there I get an object back with #rid = #-2:0 and one of the fields holds the results. So it actually returns an object with results, and not the the results directly... or something in this direction?

Best regards
Tomaz

@luigidellaquila
Copy link
Member

Hi @tomazk8

Could you please post the results of

SELECT FROM V

and

SELECT FROM E

Thanks

Luigi

@tomazk8
Copy link
Author

tomazk8 commented Nov 15, 2017

Hi Luigi

No problem. Here is a screenshot:
image

Best regards
Tomaz

@luigidellaquila
Copy link
Member

Hi @tomazk8

Yes, what happens here is that you get an object containing pointers to the out() vertices, ie. the RIDs of these vertices.
If you want their actual values, you have to do an expand():

select expand(out('IdentifiesWith')) from V where @Rid = #33:0

Thanks

Luigi

@tomazk8
Copy link
Author

tomazk8 commented Nov 16, 2017

Hi Luigi

Ok, great. Thank you very much for your help.

Best regards
Tomaz

@tomazk8 tomazk8 closed this as completed Nov 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants