Public Transport São Paulo in a Graph Database
Public transportation of São Paulo in a graph database IGOR ROZANI Igor Rozani IgorRozani IgorRozani @IgorRozani IgorRozani Table of contents ▪What’s this project? ▪The database ▪Query examples ▪Q&A ▪The Hunger Games What’s this project? What’s this project? Query examples • Which lines does a company own? • What station is part of which line? • How many stations have each line? • What is the shortest way between stations? Which lines does a company own? Company Lines MATCH (c:Company)-[:OWN]-(l:Line) "CPTM" ["7 - Ruby", "8 - Diamond", WITH c, l "9 - Emerald", "10 - Turquoise", "11 - Coral", "12 ORDER BY l.number, l.name - Sapphire", "13 - Jade", WITH c, collect(CASE WHEN l.number IS NULL "Airport Connect", "Airport THEN l.name ELSE l.number + ' - ' + l.name Express", "Touristic END) as lines Express"] RETURN c.name AS Company, lines AS Lines ... ... "ViaMobilidade" ["5 - Lilac"] ORDER BY c.name "ViaQuatro" ["4 - Yellow"] What station is part of which line? MATCH (l:Line)-[:PART_OF]-(s) RETURN l.name AS Line, collect(s.name) AS Stations Line Stations "Blue" ["Jabaquara", "Tiradentes", "Praça da Árvore", "Portuguesa - Tietê", "Luz", "São Bento", "Carandiru", "Parada Inglesa", "São Judas", "Saúde", "Paraíso", "Conceição", "Liberdade", "Jardim São Paulo - Ayrton Senna", "São Joaquim", "Santa Cruz", "Vergueiro", "Armênia", "Sé", "Ana Rosa", "Santana", "Tucuruvi", "Vila Mariana"] "Green" ["Trianon-Masp", "Vila Prudente", "Chácara Klabin", "Santuário Nossa senhora de Fátima - Sumaré", "Ana Rosa", "Clínicas", "Santos Imigrantes", "Vila Madalena",
[Show full text]