Hi,

I am trying to traverse documents where the links are part of list of maps 
and restrict the traversal based on map attributes

I tried to construct a simple setup to demonstrate the problem:

create class term

insert into term(id) values (1)

insert into term(id) values (2)

insert into term(id) values (3)

insert into term(id) values (4)

update #11:2 set xrefs=[ {"type" : "is_a" , "target" : #11:3 }, {"type" : 
"binds", "target" : #11:1 } ]  


the result would be

----+-----+----+-----
# |@RID |id |xrefs

----+-----+----+-----
0 |#11:0|1 |null 
1 |#11:1|2 |null 
2 |#11:2|3 |[2] 
3 |#11:3|4 |null 

----+-----+----+-----

the class term contains a list of maps called xrefs. Every map entry 
contains a "type" (string) and a "target" (link)

My goal is to traverse the chain of xrefs of term documents where I 
constrain the path to certain value of the  "type" key in the xrefs map.

I have started with 

traverse xrefs['target'] from #11:2 

----+-----+-----+----
# |@RID |xrefs|id 

----+-----+-----+----
0 |#11:2|[2] |3 
1 |#11:1|null |2 
2 |#11:3|null |4 

----+-----+-----+----

and experimented with while and the context variables but so far I have 
failed to address the map entry - $current is the whole document in the 
path I assume.

Has anybody an Idea how this traverse should look like?



-- 

--- 
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.

Reply via email to