Skip to content

Commit ccfa33c

Browse files
committed
Link matching declarations by their names and modules
1 parent cc7e415 commit ccfa33c

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Link matching external to internal Typescript declarations with an IS_IMPLEMENTED_IN relationship
2+
3+
MATCH (externalModule:TS&ExternalModule)-[:EXPORTS]->(externalDeclaration:TS&ExternalDeclaration)
4+
MATCH (externalModule)-[:RESOLVES_TO]->(internalModule:TS&Module)
5+
MATCH (externalModule)-[:EXPORTS]->(internalDeclaration:TS&!ExternalDeclaration)
6+
WHERE externalDeclaration.name = internalDeclaration.name
7+
WITH externalDeclaration, internalDeclaration
8+
CALL { WITH externalDeclaration, internalDeclaration
9+
MERGE (externalDeclaration)-[:IS_IMPLEMENTED_IN]->(internalDeclaration)
10+
} IN TRANSACTIONS
11+
RETURN count( DISTINCT externalDeclaration.globalFqn + ' -> ' + internalDeclaration.globalFqn) AS linkedDeclarationCount
12+
,collect(DISTINCT externalDeclaration.globalFqn + ' -> ' + internalDeclaration.globalFqn)[0..4] AS linkedDeclarationExamples
13+
//Debugging
14+
//RETURN split(internalDeclaration.globalFqn, '/')[-6..] AS shortInternalDeclaration
15+
// ,split(externalDeclaration.globalFqn, '/')[-6..] AS shortExternalDeclaration
16+
// ,count(*)
17+
//ORDER BY shortInternalDeclaration
18+
//LIMIT 30

cypher/Typescript_Enrichment/Add_RESOLVES_TO_relationship_for_matching_declarations.cypher

Lines changed: 0 additions & 14 deletions
This file was deleted.

scripts/prepareAnalysis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ execute_cypher "${TYPESCRIPT_CYPHER_DIR}/Add_namespace_property_on_nodes_from_li
9191

9292
# Preparation - Enrich Graph for Typescript by adding relationships between Modules with the same globalFqn
9393
execute_cypher "${TYPESCRIPT_CYPHER_DIR}/Add_RESOLVES_TO_relationship_for_matching_modules.cypher"
94-
execute_cypher "${TYPESCRIPT_CYPHER_DIR}/Add_RESOLVES_TO_relationship_for_matching_declarations.cypher"
94+
execute_cypher "${TYPESCRIPT_CYPHER_DIR}/Add_IS_IMPLEMENTED_IN_relationship_for_matching_declarations.cypher"
9595
execute_cypher "${TYPESCRIPT_CYPHER_DIR}/Add_DEPENDS_ON_relationship_to_resolved_modules.cypher"
9696

9797
# Preparation - Add weights to Java Package DEPENDS_ON relationships

0 commit comments

Comments
 (0)