-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathqueries
37 lines (25 loc) · 2.38 KB
/
queries
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
34
35
36
37
// Show entire Graph
GRAPH.QUERY IAM_SMALL "MATCH (n)-[r]->(m) RETURN ID(n), n.name, n.type, ID(m), m.name, m.type"
// Show resources Yiftach can access
GRAPH.QUERY IAM_SMALL "MATCH (n:User)-[*]->(m:Resource) where n.userId=1 RETURN ID(n), n.name, n.type, ID(m), m.name, m.type"
// Show resources Itamar can access
GRAPH.QUERY IAM_SMALL "MATCH (n:User)-[*]->(m:Resource) WHERE n.userId=4 RETURN ID(n), n.name, n.type, ID(m), m.name, m.type"
// show semi long resource query
GRAPH.QUERY IAM_LARGE "MATCH (n:User {userId:49203})-[:PART_OF_TEAM*1..5]->()-[:RESOURCE_ACCESS]->(m:Resource {resourceId:604}) RETURN ID(n), n.name, n.type, ID(m), m.name, m.type LIMIT 1"
// Show longest user to resource access query and query time doubles
GRAPH.QUERY IAM_LARGE "MATCH (n:User {userId:49203})-[:PART_OF_TEAM*1..10]->()-[:RESOURCE_ACCESS]->(m:Resource {resourceId:1}) RETURN ID(n), n.name, n.type, ID(m), m.name, m.type LIMIT 1"
query1 = 'MATCH (n)-[r]->(m) RETURN ID(n), n.name, n.type, ID(m), m.name, m.type';
query2 = 'MATCH (n:User)-[*]->(m:Resource) where n.userId=1 RETURN ID(n), n.name, n.type, ID(m), m.name, m.type';
query3 = 'MATCH (n:User)-[*]->(m:Resource) WHERE n.userId=4 RETURN ID(n), n.name, n.type, ID(m), m.name, m.type';
query4 = 'MATCH (n:User {userId:49203})-[:PART_OF_TEAM*1..5]->()-[:RESOURCE_ACCESS]->(m:Resource {resourceId:604}) RETURN ID(n), n.name, n.type, ID(m), m.name, m.type LIMIT 1';
query5 = 'MATCH (n:User {userId:49203})-[:PART_OF_TEAM*1..10]->()-[:RESOURCE_ACCESS]->(m:Resource {resourceId:1}) RETURN ID(n), n.name, n.type, ID(m), m.name, m.type LIMIT 1';
key = 'IAM_SMALL';
key = 'IAM_LARGE';
GRAPH.QUERY IAM_LARGE "MATCH (p:User {userId:49203})-[*1..3]->(f:Resource) RETURN count(f)"
GRAPH.QUERY IAM_LARGE "MATCH (p:User {userId:49203})-[*1..4]->(f:Resource) RETURN count(f)"
GRAPH.QUERY IAM_LARGE "MATCH (p:User {userId:49203})-[*1..5]->(f:Resource) RETURN count(f)"
GRAPH.QUERY IAM_LARGE "MATCH (t:Team {teamId:1})<-[*3..3]-(u:User) RETURN count(u)"
GRAPH.QUERY IAM_LARGE "MATCH (t:Team {teamId:1})<-[*6..6]-(u:User) RETURN count(u)"
GRAPH.QUERY IAM_LARGE "MATCH (t:Team {teamId:1})<-[*9..9]-(u:User) RETURN count(u)"
GRAPH.QUERY IAM_LARGE "MATCH (p:User {userId:49203})-[:PART_OF_TEAM*1..10]->()-[:RESOURCE_ACCESS]->(f:Resource {resourceId:1}) RETURN f"
GRAPH.QUERY IAM_LARGE "MATCH (p:User {userId:147619})-[:PART_OF_TEAM*1..1]->()-[:RESOURCE_ACCESS]->(f:Resource {resourceId:147619}) RETURN f"