New to Graph DB in general, and really excited about Neo4j! But running in an issue with knowing how think/reason about some data in Neo4j.
Lets say, in a normal DB I have three tables: Airplanes, Airports, and Jobs. Airports have many Jobs going to other Airports. Jobs have some data like 'cost', cargoType
, fromAirport
, toAirport
, and airplaneId
. One of my main goals will be to be able to query for the shortest route, over a specifed number of hops, that will make the most money. The answer initially seemed easy. Just do (Airport)-[:Job]->(Airport)
. The biggest thing that is confusing me right now, is that technically a Job is a noun which implies an Entity. Furthermore, Job's have an Aircraft ID which means That we have a third relation playing in. So I tried another method: Make jobs an entity: (Airport)-[DEPARTS]->(Job)-[:ARRIVES]->((Airport)
, (Airplane)-[:IS_FLYING]->(Job)
. But this seems weird to query. In the first case, I could have just (a:Airport)-[:Job*..12]->(b:Airport)
, but in this last case, I don't yet know how to do that.
Still learning... so haven't even got to the meat, which is concocting a query that shows the most profitable route considering the number of requested hops.
Anyway, appreciate any help you fine folks can lend!