Skip to content

Commit 02645e5

Browse files
committed
Add Cypher query to explore common file paths
1 parent 4731978 commit 02645e5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Get common global full qualified name prefix
2+
3+
MATCH (module:TS)
4+
WHERE module.globalFqn STARTS WITH '/'
5+
WITH count(module.globalFqn) AS numberOfAllModules
6+
,collect(module) AS modules
7+
UNWIND modules AS module
8+
WITH numberOfAllModules
9+
,module.globalFqn AS moduleFullQualifiedName
10+
,split(module.globalFqn, '/') AS paths
11+
UNWIND paths AS path
12+
WITH path, numberOfAllModules, count(*) AS numberOfModulesUsingThePath
13+
WHERE numberOfAllModules = numberOfModulesUsingThePath
14+
RETURN apoc.text.join(collect(path), '/') AS commonPath

0 commit comments

Comments
 (0)