edges
This commit is contained in:
10
exercice2.md
10
exercice2.md
@@ -67,6 +67,16 @@ CREATE CONSTRAINT individu_id IF NOT EXISTS
|
|||||||
REQUIRE i.id IS UNIQUE;
|
REQUIRE i.id IS UNIQUE;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```cypher
|
||||||
|
LOAD CSV WITH HEADERS
|
||||||
|
FROM 'file:///edges.csv' AS row
|
||||||
|
FIELDTERMINATOR ';'
|
||||||
|
MATCH (a:Individu {id: toInteger(row.source)})
|
||||||
|
MATCH (b:Individu {id: toInteger(row.target)})
|
||||||
|
MERGE (a)-[r:AMI]->(b)
|
||||||
|
MERGE (b)-[r2:AMI]->(a);
|
||||||
|
```
|
||||||
|
|
||||||
1. Combien d'amis a l'id 58 ?
|
1. Combien d'amis a l'id 58 ?
|
||||||
|
|
||||||
2. Quels sont les amis de l'id 58 ?
|
2. Quels sont les amis de l'id 58 ?
|
||||||
|
|||||||
10
reponses.md
10
reponses.md
@@ -29,15 +29,7 @@ MATCH (i:Individu {id: 58 })
|
|||||||
RETURN i;
|
RETURN i;
|
||||||
```
|
```
|
||||||
|
|
||||||
```cypher
|
|
||||||
LOAD CSV WITH HEADERS
|
|
||||||
FROM 'file:///edges.csv' AS row
|
|
||||||
FIELDTERMINATOR ';'
|
|
||||||
MATCH (a:Individu {id: toInteger(row.source)})
|
|
||||||
MATCH (b:Individu {id: toInteger(row.target)})
|
|
||||||
MERGE (a)-[r:AMI]->(b)
|
|
||||||
MERGE (b)-[r2:AMI]->(a);
|
|
||||||
```
|
|
||||||
|
|
||||||
```cypher
|
```cypher
|
||||||
MATCH (i:Individu)
|
MATCH (i:Individu)
|
||||||
|
|||||||
Reference in New Issue
Block a user