O'Reilly logo

Learning Neo4j 3.x - Second Edition by Rik Van Bruggen, Jérôme Baton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Which applications are used in which buildings?

Let's say that we would like to use the graph model to determine which applications are used in specific locations/buildings of our corporation. Then, our Cypher query would look something as follows:

MATCH (app:Application)<-[:USES]-(proc:Process)-[:USED_BY]->(bl:BusinessLine)-[:LOCATED_IN]->(b:Building) RETURN DISTINCT app.name AS Application , b.name AS Building ORDER BY app.name ASC;

Note that this is quite an expensive query to run as it does not use any specific starting points in our graph traversals--it is a global query. However, the result comes back quickly for this dataset.

Results ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required