Hi,
I extended the old RailNet example of the Neo4j.rb distribution and
implemented it in Sinatra as a web app.
To give an idea of its functionality I include below a few "screens"
with their URL. Path symbols and node id's in these screens are
between [square brackets] and are hypertext links.
(@Andreas Ronge: if you want to include the updated example also in
the examples folder I can send you the source zip file off-list)
-- Bert Fitié
========== Home page of the example:
http://localhost:4224/
RailNet example home page
1. Show number of primitives used: [
http://localhost:4224/number]
2. Show all (user) nodes: [
http://localhost:4224/allnodes]
3. Show all paths: [
http://localhost:4224/allpaths]
========== Items in database:
http://localhost:4224/number
Number of primitives
1. Number of nodes: 24
2. Number of relationships: 58
3. Number of properties: 91
4. Number of paths: 9
5. Total number of primitives: 173
========== List of nodes:
http://localhost:4224/allnodes
All (user) nodes
1. Alpha junction [2]
2. Amsterdam CS station [16]
3. Amsterdam HSM station [1]
4. Barendrecht station [18]
5. Bravo junction [5]
6. Charlie junction [10]
7. Delft station [8]
8. Delta junction [11]
9. Den Haag HS station [7]
10. Dordrecht station [17]
11. Echo junction [15]
12. Haarlem station [4]
13. Halfweg station [3]
14. Hoek van Holland harbour [23]
15. Leiden station [6]
16. Maassluis station [22]
17. Rotterdam Beurs station [19]
18. Rotterdam DP station [20]
19. Rotterdam HSM station [12]
20. Schiedam station [9]
21. Uitgeest station [13]
22. Vlaardingen station [21]
23. Zaandam station [14]
========== List of paths:
http://localhost:4224/allpaths
All paths
1. [ams0844rot] Line number 101, Amsterdam - Rotterdam
Km 0.0 Amsterdam HSM station [1] - Km 84.4 Rotterdam HSM station
[12]
2. [ams0857rot] Timetable number 571, Amsterdam - Den Haag - Rotterdam
Km 0.0 Amsterdam CS station [16] - Km 85.7 Rotterdam DP station
[20]
3. [ams2147rot] Train number 383, Amsterdam - Rotterdam
18:49 Amsterdam CS station [16] - 21:47 Rotterdam DP station [20]
4. [ams2237dord] Through carriage 18:49, Amsterdam - Rotterdam -
Dordrecht
18:49 Amsterdam CS station [16] - 22:37 Dordrecht station [17]
5. [dord0501rot] Line number 172, Rotterdam - Dordrecht (- Breda)
Km 29.4 Dordrecht station [17] - Km 50.1 Delta junction [11]
6. [ech0016alph] Line number 101.1, diversion Amsterdam - Haarlem to
Uitgeest - Amsterdam
Km 0.0 Echo junction [15] - Km 1.6 Alpha junction [2]
7. [hoek2237dord] Train number 112, Hoek van Holland - Rotterdam -
Dordrecht
21:02 Hoek van Holland harbour [23] - 22:37 Dordrecht station [17]
8. [rot0275hoek] Timetable number 571a, Rotterdam - Hoek van Holland
Km 0.0 Rotterdam DP station [20] - Km 27.5 Hoek van Holland harbour
[23]
9. [uit0808ams] Line number 174, Amsterdam - Uitgeest (- Nieuwediep)
Km 57.8 Uitgeest station [13] - Km 80.8 Amsterdam CS station [16]
========== Through-carriage path:
http://localhost:4224/path/ams2237dord
Route of path ams2237dord
[ams2237dord] Through carriage 18:49, Amsterdam - Rotterdam -
Dordrecht
[ams2147rot] Train number 383, Amsterdam - Rotterdam
18:49 Amsterdam CS station [16] - 19:03 Halfweg station [3]
19:03 Halfweg station [3] - 19:12 Haarlem station [4]
19:16 Haarlem station [4] - 20:08 Leiden station [6]
20:15 Leiden station [6] - 20:40 Den Haag HS station [7]
21:02 Den Haag HS station [7] - 21:15 Delft station [8]
21:19 Delft station [8] - 21:33 Schiedam station [9]
21:38 Schiedam station [9] - 21:47 Rotterdam DP station [20]
[hoek2237dord] Train number 112, Hoek van Holland - Rotterdam -
Dordrecht
21:57 Rotterdam DP station [20] - 22:00 Rotterdam Beurs station [19]
22:01 Rotterdam Beurs station [19] - 22:18 Barendrecht station [18]
22:20 Barendrecht station [18] - 22:37 Dordrecht station [17]
========== Train path:
http://localhost:4224/path/ams2147rot
Route of path ams2147rot
[ams2147rot] Train number 383, Amsterdam - Rotterdam
[ams0857rot] Timetable number 571, Amsterdam - Den Haag - Rotterdam
18:49 Amsterdam CS station [16] - 19:03 Halfweg station [3]
19:03 Halfweg station [3] - 19:12 Haarlem station [4]
19:16 Haarlem station [4] - 20:08 Leiden station [6]
20:15 Leiden station [6] - 20:40 Den Haag HS station [7]
21:02 Den Haag HS station [7] - 21:15 Delft station [8]
21:19 Delft station [8] - 21:33 Schiedam station [9]
21:38 Schiedam station [9] - 21:47 Rotterdam DP station [20]
========== Time table path:
http://localhost:4224/path/ams0857rot
[ams0857rot] Timetable number 571, Amsterdam - Den Haag - Rotterdam
[uit0808ams] Line number 174, Amsterdam - Uitgeest (- Nieuwediep)
Km 0.0 Amsterdam CS station [16] - Km 1.6 Echo junction [15]
[ech0016alph] Line number 101.1, diversion Amsterdam - Haarlem to
Uitgeest - Amsterdam
Km 1.6 Echo junction [15] - Km 3.2 Alpha junction [2]
[ams0844rot] Line number 101, Amsterdam - Rotterdam
Km 3.2 Alpha junction [2] - Km 11.0 Halfweg station [3]
Km 11.0 Halfweg station [3] - Km 18.4 Haarlem station [4]
Km 18.4 Haarlem station [4] - Km 47.2 Leiden station [6]
Km 47.2 Leiden station [6] - Km 62.6 Den Haag HS station [7]
Km 62.6 Den Haag HS station [7] - Km 71.0 Delft station [8]
Km 71.0 Delft station [8] - Km 81.3 Schiedam station [9]
Km 81.3 Schiedam station [9] - Km 84.6 Delta junction [11]
[dord0501rot] Line number 172, Rotterdam - Dordrecht (- Breda)
Km 84.6 Delta junction [11] - Km 85.7 Rotterdam DP station [20]
========== Railway line path:
http://localhost:4224/path/uit0808ams
Route of path uit0808ams
[uit0808ams] Line number 174, Amsterdam - Uitgeest (- Nieuwediep)
Km 57.8 Uitgeest station [13] - Km 70.9 Zaandam station [14]
Km 70.9 Zaandam station [14] - Km 79.2 Echo junction [15]
Km 79.2 Echo junction [15] - Km 80.8 Amsterdam CS station [16]
========== Incoming/outgoing paths:
http://localhost:4224/inout/9
Incoming/outgoing paths of node 9
21:33 Schiedam station [9] < 18:49 Amsterdam CS station [16]
[ams2147rot] Train number 383, Amsterdam - Rotterdam
21:33 Schiedam station [9] < 18:49 Amsterdam CS station [16]
[ams2237dord] Through carriage 18:49, Amsterdam - Rotterdam -
Dordrecht
21:38 Schiedam station [9] > 21:47 Rotterdam DP station [20]
[ams2147rot] Train number 383, Amsterdam - Rotterdam
21:38 Schiedam station [9] > 22:37 Dordrecht station [17]
[ams2237dord] Through carriage 18:49, Amsterdam - Rotterdam -
Dordrecht
21:42 Schiedam station [9] < 21:02 Hoek van Holland harbour [23]
[hoek2237dord] Train number 112, Hoek van Holland - Rotterdam -
Dordrecht
21:43 Schiedam station [9] > 22:37 Dordrecht station [17]
[hoek2237dord] Train number 112, Hoek van Holland - Rotterdam -
Dordrecht
Km 4.4 Schiedam station [9] < Km 0.0 Rotterdam DP station [20]
[rot0275hoek] Timetable number 571a, Rotterdam - Hoek van
Holland
Km 4.4 Schiedam station [9] > Km 27.5 Hoek van Holland harbour [23]
[rot0275hoek] Timetable number 571a, Rotterdam - Hoek van
Holland
Km 79.7 Schiedam station [9] < Km 0.0 Amsterdam HSM station [1]
[ams0844rot] Line number 101, Amsterdam - Rotterdam
Km 79.7 Schiedam station [9] > Km 84.4 Rotterdam HSM station [12]
[ams0844rot] Line number 101, Amsterdam - Rotterdam
Km 81.3 Schiedam station [9] < Km 0.0 Amsterdam CS station [16]
[ams0857rot] Timetable number 571, Amsterdam - Den Haag -
Rotterdam
Km 81.3 Schiedam station [9] > Km 85.7 Rotterdam DP station [20]
[ams0857rot] Timetable number 571, Amsterdam - Den Haag -
Rotterdam