Hi Luca,
*select *, $depth from (*
* traverse both('translatesTo') from (*
* select from Label where name = 'Hello' )*
* while $depth < 4 )*
*where $depth > 0 and out('is').name IN 'Fr-fr' order by $depth*
this query gives me *half* of what I need but I'm concerned about a couple
of things. First, Lets say that I have 40 languages. with 40 labels. And
each one is only connected from one to one to one. This is the worst case
scenario of course.
i.e. Hello->Bonjour->Ciao->Hallo->..->40th word.
Question 1: Will $depth < 4 not be an issue then?
Question 2: How does this query differ in processing/performance from this
query suggested by Artem? select from (traverse out('translatesTo') from
(select from Label where name = 'Hello')) where out('is').name contains
'Ar-sy'
The other half that I'm missing from this query is how to get the weight
for those that are directly connected. As explained in earlier post, if
Hello is directly translated to French Salut and has been accepted by users
15 times (set as count on the edge). And the french Bonjour has only been
translated via italian ciao then I still want that word but the
weight/count is 0 or null in this case. it looks like this.
Hello->Salut (count on edge is 15)
Hello->Ciao
Ciao->Bonjour
As you can see "Hello" is not directly connected to Bonjour so it naturally
has no count, so we can assume it's 0 or null if you wish. While Hello is
directly linked to Salut and has been used 15 times.
so when we run the suggested query above, I would like to have result such
as this, (ordered by count desc)
Label Count
Salut 15 (the count here is 15 because Hello is linked to Salut
directly with a count on the edge=15)
Bonjour 0 (or null, the counter here is 0/null because Hello was never
linked directly and this is retrieved via another vertex linked to hello)
Finally, here is my approach to it as in my previous comment to Artem, I
just don't know the proper syntax to do this, there might be a better
approach because my "solution" requires 2 queries and a union.
https://groups.google.com/d/msg/orient-database/uhlXh8_Bo2U/eR4ZDoQXo3cJ
Thanks
--
---
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/groups/opt_out.