I actually don't get any results at all from this:
SELECT in.*, strength FROM (SELECT outE("Friend") FROM #11:111)
I do get a result from this
SELECT outE("Friend") FROM #11:111
The closest I've come so far is running two queries and then hoping they
sort their results the same way
SELECT expand(out("Friend")) FROM #11:111
SELECT outE("Friend").strength FROM #11:111
And then loop through the two resulting arrays to make objects of
{friend:FOO, strength:BAR}
(Which seems like a pretty lousy solution (it also doesn't work right now))
On Mon, Apr 27, 2015 at 2:22 PM, Johan Sjöberg <[email protected]>
wrote:
> in.* should give you the complete object and not just the @rid since I
> select all of the in vertex's properties.
>
> But I suppose you could try:
>
> select *, inE('E').strength from (select expand(out('E')) from FOO)
>
> But that will give you a list of strength values and it is hard to
> determine which is the correct one if you have multiple.
>
> The first solution really should work though, what do you get when you try
> the first method?
>
> On Monday, April 27, 2015 at 6:59:39 PM UTC+2, Charles Bandes wrote:
>>
>> Hi Johan, this gets me very close, but I still need a way to get the
>> complete in.* object, not just its @rid, that's why I was using SELECT
>> expand()
>>
>> Is there a way to do something like that with your approach?
>>
>> On Mon, Apr 27, 2015 at 12:24 PM, Johan Sjöberg <[email protected]>
>> wrote:
>>
>>> A solution (there is in fact multiple ways to go about it) would perhaps
>>> be the following:
>>>
>>> SELECT in.*, strength FROM (SELECT outE("E") FROM FOO)
>>>
>>> What this does is that it first selects the edge and then selects
>>> anything of interest. By doing this you follow the path as it is saved in
>>> the database and the performance should be rather good.
>>> Note that I start from the id FOO. This is also a performance
>>> improvement, instead of first finding FOO and then traverse we start from
>>> FOO straightaway.
>>>
>>> This does not however return the data as you want, it will be returned
>>> as one single non-nested json. But that shouldn't be a problem for you to
>>> handle I believe.
>>>
>>> On Monday, April 27, 2015 at 2:18:13 PM UTC+2, Charles Bandes wrote:
>>>>
>>>> Hi - I'm building a graph to display via d3's force-directed layout.
>>>>
>>>> In order to find the links, I'm running a query like this:
>>>>
>>>> SELECT expand(out("E")) from V where id=FOO;
>>>>
>>>> This gives me an array of all the objects that are connected to FOO by
>>>> an edge. That's fantastic.
>>>>
>>>> But I also have a property on the edge called "strength" which
>>>> indicates the strength of the connection. How do I access that?
>>>>
>>>> Ideally what I want to get is something like this:
>>>>
>>>> result: [
>>>> {
>>>> object: { THE VERTEX },
>>>> strength: STRENGTH_VALUE
>>>> }
>>>> ]
>>>>
>>>> Does that make sense? Am I going about it all wrong?
>>>>
>>>> --
>>>
>>> ---
>>> 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/NZK91MmB8_M/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, 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 a topic in the
> Google Groups "OrientDB" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/orient-database/NZK91MmB8_M/unsubscribe.
> To unsubscribe from this group and all its topics, 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.