java - OrientDb graph TRAVERSE between two vertex with conditions -
this graph schema (little part):
busstation
class extends v
(vertex). every busstation
element has stationid
property value (1,2,3,4,5...).
bus
class extends e
(edge). every bus
element has 3 properties:
busid
: id of bus between 2 station (long)departure
: time when bus went station (datetime)arrival
: time when bus came on next station (datetime)
i want find $path
busstation
stationid = 1
busstation
stationid = 5
. when execute query through editor/java code:
select $path path (traverse oute(bus), inv(busstation) select * busstation stationid = 1 strategy breadth_first) @rid == #17:3509
i shortest path, have conditions must follow:
first want on same bus longer posible. means if on
stationid = 1
bus
busid = 1
onstationid = 2
wantbusid = 1
, onstationid = 3
on, , onstationid = 4
because don't havebusid = 1
pick 1 of possible ability.second filter on arrival time of 1 bus , departure bus bus. must watch out if bus arrive on station in 09:00, must pick busstation buses have departure time after arrive time (09:00).
do have idea how thru query can filter conditions?
Comments
Post a Comment