Hi,

you are right switching to the other AQL statement should give what you would 
like to achive.
Filtering on the VERTEX is only to exclude specific vertices from the result, 
not to exclude all paths using this vertex.
If you want to early exclude the paths you have to filter on the path directly.
This can make the query a bit more elegant.
Unfortunately there is not(yet) a way to define first depth INBOUND, others 
OUTBOUND so you will have to split it up in 2 traversal statements, one for 
each direction.
The first statement should find all 'MetaPerson' nodes in INBOUND manner.
The second statement should find all preceding entities which match your path 
pattern.
To get "almost" the same result you could instead do the following query:

    FOR v1, e1, p1 IN 1 INBOUND 'node/p1' edge
      FILTER v.LABEL == 'MetaPerson'
      FOR v2, e2, p2 IN 3 OUTBOUND v1 edge
        FILTER p2.vertices[1].LABEL == 'entity'
        AND p2.vertices[2].LABEL LIKE "%Event%"
        AND p2.vertices[3].LABEL == 'entity'
        RETURN {p1, p2}

It applies the split by direction after depth 1 (only MetaPerson)
And than only executes one OUTBOUND traversal checking the entire path in one 
go.

hope this helps
best
Michael


> Am 14.02.2017 um 09:12 schrieb Feng Wang <[email protected]>:
> 
> now I have a new idea bsed on 
> https://github.com/arangodb/arangodb/issues/1567 
> <https://github.com/arangodb/arangodb/issues/1567> and my AQL are list as 
> follows:
> 
> 
> 
> for v1,e1,p1 in  INBOUND 'node/p1' edge FILTER v.LABEL == 'MetaPerson'
>     for v2,e2,p2 in  OUTBOUND v1 edge FILTER v2.LABEL == 'entity'
>         for v3,e3,p3 in  OUTBOUND v2 edge FILTER v3.LABEL LIKE "%Event%"
>             for v4,e4,p4 in  OUTBOUND v3 edge FILTER v4.LABEL == 'entity'
>             
> return {p1,p2,p3,p4}
> 
> 
> and it could return results as I expected. However, I want to know if there 
> is a much more efficient method? Like 
> 
> (:person)-[]->(:Metaperson)-->(:Email:)-->(:Emailevent)-->(:Email)
> 
> 
> thx
> 
> 在 2017年2月14日星期二 UTC+8下午1:17:08,Feng Wang写道:
>  
> <https://lh3.googleusercontent.com/-aRTIXg9BAa4/WKKAj0ekCSI/AAAAAAAACk0/88SAT8FukT0tLs96zsGmzrXMzZbLqTitgCLcB/s1600/1851688996.jpg>
> 
> Figure 1
> 
> 
> 
> Hello community,
> 
> 
> 
>      As shown in Fig.1, what I want to do is : Setting 'node/p1' (the read 
> notes is ' _id ') ,  I can get the other nodes as well as edges  through 
> 'node/mp1' and 'node/mp2'  which is connected with 'node/p1'    
> 
> 
> 
> I am thinking to use Graph traversals in AQL as follows:
> 
> On this point, I have a view that set startVertex as 'node/p1'  and executed 
> at min depth=4 and max depth=4 ,then filter the path witch contain  v.LABEL 
> == 'MetaPerson'
> 
> 
> 
> 
> 
> LET condition = ( FOR v, e, p IN 1..1 ANY 'node/p1' GRAPH 'graphname'  FILTER 
> v.LABEL == 'MetaPerson' return v)
> 
> FOR  vertex, edges, path in 4..4 ANY 'node/p1' GRAPH 'graphname'
> 
> FILTER condition[*] ANY IN vertex
> 
> RETURN {vertex, edges, path}
> 
> But it return
> []
> 
> I really have no idea to deal with this problem~hope for your help . 
> Thank you..
> 
> by the way ,here is my example data:
> 
> 
> node.csv
> _id,_key,identify,Name,Gender,Age,Email,Phonenumber,Address,LABEL
> node/1,"1",A,轩硕,Female,48,[email protected] 
> <mailto:[email protected]>,351-(194)243-0311,3 Pankratz Place,Person
> node/2,"2",B,彦军,Male,43,[email protected] 
> <mailto:[email protected]>,63-(650)464-1177,29 Ridgeway Circle,Person
> node/3,"3",B1,泽瀚,Female,23,[email protected] 
> <mailto:[email protected]>,86-(547)493-6843,77624 Eastwood Place,Person
> node/67,"67",metaperson1,fghd,Male,47,[email protected],7-(837)788-53,56 
> Monterey Terrace,MetaPerson
> node/68,"68",metaperson2,fghd,Male,47,[email protected],7-(837)788-53,56 
> Monterey Terrace,MetaPerson
> node/73,"73",Ec21,2015-01-11,,,,,,CALL|Event
> node/74,"74",Ec22,2015-01-13,,,,,,EMAIL|Event
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "ArangoDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"ArangoDB" 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.

Reply via email to