Exercice2
This commit is contained in:
12
exercice2.md
12
exercice2.md
@@ -1,6 +1,6 @@
|
|||||||
docker build -t mon-app .
|
docker build -t mon-app .
|
||||||
|
|
||||||
http://localhost:3000
|
http://localhost:7474
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -21,19 +21,21 @@ SET p.nom = row.nom,
|
|||||||
```
|
```
|
||||||
LOAD CSV WITH HEADERS FROM 'file:///routes.csv' AS row
|
LOAD CSV WITH HEADERS FROM 'file:///routes.csv' AS row
|
||||||
WITH row
|
WITH row
|
||||||
MATCH (a:Lieu {id: toInteger(row.source)})
|
MATCH (a:Point {id: toInteger(row.source)})
|
||||||
WITH a, row
|
WITH a, row
|
||||||
MATCH (b:Lieu {id: toInteger(row.target)})
|
MATCH (b:Point {id: toInteger(row.target)})
|
||||||
MERGE (a)-[r:ROUTE {route_id: toInteger(row.route_id)}]->(b)
|
MERGE (a)-[r:ROUTE {route_id: toInteger(row.route_id)}]->(b)
|
||||||
SET r.tag = row.tag, r.cout = toFloat(row.cout);
|
SET r.tag = row.tag, r.cout = toFloat(row.cout);
|
||||||
|
```
|
||||||
|
|
||||||
-- routes inverses si cout_inverse != -1
|
-- routes inverses si cout_inverse != -1
|
||||||
|
```
|
||||||
LOAD CSV WITH HEADERS FROM 'file:///routes.csv' AS row
|
LOAD CSV WITH HEADERS FROM 'file:///routes.csv' AS row
|
||||||
WITH row
|
WITH row
|
||||||
WHERE toFloat(row.cout_inverse) <> -1
|
WHERE toFloat(row.cout_inverse) <> -1
|
||||||
MATCH (a:Lieu {id: toInteger(row.source)})
|
MATCH (a:Point {id: toInteger(row.source)})
|
||||||
WITH a, row
|
WITH a, row
|
||||||
MATCH (b:Lieu {id: toInteger(row.target)})
|
MATCH (b:Point {id: toInteger(row.target)})
|
||||||
MERGE (b)-[r:ROUTE {route_id: toInteger(row.route_id) * 1000}]->(a)
|
MERGE (b)-[r:ROUTE {route_id: toInteger(row.route_id) * 1000}]->(a)
|
||||||
SET r.tag = row.tag, r.cout = toFloat(row.cout_inverse);
|
SET r.tag = row.tag, r.cout = toFloat(row.cout_inverse);
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user