HI, I am new to OrientDB and I tried to play with it for the last month, but now I started some tasks and bumped in some problems.
My problem for now is the following:
I have a structure:
- User - a vertex, with property id and services
- worked - an edge, with property recommendation (a string with a few possible values)
I need to find all nearby Users of a certain User that have a relationship of the type 'worked' with a certain property (let's say: 'recommended'); this in my vision will translate as:
select expand( both()[recommendation='recommended'] ) from <@rid>
But this query does not return anything.
I'm running OrientDB 1.7.4.
Hope someone can help me,
Thank you.
-----------------------------------------------------------------------
EDIT 1:
I provided the actual schema above.
Sample data:
- Users:
-> user1; id=1; services=[{name:'service1'},{name:'service2'}]
-> and a couple of more users; let's say we have 10 users that are connected as following
- Edges:
-> (1) user1 --(worked)[recommendation='recommended']--> user2
-> (2) user1 --(worked)[recommendation='not recommended']--> user3
-> (3) user2 --(worked)[recommendation='recommended']--> user4
-> (4) user2 --(worked)[recommendation='pending']--> user5
-> (5) user3 --(worked)[recommendation='pending']--> user6
-> (6) user3 --(worked)[recommendation='recommended']--> user7
-> (7) user5 --(worked)[recommendation='not recommended']--> user1
-> (8) user7 --(worked)[recommendation='recommended']--> user1
If we want to find the users that are recommended in the network on level 1 for user1, we want to find: user2 (1) and user 7 (8). Users 5 and 3 will not be found because the label is wrong (we are looking for edges with recommendation property set on 'recommended') .
To extend this, I want to look to second level. Looking at user1, I should find: user4(1)(3) and user7(8)(6). Ofc I would not want to repeat the users that were in level 1, but I think this could be done with a select where not in level1.
Hope this will clear out what I need and hope someone can help.