java - OrientDb graph TRAVERSE between two vertex with conditions -


this graph schema (little part):

enter image description here

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 on stationid = 2 want busid = 1, on stationid = 3 on, , on stationid = 4 because don't have busid = 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

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -