Using an airline flight model described in this [login to view URL] blog, requirement is to create graph traversal query in ArangoDB using javascript inside Foxx microservice with AQL. If you have OrientDB or Neo4j experience, you might be able to handle this in ArangoDB, I think. Flights could be non-stop, or multiple stops to reach the destination. Query should be generic to handle any number of stops for any flight. I will provide uses cases and data for nodes, edges and relations in Foxx service .zip file, so that you can start writing query right away for the example use cases below, upon your interest on this project. If you have better idea to handle flights graph data model, you are most welcome to chime in. Please consider only if you have experience with Graph traversal applications.
Requirements:
Query #1: Flights from New York to Paris on 2017-01-19
Remarks: American and Delta airlines has a flight from New York to Paris on 19 January 2017, so both of them should be included in the results. Hops are ordered according to the sequence of the airports along a flight path. When a flight arrives destination the following day, “+1” must be included in time_display field.
Expected json output:
[{
summary: {
airline: “American Airlines”,
time_display: “7:00a - 2:05p”,
duration: “7h 5m”,
stops: “0”,
hops: [“JFK”, “CDG”] },
flights: [{
departure_time: “7:00 a”,
arrival_time: “2:05 p”,
duration: “7h 05m”,
cities: [“New York”, “Paris”],
airports: [“John [login to view URL] Intl.(JFK)”, “Roissy-Charles de Gaulle (CDG)”],
flight: “AA - 707”,
aircraft: “BOEING 777-300ER”,
transit_info: { } ]
}, {
summary: {
airline: “Delta Airlines”,
time_display: “10:30p - 2:25p +1”,
duration: “9h 55 m”,
stops: “1”,
hops: [“JFK”,”LHR”, “CDG”] },
flights: [{
departure_time: “10:30p”,
arrival_time: “10:30a”,
duration: “7h”,
cities: [“New York”, “London”],
airports: [“John [login to view URL] Intl.(JFK)”, “Heathrow (LHR)”],
flight: “DA-401”,
aircraft: “Airbus A319”,
transit_info: {
duration: “1h 40m”,
city: “London”,
airport: “LHR”}
}, {
departure_time: “12:10p”,
arrival_time: “2:25p”,
duration: “1h 15m”,
cities: [“London”, “Paris”],
airports: [“Heathrow (LHR)”, “Roissy-Charles de Gaulle (CDG)”],
flight: “DA-401”,
aircraft: “Airbus A319”,
transit_info: { }
} ]
}]