-
Notifications
You must be signed in to change notification settings - Fork 1
/
PathPatternTests.kt
33 lines (24 loc) · 1.05 KB
/
PathPatternTests.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import QueryObjects.Relationship.PathLength.Ranges.ANY
class PathPatternTests {
fun perform() {
println("------------------DIRECTION TESTS------------------")
val acted = relationship(type="ACTED_IN")
val filmed = relationship(type="FILMED")
val actor = node(label="Person")
val movie = node("movie", "Movie")
val hollywood = node("hollywood", "Hollywood")
val req1 = create {
actor has acted to movie which filmed by hollywood
}
DSLTest("PathPattern", req1,
"CREATE (:Person)-[:ACTED_IN]->(movie:Movie)<-[:FILMED]-(hollywood:Hollywood)")
val andrew = node("andrew")
val michael = node("michael")
val worksAt = relationship (type="WORKS_AT")
val req2 = create {
andrew has worksAt[ANY] to node("JetBrains", "Company") which worksAt by michael named "p"
}
DSLTest("PathPatternFullAndNamed", req2,
"CREATE p = (andrew)-[:WORKS_AT*]->(JetBrains:Company)<-[:WORKS_AT]-(michael)")
}
}