Hi Rolf,
two things here:
1) quotes are generally needed when using out(), in()... functions, eg.
out(Friend) is typically an error, while out("Friend") is correct. Anyway,
from a technical point of view, out(foo) is not syntactically incorrect, it
just means "follow outgoing edges whose class name is the value of 'foo'
property in the document itself", eg.
{
@rid: #12:1
name: "John",
out_friend: #12:2,
out_enemy: #12:3,
foo: 'friend'
}
select out(foo) from #12:1
is the same as
select out("friend") from #12:1
2) graph operators like out() return collection values, so you should use
CONTAINS operator, not =, eg.
SELECT FROM dc WHERE out(IS_LOCATED_IN).@rid CONTAINS #13:0
instead of
SELECT FROM dc WHERE out(IS_LOCATED_IN).@rid = #13:0
Luigi
2015-08-27 8:41 GMT+02:00 Rolf Streefkerk <[email protected]>:
> Nevermind, apparently iit is mandatory to put ' quotes around the edge
> class names but there's no feedback of any error. So it just takes all
> outgoing edges from class 'dc'. This imo still should not be allowed, is
> there a strict mode that can be activated?
>
>
> On Thursday, 27 August 2015 13:17:59 UTC+7, Rolf Streefkerk wrote:
>>
>> Researched further taking into account possible modelling error on my
>> side. So far I cannot see any problems with respect to edge relationships
>> from the Vertex 'dc' (rid: #13:0).
>>
>> I think this is a bug, what is happening is it takes all the outgoing
>> edges and returns the result. Instead it should traverse only the out edge
>> "IS_USED_IN".
>>
>> The version I'm using it OrientDB version : 2.1.0
>>
>>
>> On Wednesday, 26 August 2015 17:26:05 UTC+7, Rolf Streefkerk wrote:
>>>
>>> I tried a bit further with another strategy, not including the user
>>> result just yet:
>>>
>>> select name, out(IS_USED_IN).include('@rid') as project from
>>> ( select expand( in(LOCATED_IN).in(LOCATED_IN).in(LOCATED_IN) ) from
>>> ( select from #13:0 ) )
>>>
>>> now I get a strange result. I expect 2 dc results and one project object
>>> per dc. However, for project result I get RID's for; the connected Project
>>> (expected) and a city (not expected).
>>>
>>> I guess I'm not there yet?! What is exactly happening here..
>>>
>>>
>>> On Wednesday, 26 August 2015 16:20:59 UTC+7, Rolf Streefkerk wrote:
>>>>
>>>> I have the following relationships (where the keywords in CAPS are
>>>> edges, lowercase keywords are vertices). The dc vertex is the main Object
>>>> in my model:
>>>>
>>>> dc -- LOCATED_IN --> city -- LOCATED_IN --> country -- LOCATED_IN -->
>>>> continent
>>>>
>>>> dc -- IS_USED_IN --> project -- IS_OWNED_BY --> user
>>>>
>>>>
>>>> What I need is for a specific Continent selection (#13:0) all DC's and
>>>> their Projects owned by User 'X'
>>>>
>>>> So far I tried using LET keyword to unionall queries and expand the
>>>> result, but I'm not getting the results I want.
>>>>
>>>> I want to have something like this (non working example):
>>>>
>>>> SELECT *, out('IS_USED_IN').include('name') as project FROM dc
>>>> WHERE
>>>> ( out(IS_LOCATED_IN).out(IS_LOCATED_IN).out(IS_LOCATED_IN).@rid = #13:0
>>>> )
>>>> AND
>>>> ( .out(IS_USED_IN).out(IS_OWNED_BY).name = 'X' )
>>>>
>>>> How can I chain these relationships and query on a specific field?
>>>> (@rid, name and so on)
>>>>
>>> --
>
> ---
> 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 [email protected].
> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.