-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNode_Embeddings_2d_Hash_GNN_Stream.cypher
29 lines (28 loc) · 1.27 KB
/
Node_Embeddings_2d_Hash_GNN_Stream.cypher
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
// Node Embeddings 2c using Hash GNN (Graph Neural Networks): Stream. Requires "Add_file_name and_extension.cypher".
CALL gds.beta.hashgnn.stream(
$dependencies_projection + '-cleaned', {
embeddingDensity: toInteger($dependencies_projection_embedding_dimension) * 2
,iterations: 3
,generateFeatures: {
dimension: toInteger($dependencies_projection_embedding_dimension) * 4
,densityLevel: 3
}
,outputDimension: toInteger($dependencies_projection_embedding_dimension)
,neighborInfluence: 0.9
,randomSeed: 30
}
)
YIELD nodeId, embedding
WITH gds.util.asNode(nodeId) AS codeUnit
,embedding
OPTIONAL MATCH (artifact:Java:Artifact)-[:CONTAINS]->(codeUnit)
WITH *, artifact.name AS artifactName
OPTIONAL MATCH (projectRoot:Directory)<-[:HAS_ROOT]-(proj:TS:Project)-[:CONTAINS]->(codeUnit)
WITH *, last(split(projectRoot.absoluteFileName, '/')) AS projectName
RETURN DISTINCT
coalesce(codeUnit.fqn, codeUnit.globalFqn, codeUnit.fileName, codeUnit.signature, codeUnit.name) AS codeUnitName
,codeUnit.name AS shortCodeUnitName
,coalesce(artifactName, projectName) AS projectName
,coalesce(codeUnit.communityLeidenId, 0) AS communityId
,coalesce(codeUnit.centralityPageRank, 0.01) AS centrality
,embedding