diff --git a/cypher/Centrality/Centrality_10_Summary.cypher b/cypher/Centrality/Centrality_10_Summary.cypher new file mode 100644 index 000000000..3e4d1e269 --- /dev/null +++ b/cypher/Centrality/Centrality_10_Summary.cypher @@ -0,0 +1,17 @@ +// Centrality Summary + +MATCH (codeUnit) +WHERE (codeUnit.incomingDependencies > 0 OR codeUnit.outgoingDependencies > 0) + AND $dependencies_projection_node IN LABELS(codeUnit) +RETURN coalesce(codeUnit.fqn, codeUnit.fileName, codeUnit.signature, codeUnit.name) AS name + ,coalesce(codeUnit.name, replace(last(split(codeUnit.fileName, '/')), '.jar', '')) AS shortName + ,codeUnit.centralityPageRank AS pageRank + ,codeUnit.centralityArticleRank AS articleRank + ,codeUnit.centralityBetweenness AS betweenness + ,codeUnit.centralityCostEffectiveLazyForward AS costEffectiveLazyForward + ,codeUnit.centralityHarmonic AS harmonicCloseness + ,codeUnit.centralityCloseness AS closeness + ,codeUnit.centralityHyperlinkInducedTopicSearchAuthority AS hyperlinkInducedTopicSearchAuthority + ,codeUnit.centralityHyperlinkInducedTopicSearchHub AS hyperlinkInducedTopicSearchHub + ,codeUnit.incomingDependencies AS incomingDependencies + ,codeUnit.outgoingDependencies AS outgoingDependencies \ No newline at end of file diff --git a/cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher b/cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher index 9cfd12a46..1d894a22b 100644 --- a/cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher +++ b/cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher @@ -1,12 +1,12 @@ -//Centrality 2a Page Rank Estimate Memory +// Centrality 2a Page Rank Estimate Memory CALL gds.pageRank.write.estimate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { writeProperty: $dependencies_projection_write_property ,maxIterations: 50 ,dampingFactor: 0.85 ,tolerance: 0.00000001 - ,relationshipWeightProperty: $dependencies_projection_weight_property + ,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END ,scaler: "L1Norm" }) YIELD nodeCount, relationshipCount, bytesMin, bytesMax, heapPercentageMin, heapPercentageMax, treeView diff --git a/cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher b/cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher index c41d8d581..cd2d88900 100644 --- a/cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher +++ b/cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher @@ -1,11 +1,11 @@ -//Centrality 2b Page Rank Statistics +// Centrality 2b Page Rank Statistics CALL gds.pageRank.stats( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { maxIterations: 50 ,dampingFactor: 0.85 ,tolerance: 0.00000001 - ,relationshipWeightProperty: $dependencies_projection_weight_property + ,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END ,scaler: "L1Norm" }) YIELD ranIterations diff --git a/cypher/Centrality/Centrality_3c_Page_Rank_Mutate.cypher b/cypher/Centrality/Centrality_3c_Page_Rank_Mutate.cypher new file mode 100644 index 000000000..94d11584d --- /dev/null +++ b/cypher/Centrality/Centrality_3c_Page_Rank_Mutate.cypher @@ -0,0 +1,35 @@ +// Centrality 3c Page Rank Mutate + +CALL gds.pageRank.mutate( + $dependencies_projection + '-cleaned', { + maxIterations: 50 + ,dampingFactor: 0.85 + ,tolerance: 0.00000001 + ,scaler: "L2Norm" + ,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END + ,mutateProperty: $dependencies_projection_write_property +}) + YIELD nodePropertiesWritten + ,didConverge + ,ranIterations + ,preProcessingMillis + ,computeMillis + ,mutateMillis + ,postProcessingMillis + ,centralityDistribution +RETURN nodePropertiesWritten + ,didConverge + ,ranIterations + ,preProcessingMillis + ,computeMillis + ,mutateMillis + ,postProcessingMillis + ,centralityDistribution.min + ,centralityDistribution.mean + ,centralityDistribution.max + ,centralityDistribution.p50 + ,centralityDistribution.p75 + ,centralityDistribution.p90 + ,centralityDistribution.p95 + ,centralityDistribution.p99 + ,centralityDistribution.p999 \ No newline at end of file diff --git a/cypher/Centrality/Centrality_3c_Page_Rank_Stream.cypher b/cypher/Centrality/Centrality_3d_Page_Rank_Stream.cypher similarity index 65% rename from cypher/Centrality/Centrality_3c_Page_Rank_Stream.cypher rename to cypher/Centrality/Centrality_3d_Page_Rank_Stream.cypher index 28abbd527..02acb8990 100644 --- a/cypher/Centrality/Centrality_3c_Page_Rank_Stream.cypher +++ b/cypher/Centrality/Centrality_3d_Page_Rank_Stream.cypher @@ -1,11 +1,11 @@ -//Centrality 3c Page Rank Stream +// Centrality 3d Page Rank Stream CALL gds.pageRank.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { maxIterations: 50 ,dampingFactor: 0.85 ,tolerance: 0.00000001 - ,relationshipWeightProperty: $dependencies_projection_weight_property + ,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END ,scaler: "L2Norm" }) YIELD nodeId, score diff --git a/cypher/Centrality/Centrality_3d_Page_Rank_Write.cypher b/cypher/Centrality/Centrality_3e_Page_Rank_Write.cypher similarity index 78% rename from cypher/Centrality/Centrality_3d_Page_Rank_Write.cypher rename to cypher/Centrality/Centrality_3e_Page_Rank_Write.cypher index 6d192bb98..0591a3d8b 100644 --- a/cypher/Centrality/Centrality_3d_Page_Rank_Write.cypher +++ b/cypher/Centrality/Centrality_3e_Page_Rank_Write.cypher @@ -1,11 +1,11 @@ -//Centrality 3d Page Rank Write +// Centrality 3e Page Rank Write CALL gds.pageRank.write( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { maxIterations: 50 ,dampingFactor: 0.85 ,tolerance: 0.00000001 - ,relationshipWeightProperty: $dependencies_projection_weight_property + ,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END ,scaler: "L2Norm" ,writeProperty: $dependencies_projection_write_property }) diff --git a/cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher b/cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher index aca0c8ad1..5c926cb58 100644 --- a/cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher +++ b/cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher @@ -1,11 +1,12 @@ -//Centrality 4a Article Rank Estimate Memory +// Centrality 4a Article Rank Estimate Memory + CALL gds.articleRank.write.estimate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { writeProperty: $dependencies_projection_write_property ,maxIterations: 30 ,dampingFactor: 0.85 ,tolerance: 0.00000001 - ,relationshipWeightProperty: $dependencies_projection_weight_property + ,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END ,scaler: "L1Norm" }) YIELD nodeCount, relationshipCount, bytesMin, bytesMax, heapPercentageMin, heapPercentageMax, treeView diff --git a/cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher b/cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher index b2626c33a..80141de9d 100644 --- a/cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher +++ b/cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher @@ -1,10 +1,11 @@ -//Centrality 4b Article Rank Statistics +// Centrality 4b Article Rank Statistics + CALL gds.articleRank.stats( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { maxIterations: 30 ,dampingFactor: 0.85 ,tolerance: 0.00000001 - ,relationshipWeightProperty: $dependencies_projection_weight_property + ,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END ,scaler: "L1Norm" }) YIELD ranIterations diff --git a/cypher/Centrality/Centrality_4c_Article_Rank_Mutate.cypher b/cypher/Centrality/Centrality_4c_Article_Rank_Mutate.cypher new file mode 100644 index 000000000..443b1e1f1 --- /dev/null +++ b/cypher/Centrality/Centrality_4c_Article_Rank_Mutate.cypher @@ -0,0 +1,35 @@ +//Centrality 4c Article Rank Mutate + +CALL gds.articleRank.mutate( + $dependencies_projection + '-cleaned', { + maxIterations: 30 + ,dampingFactor: 0.85 + ,tolerance: 0.00000001 + ,scaler: "L2Norm" + ,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END + ,mutateProperty: $dependencies_projection_write_property +}) + YIELD nodePropertiesWritten + ,didConverge + ,ranIterations + ,preProcessingMillis + ,computeMillis + ,mutateMillis + ,postProcessingMillis + ,centralityDistribution +RETURN nodePropertiesWritten + ,didConverge + ,ranIterations + ,preProcessingMillis + ,computeMillis + ,mutateMillis + ,postProcessingMillis + ,centralityDistribution.min + ,centralityDistribution.mean + ,centralityDistribution.max + ,centralityDistribution.p50 + ,centralityDistribution.p75 + ,centralityDistribution.p90 + ,centralityDistribution.p95 + ,centralityDistribution.p99 + ,centralityDistribution.p999 \ No newline at end of file diff --git a/cypher/Centrality/Centrality_4c_Article_Rank_Stream.cypher b/cypher/Centrality/Centrality_4d_Article_Rank_Stream.cypher similarity index 65% rename from cypher/Centrality/Centrality_4c_Article_Rank_Stream.cypher rename to cypher/Centrality/Centrality_4d_Article_Rank_Stream.cypher index 804515ef4..6ff8e3eb4 100644 --- a/cypher/Centrality/Centrality_4c_Article_Rank_Stream.cypher +++ b/cypher/Centrality/Centrality_4d_Article_Rank_Stream.cypher @@ -1,11 +1,11 @@ -//Centrality 4c Article Rank Stream +//Centrality 4d Article Rank Stream CALL gds.articleRank.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { maxIterations: 30 ,dampingFactor: 0.85 ,tolerance: 0.00000001 - ,relationshipWeightProperty: $dependencies_projection_weight_property + ,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END ,scaler: "L2Norm" }) YIELD nodeId, score diff --git a/cypher/Centrality/Centrality_4d_Article_Rank_Write.cypher b/cypher/Centrality/Centrality_4e_Article_Rank_Write.cypher similarity index 78% rename from cypher/Centrality/Centrality_4d_Article_Rank_Write.cypher rename to cypher/Centrality/Centrality_4e_Article_Rank_Write.cypher index 90e7d4cd8..400941159 100644 --- a/cypher/Centrality/Centrality_4d_Article_Rank_Write.cypher +++ b/cypher/Centrality/Centrality_4e_Article_Rank_Write.cypher @@ -1,11 +1,11 @@ -//Centrality 4d Article Rank Write +//Centrality 4e Article Rank Write CALL gds.articleRank.write( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { maxIterations: 50 ,dampingFactor: 0.85 ,tolerance: 0.00000001 - ,relationshipWeightProperty: $dependencies_projection_weight_property + ,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END ,scaler: "L2Norm" ,writeProperty: $dependencies_projection_write_property }) diff --git a/cypher/Centrality/Centrality_5a_Betweeness_Estimate.cypher b/cypher/Centrality/Centrality_5a_Betweeness_Estimate.cypher index 7763f3407..2f8c37610 100644 --- a/cypher/Centrality/Centrality_5a_Betweeness_Estimate.cypher +++ b/cypher/Centrality/Centrality_5a_Betweeness_Estimate.cypher @@ -1,8 +1,8 @@ -//Centrality 5a Betweeness Estimate +// Centrality 5a Betweeness Estimate CALL gds.betweenness.write.estimate( - $dependencies_projection + '-without-empty', { - relationshipWeightProperty: $dependencies_projection_weight_property + $dependencies_projection + '-cleaned', { + relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END ,writeProperty: $dependencies_projection_write_property }) YIELD nodeCount, relationshipCount, bytesMin, bytesMax, heapPercentageMin, heapPercentageMax, treeView diff --git a/cypher/Centrality/Centrality_5b_Betweeness_Statistics.cypher b/cypher/Centrality/Centrality_5b_Betweeness_Statistics.cypher index 0b8b6c66a..2a4ff8b39 100644 --- a/cypher/Centrality/Centrality_5b_Betweeness_Statistics.cypher +++ b/cypher/Centrality/Centrality_5b_Betweeness_Statistics.cypher @@ -1,8 +1,8 @@ -//Centrality 5b Betweeness Statistics +// Centrality 5b Betweeness Statistics CALL gds.betweenness.stats( - $dependencies_projection + '-without-empty', { - relationshipWeightProperty: $dependencies_projection_weight_property + $dependencies_projection + '-cleaned', { + relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END }) YIELD preProcessingMillis ,computeMillis diff --git a/cypher/Centrality/Centrality_5c_Betweeness_Mutate.cypher b/cypher/Centrality/Centrality_5c_Betweeness_Mutate.cypher new file mode 100644 index 000000000..64cd092ab --- /dev/null +++ b/cypher/Centrality/Centrality_5c_Betweeness_Mutate.cypher @@ -0,0 +1,27 @@ +// Centrality 5c Betweeness Mutate + +CALL gds.betweenness.mutate( + $dependencies_projection + '-cleaned', { + relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END + ,mutateProperty: $dependencies_projection_write_property +}) + YIELD nodePropertiesWritten + ,preProcessingMillis + ,computeMillis + ,mutateMillis + ,postProcessingMillis + ,centralityDistribution +RETURN nodePropertiesWritten + ,preProcessingMillis + ,computeMillis + ,mutateMillis + ,postProcessingMillis + ,centralityDistribution.min + ,centralityDistribution.mean + ,centralityDistribution.max + ,centralityDistribution.p50 + ,centralityDistribution.p75 + ,centralityDistribution.p90 + ,centralityDistribution.p95 + ,centralityDistribution.p99 + ,centralityDistribution.p999 \ No newline at end of file diff --git a/cypher/Centrality/Centrality_5c_Betweeness_Stream.cypher b/cypher/Centrality/Centrality_5d_Betweeness_Stream.cypher similarity index 60% rename from cypher/Centrality/Centrality_5c_Betweeness_Stream.cypher rename to cypher/Centrality/Centrality_5d_Betweeness_Stream.cypher index 09120f602..ff68ff127 100644 --- a/cypher/Centrality/Centrality_5c_Betweeness_Stream.cypher +++ b/cypher/Centrality/Centrality_5d_Betweeness_Stream.cypher @@ -1,8 +1,8 @@ -// Centrality 5c Betweeness Stream +// Centrality 5d Betweeness Stream CALL gds.betweenness.stream( - $dependencies_projection + '-without-empty', { - relationshipWeightProperty: $dependencies_projection_weight_property + $dependencies_projection + '-cleaned', { + relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END }) YIELD nodeId, score WITH gds.util.asNode(nodeId) AS member, score diff --git a/cypher/Centrality/Centrality_5d_Betweeness_Write.cypher b/cypher/Centrality/Centrality_5e_Betweeness_Write.cypher similarity index 74% rename from cypher/Centrality/Centrality_5d_Betweeness_Write.cypher rename to cypher/Centrality/Centrality_5e_Betweeness_Write.cypher index 34f2dae85..e8587cb54 100644 --- a/cypher/Centrality/Centrality_5d_Betweeness_Write.cypher +++ b/cypher/Centrality/Centrality_5e_Betweeness_Write.cypher @@ -1,8 +1,8 @@ -// Centrality 5d Betweeness Write +// Centrality 5e Betweeness Write CALL gds.betweenness.write( - $dependencies_projection + '-without-empty', { - relationshipWeightProperty: $dependencies_projection_weight_property + $dependencies_projection + '-cleaned', { + relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END ,writeProperty: $dependencies_projection_write_property }) YIELD nodePropertiesWritten diff --git a/cypher/Centrality/Centrality_6a_Cost_effective_Lazy_Forward_CELF_Estimate.cypher b/cypher/Centrality/Centrality_6a_Cost_effective_Lazy_Forward_CELF_Estimate.cypher index d68de7096..eb18ae6bd 100644 --- a/cypher/Centrality/Centrality_6a_Cost_effective_Lazy_Forward_CELF_Estimate.cypher +++ b/cypher/Centrality/Centrality_6a_Cost_effective_Lazy_Forward_CELF_Estimate.cypher @@ -1,7 +1,7 @@ -// Centrality 6c Cost-effective Lazy Forward (CELF) Estimate +// Centrality 6a Cost-effective Lazy Forward (CELF) Estimate - CALL gds.beta.influenceMaximization.celf.write.estimate( - $dependencies_projection + '-without-empty', { + CALL gds.influenceMaximization.celf.write.estimate( + $dependencies_projection + '-cleaned', { seedSetSize: 5 ,writeProperty: $dependencies_projection_write_property }) diff --git a/cypher/Centrality/Centrality_6b_Cost_effective_Lazy_Forward_CELF_Statistics.cypher b/cypher/Centrality/Centrality_6b_Cost_effective_Lazy_Forward_CELF_Statistics.cypher index ac162508c..cda6d9523 100644 --- a/cypher/Centrality/Centrality_6b_Cost_effective_Lazy_Forward_CELF_Statistics.cypher +++ b/cypher/Centrality/Centrality_6b_Cost_effective_Lazy_Forward_CELF_Statistics.cypher @@ -1,7 +1,7 @@ -// Centrality 6b Cost-effective Lazy Forward (CELF) Estimate +// Centrality 6b Cost-effective Lazy Forward (CELF) Statistics -CALL gds.beta.influenceMaximization.celf.stats( - $dependencies_projection + '-without-empty', { +CALL gds.influenceMaximization.celf.stats( + $dependencies_projection + '-cleaned', { seedSetSize: 5 }) YIELD computeMillis diff --git a/cypher/Centrality/Centrality_6c_Cost_effective_Lazy_Forward_CELF_Mutate.cypher b/cypher/Centrality/Centrality_6c_Cost_effective_Lazy_Forward_CELF_Mutate.cypher new file mode 100644 index 000000000..01586af5a --- /dev/null +++ b/cypher/Centrality/Centrality_6c_Cost_effective_Lazy_Forward_CELF_Mutate.cypher @@ -0,0 +1,17 @@ +// Centrality 6c Cost-effective Lazy Forward (CELF) Mutate + + CALL gds.influenceMaximization.celf.mutate( + $dependencies_projection + '-cleaned', { + seedSetSize: 5 + ,mutateProperty: $dependencies_projection_write_property + }) + YIELD nodePropertiesWritten + ,nodeCount + ,totalSpread + ,computeMillis + ,mutateMillis +RETURN nodePropertiesWritten + ,nodeCount + ,totalSpread + ,computeMillis + ,mutateMillis \ No newline at end of file diff --git a/cypher/Centrality/Centrality_6c_Cost_effective_Lazy_Forward_CELF_Stream.cypher b/cypher/Centrality/Centrality_6d_Cost_effective_Lazy_Forward_CELF_Stream.cypher similarity index 67% rename from cypher/Centrality/Centrality_6c_Cost_effective_Lazy_Forward_CELF_Stream.cypher rename to cypher/Centrality/Centrality_6d_Cost_effective_Lazy_Forward_CELF_Stream.cypher index c3380e5aa..3da7ebe4f 100644 --- a/cypher/Centrality/Centrality_6c_Cost_effective_Lazy_Forward_CELF_Stream.cypher +++ b/cypher/Centrality/Centrality_6d_Cost_effective_Lazy_Forward_CELF_Stream.cypher @@ -1,7 +1,7 @@ -// Centrality 6c Cost-effective Lazy Forward (CELF) Stream +// Centrality 6d Cost-effective Lazy Forward (CELF) Stream - CALL gds.beta.influenceMaximization.celf.stream( - $dependencies_projection + '-without-empty', { + CALL gds.influenceMaximization.celf.stream( + $dependencies_projection + '-cleaned', { seedSetSize: 5 }) YIELD nodeId, spread diff --git a/cypher/Centrality/Centrality_6d_Cost_effective_Lazy_Forward_CELF_Write.cypher b/cypher/Centrality/Centrality_6e_Cost_effective_Lazy_Forward_CELF_Write.cypher similarity index 64% rename from cypher/Centrality/Centrality_6d_Cost_effective_Lazy_Forward_CELF_Write.cypher rename to cypher/Centrality/Centrality_6e_Cost_effective_Lazy_Forward_CELF_Write.cypher index 0fe0723c3..2f47c283b 100644 --- a/cypher/Centrality/Centrality_6d_Cost_effective_Lazy_Forward_CELF_Write.cypher +++ b/cypher/Centrality/Centrality_6e_Cost_effective_Lazy_Forward_CELF_Write.cypher @@ -1,7 +1,7 @@ -// Centrality 6d Cost-effective Lazy Forward (CELF) Write +// Centrality 6e Cost-effective Lazy Forward (CELF) Write - CALL gds.beta.influenceMaximization.celf.write( - $dependencies_projection + '-without-empty', { + CALL gds.influenceMaximization.celf.write( + $dependencies_projection + '-cleaned', { seedSetSize: 5 ,writeProperty: $dependencies_projection_write_property }) diff --git a/cypher/Centrality/Centrality_7b_Harmonic_Closeness_Statistics.cypher b/cypher/Centrality/Centrality_7b_Harmonic_Closeness_Statistics.cypher index bbded7550..bd8cb1f0b 100644 --- a/cypher/Centrality/Centrality_7b_Harmonic_Closeness_Statistics.cypher +++ b/cypher/Centrality/Centrality_7b_Harmonic_Closeness_Statistics.cypher @@ -1,7 +1,7 @@ // Centrality 7b Harmonic Closeness Statistics CALL gds.closeness.harmonic.stats( - $dependencies_projection + '-without-empty', {}) + $dependencies_projection + '-cleaned', {}) YIELD preProcessingMillis ,computeMillis ,postProcessingMillis diff --git a/cypher/Centrality/Centrality_7c_Harmonic_Closeness_Mutate.cypher b/cypher/Centrality/Centrality_7c_Harmonic_Closeness_Mutate.cypher new file mode 100644 index 000000000..efeb37f0e --- /dev/null +++ b/cypher/Centrality/Centrality_7c_Harmonic_Closeness_Mutate.cypher @@ -0,0 +1,26 @@ +// Centrality 7c Harmonic Closeness Mutate + +CALL gds.closeness.harmonic.mutate( + $dependencies_projection + '-cleaned', { + mutateProperty: $dependencies_projection_write_property +}) + YIELD nodePropertiesWritten + ,preProcessingMillis + ,computeMillis + ,mutateMillis + ,postProcessingMillis + ,centralityDistribution +RETURN nodePropertiesWritten + ,preProcessingMillis + ,computeMillis + ,mutateMillis + ,postProcessingMillis + ,centralityDistribution.min + ,centralityDistribution.mean + ,centralityDistribution.max + ,centralityDistribution.p50 + ,centralityDistribution.p75 + ,centralityDistribution.p90 + ,centralityDistribution.p95 + ,centralityDistribution.p99 + ,centralityDistribution.p999 \ No newline at end of file diff --git a/cypher/Centrality/Centrality_7c_Harmonic_Closeness_Stream.cypher b/cypher/Centrality/Centrality_7d_Harmonic_Closeness_Stream.cypher similarity index 80% rename from cypher/Centrality/Centrality_7c_Harmonic_Closeness_Stream.cypher rename to cypher/Centrality/Centrality_7d_Harmonic_Closeness_Stream.cypher index 1801c3241..03ae1f918 100644 --- a/cypher/Centrality/Centrality_7c_Harmonic_Closeness_Stream.cypher +++ b/cypher/Centrality/Centrality_7d_Harmonic_Closeness_Stream.cypher @@ -1,6 +1,6 @@ // Centrality 7a Harmonic Closeness Stream -CALL gds.alpha.closeness.harmonic.stream($dependencies_projection + '-without-empty', {}) +CALL gds.closeness.harmonic.stream($dependencies_projection + '-cleaned', {}) YIELD nodeId, centrality WITH gds.util.asNode(nodeId) AS member, centrality RETURN coalesce(member.fqn, member.fileName, member.name) AS memberName diff --git a/cypher/Centrality/Centrality_7d_Harmonic_Closeness_Write.cypher b/cypher/Centrality/Centrality_7e_Harmonic_Closeness_Write.cypher similarity index 86% rename from cypher/Centrality/Centrality_7d_Harmonic_Closeness_Write.cypher rename to cypher/Centrality/Centrality_7e_Harmonic_Closeness_Write.cypher index 7f9f0efb0..6b1fadae5 100644 --- a/cypher/Centrality/Centrality_7d_Harmonic_Closeness_Write.cypher +++ b/cypher/Centrality/Centrality_7e_Harmonic_Closeness_Write.cypher @@ -1,7 +1,7 @@ // Centrality 7d Harmonic Closeness Write -CALL gds.alpha.closeness.harmonic.write( - $dependencies_projection + '-without-empty', { +CALL gds.closeness.harmonic.write( + $dependencies_projection + '-cleaned', { ,writeProperty: $dependencies_projection_write_property }) YIELD nodes diff --git a/cypher/Centrality/Centrality_8b_Closeness_Statistics.cypher b/cypher/Centrality/Centrality_8b_Closeness_Statistics.cypher index 9e23c6d6e..f64c5c953 100644 --- a/cypher/Centrality/Centrality_8b_Closeness_Statistics.cypher +++ b/cypher/Centrality/Centrality_8b_Closeness_Statistics.cypher @@ -1,7 +1,7 @@ //Centrality 8b Closeness Statistics -CALL gds.beta.closeness.stats( - $dependencies_projection + '-without-empty', { +CALL gds.closeness.stats( + $dependencies_projection + '-cleaned', { useWassermanFaust: true }) YIELD preProcessingMillis diff --git a/cypher/Centrality/Centrality_8c_Closeness_Mutate.cypher b/cypher/Centrality/Centrality_8c_Closeness_Mutate.cypher new file mode 100644 index 000000000..9928376df --- /dev/null +++ b/cypher/Centrality/Centrality_8c_Closeness_Mutate.cypher @@ -0,0 +1,27 @@ +// Centrality 8c Closeness Mutate + +CALL gds.closeness.mutate( + $dependencies_projection + '-cleaned', { + useWassermanFaust: true + ,mutateProperty: $dependencies_projection_write_property +}) + YIELD nodePropertiesWritten + ,preProcessingMillis + ,computeMillis + ,mutateMillis + ,postProcessingMillis + ,centralityDistribution +RETURN nodePropertiesWritten + ,preProcessingMillis + ,computeMillis + ,mutateMillis + ,postProcessingMillis + ,centralityDistribution.min + ,centralityDistribution.mean + ,centralityDistribution.max + ,centralityDistribution.p50 + ,centralityDistribution.p75 + ,centralityDistribution.p90 + ,centralityDistribution.p95 + ,centralityDistribution.p99 + ,centralityDistribution.p999 \ No newline at end of file diff --git a/cypher/Centrality/Centrality_8c_Closeness_Stream.cypher b/cypher/Centrality/Centrality_8d_Closeness_Stream.cypher similarity index 82% rename from cypher/Centrality/Centrality_8c_Closeness_Stream.cypher rename to cypher/Centrality/Centrality_8d_Closeness_Stream.cypher index ecb68123e..c9691206c 100644 --- a/cypher/Centrality/Centrality_8c_Closeness_Stream.cypher +++ b/cypher/Centrality/Centrality_8d_Closeness_Stream.cypher @@ -1,7 +1,7 @@ // Centrality 8c Closeness Stream -CALL gds.beta.closeness.stream( - $dependencies_projection + '-without-empty', { +CALL gds.closeness.stream( + $dependencies_projection + '-cleaned', { useWassermanFaust: true }) YIELD nodeId, score diff --git a/cypher/Centrality/Centrality_8d_Closeness_Write.cypher b/cypher/Centrality/Centrality_8e_Closeness_Write.cypher similarity index 89% rename from cypher/Centrality/Centrality_8d_Closeness_Write.cypher rename to cypher/Centrality/Centrality_8e_Closeness_Write.cypher index 8004ed657..6b3695a39 100644 --- a/cypher/Centrality/Centrality_8d_Closeness_Write.cypher +++ b/cypher/Centrality/Centrality_8e_Closeness_Write.cypher @@ -1,7 +1,7 @@ // Centrality 8d Closeness Write -CALL gds.beta.closeness.write( - $dependencies_projection + '-without-empty', { +CALL gds.closeness.write( + $dependencies_projection + '-cleaned', { useWassermanFaust: true ,writeProperty: $dependencies_projection_write_property }) diff --git a/cypher/Centrality/Centrality_9a_Hyperlink_Induced_Topic_Search_HITS_Estimate.cypher b/cypher/Centrality/Centrality_9a_Hyperlink_Induced_Topic_Search_HITS_Estimate.cypher index 9413a2dba..e6fc80419 100644 --- a/cypher/Centrality/Centrality_9a_Hyperlink_Induced_Topic_Search_HITS_Estimate.cypher +++ b/cypher/Centrality/Centrality_9a_Hyperlink_Induced_Topic_Search_HITS_Estimate.cypher @@ -1,10 +1,10 @@ // Centrality 9a Hyperlink-Induced Topic Search (HITS) Memory Estimation CALL gds.alpha.hits.write.estimate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { hitsIterations: 20 - ,authProperty: $dependencies_projection_write_property - ,hubProperty: 'centralityHyperlinkInducedTopicSearchHub' + ,authProperty: $dependencies_projection_write_property + 'Authority' + ,hubProperty: $dependencies_projection_write_property + 'Hub' }) YIELD nodeCount, relationshipCount, bytesMin, bytesMax, heapPercentageMin, heapPercentageMax, treeView RETURN nodeCount, relationshipCount, bytesMin, bytesMax, heapPercentageMin, heapPercentageMax, treeView \ No newline at end of file diff --git a/cypher/Centrality/Centrality_9b_Hyperlink_Induced_Topic_Search_HITS_Statistics.cypher b/cypher/Centrality/Centrality_9b_Hyperlink_Induced_Topic_Search_HITS_Statistics.cypher index c4dfcfa80..2263225cf 100644 --- a/cypher/Centrality/Centrality_9b_Hyperlink_Induced_Topic_Search_HITS_Statistics.cypher +++ b/cypher/Centrality/Centrality_9b_Hyperlink_Induced_Topic_Search_HITS_Statistics.cypher @@ -1,7 +1,7 @@ -// Centrality 9b Hyperlink-Induced Topic Search (HITS) Memory Statistics +// Centrality 9b Hyperlink-Induced Topic Search (HITS) Statistics CALL gds.alpha.hits.stats( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { hitsIterations: 20 }) YIELD ranIterations, didConverge, preProcessingMillis, computeMillis diff --git a/cypher/Centrality/Centrality_9c_Hyperlink_Induced_Topic_Search_HITS_Mutate.cypher b/cypher/Centrality/Centrality_9c_Hyperlink_Induced_Topic_Search_HITS_Mutate.cypher new file mode 100644 index 000000000..be193d202 --- /dev/null +++ b/cypher/Centrality/Centrality_9c_Hyperlink_Induced_Topic_Search_HITS_Mutate.cypher @@ -0,0 +1,20 @@ +// Centrality 9c Hyperlink-Induced Topic Search (HITS) Mutate + + CALL gds.alpha.hits.mutate( + $dependencies_projection + '-cleaned', { + hitsIterations: 20 + ,authProperty: $dependencies_projection_write_property + 'Authority' + ,hubProperty: $dependencies_projection_write_property + 'Hub' +}) + YIELD nodePropertiesWritten + ,didConverge + ,ranIterations + ,preProcessingMillis + ,computeMillis + ,mutateMillis +RETURN nodePropertiesWritten + ,didConverge + ,ranIterations + ,preProcessingMillis + ,computeMillis + ,mutateMillis \ No newline at end of file diff --git a/cypher/Centrality/Centrality_9c_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher b/cypher/Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher similarity index 79% rename from cypher/Centrality/Centrality_9c_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher rename to cypher/Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher index 62895e558..4f9f8edd7 100644 --- a/cypher/Centrality/Centrality_9c_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher +++ b/cypher/Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher @@ -1,7 +1,7 @@ -// Centrality 9c Hyperlink-Induced Topic Search (HITS) Memory Stream +// Centrality 9d Hyperlink-Induced Topic Search (HITS) Stream CALL gds.alpha.hits.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { hitsIterations: 20 }) YIELD nodeId, values diff --git a/cypher/Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream_Mutated.cypher b/cypher/Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream_Mutated.cypher new file mode 100644 index 000000000..7899d6cdc --- /dev/null +++ b/cypher/Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream_Mutated.cypher @@ -0,0 +1,19 @@ +// Centrality 9d Hyperlink-Induced Topic Search (HITS) Stream Mutated + +CALL gds.graph.nodeProperties.stream( + $dependencies_projection + '-cleaned' + ,[ + $dependencies_projection_write_property + 'Authority' + ,$dependencies_projection_write_property + 'Hub' + ] +) +YIELD nodeId, propertyValue + WITH gds.util.asNode(nodeId) AS codeUnit + ,collect(propertyValue) AS values +RETURN DISTINCT coalesce(codeUnit.fqn, codeUnit.fileName, codeUnit.signature, codeUnit.name) AS codeUnitName + ,coalesce(codeUnit.name, replace(last(split(codeUnit.fileName, '/')), '.jar', '')) AS shortCodeUnitName + ,values[0] AS centralityHyperlinkInducedTopicSearchAuthority + ,values[1] AS centralityHyperlinkInducedTopicSearchHub + ,codeUnit.incomingDependencies AS incomingDependencies + ,codeUnit.outgoingDependencies AS outgoingDependencies +ORDER BY centralityHyperlinkInducedTopicSearchAuthority DESCENDING, codeUnitName ASCENDING \ No newline at end of file diff --git a/cypher/Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Write.cypher b/cypher/Centrality/Centrality_9e_Hyperlink_Induced_Topic_Search_HITS_Write.cypher similarity index 52% rename from cypher/Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Write.cypher rename to cypher/Centrality/Centrality_9e_Hyperlink_Induced_Topic_Search_HITS_Write.cypher index 3521821ca..30c595e17 100644 --- a/cypher/Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Write.cypher +++ b/cypher/Centrality/Centrality_9e_Hyperlink_Induced_Topic_Search_HITS_Write.cypher @@ -1,10 +1,10 @@ -// Centrality 9d Hyperlink-Induced Topic Search (HITS) Memory Write +// Centrality 9e Hyperlink-Induced Topic Search (HITS) Write CALL gds.alpha.hits.write( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { hitsIterations: 20 - ,authProperty: $dependencies_projection_write_property - ,hubProperty: 'centralityHyperlinkInducedTopicSearchHub' + ,authProperty: $dependencies_projection_write_property + 'Authority' + ,hubProperty: $dependencies_projection_write_property + 'Hub' }) YIELD nodePropertiesWritten, ranIterations, didConverge, preProcessingMillis, computeMillis, writeMillis RETURN nodePropertiesWritten, ranIterations, didConverge, preProcessingMillis, computeMillis, writeMillis \ No newline at end of file diff --git a/cypher/Community_Detection/Community_Detection_1a_Louvain_Estimate.cypher b/cypher/Community_Detection/Community_Detection_1a_Louvain_Estimate.cypher index 08b9c0a94..9a27961bc 100644 --- a/cypher/Community_Detection/Community_Detection_1a_Louvain_Estimate.cypher +++ b/cypher/Community_Detection/Community_Detection_1a_Louvain_Estimate.cypher @@ -1,7 +1,7 @@ //Community Detection Louvain Estimate Memory CALL gds.louvain.write.estimate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { tolerance: 0.00001, relationshipWeightProperty: $dependencies_projection_weight_property, writeProperty: $dependencies_projection_write_property, diff --git a/cypher/Community_Detection/Community_Detection_1b_Louvain_Statistics.cypher b/cypher/Community_Detection/Community_Detection_1b_Louvain_Statistics.cypher index ce545b1b8..3c06d56b1 100644 --- a/cypher/Community_Detection/Community_Detection_1b_Louvain_Statistics.cypher +++ b/cypher/Community_Detection/Community_Detection_1b_Louvain_Statistics.cypher @@ -1,7 +1,7 @@ //Community Detection Louvain Statistics CALL gds.louvain.stats( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { tolerance: 0.00001, relationshipWeightProperty: $dependencies_projection_weight_property, includeIntermediateCommunities: true diff --git a/cypher/Community_Detection/Community_Detection_1c_Louvain_Mutate.cypher b/cypher/Community_Detection/Community_Detection_1c_Louvain_Mutate.cypher index d24ea78da..321a3b394 100644 --- a/cypher/Community_Detection/Community_Detection_1c_Louvain_Mutate.cypher +++ b/cypher/Community_Detection/Community_Detection_1c_Louvain_Mutate.cypher @@ -1,7 +1,7 @@ // Community Detection Louvain Mutate CALL gds.louvain.mutate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { tolerance: 0.00001, consecutiveIds: NOT toBoolean($dependencies_include_intermediate_communities), includeIntermediateCommunities: toBoolean($dependencies_include_intermediate_communities), diff --git a/cypher/Community_Detection/Community_Detection_1d_Louvain_Stream.cypher b/cypher/Community_Detection/Community_Detection_1d_Louvain_Stream.cypher index 189ac2246..08312f8c1 100644 --- a/cypher/Community_Detection/Community_Detection_1d_Louvain_Stream.cypher +++ b/cypher/Community_Detection/Community_Detection_1d_Louvain_Stream.cypher @@ -1,7 +1,7 @@ //Community Detection Louvain Stream CALL gds.louvain.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { tolerance: 0.00001, includeIntermediateCommunities: true, relationshipWeightProperty: $dependencies_projection_weight_property diff --git a/cypher/Community_Detection/Community_Detection_1d_Stream_Intermediate_Mutated.cypher b/cypher/Community_Detection/Community_Detection_1d_Stream_Intermediate_Mutated.cypher index 2af4251a0..e533536a5 100644 --- a/cypher/Community_Detection/Community_Detection_1d_Stream_Intermediate_Mutated.cypher +++ b/cypher/Community_Detection/Community_Detection_1d_Stream_Intermediate_Mutated.cypher @@ -1,7 +1,7 @@ // Community Detection Stream Intermediate Mutated for hierarchical algorithmns (Louvain, Leiden) CALL gds.graph.nodeProperty.stream( - $dependencies_projection + '-without-empty' + $dependencies_projection + '-cleaned' ,$dependencies_projection_write_property ) YIELD nodeId, propertyValue diff --git a/cypher/Community_Detection/Community_Detection_1e_Louvain_Write_intermediateLouvainCommunityId.cypher b/cypher/Community_Detection/Community_Detection_1e_Louvain_Write_intermediateLouvainCommunityId.cypher index 21d3c9747..ddc1be11c 100644 --- a/cypher/Community_Detection/Community_Detection_1e_Louvain_Write_intermediateLouvainCommunityId.cypher +++ b/cypher/Community_Detection/Community_Detection_1e_Louvain_Write_intermediateLouvainCommunityId.cypher @@ -1,7 +1,7 @@ //Community Detection Louvain Write communityLouvainIntermediateIds CALL gds.louvain.write( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { tolerance: 0.00001, includeIntermediateCommunities: true, relationshipWeightProperty: $dependencies_projection_weight_property, diff --git a/cypher/Community_Detection/Community_Detection_1e_Louvain_Write_louvainCommunityId.cypher b/cypher/Community_Detection/Community_Detection_1e_Louvain_Write_louvainCommunityId.cypher index 4f92cf66b..11e979f53 100644 --- a/cypher/Community_Detection/Community_Detection_1e_Louvain_Write_louvainCommunityId.cypher +++ b/cypher/Community_Detection/Community_Detection_1e_Louvain_Write_louvainCommunityId.cypher @@ -1,7 +1,7 @@ //Community Detection Louvain write node property communityLouvainId CALL gds.louvain.write( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { tolerance: 0.00001, consecutiveIds: true, relationshipWeightProperty: $dependencies_projection_weight_property, diff --git a/cypher/Community_Detection/Community_Detection_2a_Leiden_Estimate.cypher b/cypher/Community_Detection/Community_Detection_2a_Leiden_Estimate.cypher index 590014862..22d929194 100644 --- a/cypher/Community_Detection/Community_Detection_2a_Leiden_Estimate.cypher +++ b/cypher/Community_Detection/Community_Detection_2a_Leiden_Estimate.cypher @@ -1,7 +1,7 @@ //Community Detection Leiden Estimate Memory CALL gds.beta.leiden.write.estimate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { gamma: toFloat($dependencies_leiden_gamma), theta: 0.001, tolerance: 0.0000001, diff --git a/cypher/Community_Detection/Community_Detection_2b_Leiden_Statistics.cypher b/cypher/Community_Detection/Community_Detection_2b_Leiden_Statistics.cypher index fbb1ee677..b58ca1757 100644 --- a/cypher/Community_Detection/Community_Detection_2b_Leiden_Statistics.cypher +++ b/cypher/Community_Detection/Community_Detection_2b_Leiden_Statistics.cypher @@ -1,7 +1,7 @@ //Community Detection Leiden Statistics CALL gds.beta.leiden.stats( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { gamma: toFloat($dependencies_leiden_gamma), theta: 0.001, tolerance: 0.0000001, diff --git a/cypher/Community_Detection/Community_Detection_2c_Leiden_Mutate.cypher b/cypher/Community_Detection/Community_Detection_2c_Leiden_Mutate.cypher index 381507a55..cf1215f2b 100644 --- a/cypher/Community_Detection/Community_Detection_2c_Leiden_Mutate.cypher +++ b/cypher/Community_Detection/Community_Detection_2c_Leiden_Mutate.cypher @@ -1,7 +1,7 @@ // Community Detection Leiden Mutate CALL gds.leiden.mutate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { tolerance: 0.00001, consecutiveIds: NOT toBoolean($dependencies_include_intermediate_communities), includeIntermediateCommunities: toBoolean($dependencies_include_intermediate_communities), diff --git a/cypher/Community_Detection/Community_Detection_2d_Leiden_Stream.cypher b/cypher/Community_Detection/Community_Detection_2d_Leiden_Stream.cypher index d36664edf..888aa233d 100644 --- a/cypher/Community_Detection/Community_Detection_2d_Leiden_Stream.cypher +++ b/cypher/Community_Detection/Community_Detection_2d_Leiden_Stream.cypher @@ -1,7 +1,7 @@ //Community Detection Leiden Stream CALL gds.beta.leiden.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { gamma: toFloat($dependencies_leiden_gamma), theta: 0.001, tolerance: 0.0000001, diff --git a/cypher/Community_Detection/Community_Detection_2d_Leiden_Write_Node_Property.cypher b/cypher/Community_Detection/Community_Detection_2d_Leiden_Write_Node_Property.cypher index 411c5a53f..8b3da4e6c 100644 --- a/cypher/Community_Detection/Community_Detection_2d_Leiden_Write_Node_Property.cypher +++ b/cypher/Community_Detection/Community_Detection_2d_Leiden_Write_Node_Property.cypher @@ -1,7 +1,7 @@ //Community Detection Leiden Write property communityLeidenId CALL gds.beta.leiden.write( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { gamma: toFloat($dependencies_leiden_gamma), theta: 0.001, tolerance: 0.0000001, diff --git a/cypher/Community_Detection/Community_Detection_3a_WeaklyConnectedComponents_Estimate.cypher b/cypher/Community_Detection/Community_Detection_3a_WeaklyConnectedComponents_Estimate.cypher index 436dfdf8f..f860a8087 100644 --- a/cypher/Community_Detection/Community_Detection_3a_WeaklyConnectedComponents_Estimate.cypher +++ b/cypher/Community_Detection/Community_Detection_3a_WeaklyConnectedComponents_Estimate.cypher @@ -1,7 +1,7 @@ // Community Detection Label Propagation Estimate CALL gds.labelPropagation.write.estimate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,writeProperty: $dependencies_projection_write_property ,consecutiveIds: true diff --git a/cypher/Community_Detection/Community_Detection_3b_WeaklyConnectedComponents_Statistics.cypher b/cypher/Community_Detection/Community_Detection_3b_WeaklyConnectedComponents_Statistics.cypher index b6a4e49fa..7c7ae48e2 100644 --- a/cypher/Community_Detection/Community_Detection_3b_WeaklyConnectedComponents_Statistics.cypher +++ b/cypher/Community_Detection/Community_Detection_3b_WeaklyConnectedComponents_Statistics.cypher @@ -1,7 +1,7 @@ // Community Detection Weakly Connected Components Statistics CALL gds.wcc.stats( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,consecutiveIds: true }) diff --git a/cypher/Community_Detection/Community_Detection_3c_WeaklyConnectedComponents_Mutate.cypher b/cypher/Community_Detection/Community_Detection_3c_WeaklyConnectedComponents_Mutate.cypher index 9474318d7..b964dacb6 100644 --- a/cypher/Community_Detection/Community_Detection_3c_WeaklyConnectedComponents_Mutate.cypher +++ b/cypher/Community_Detection/Community_Detection_3c_WeaklyConnectedComponents_Mutate.cypher @@ -1,7 +1,7 @@ // Community Detection Weakly Connected Components Mutate CALL gds.wcc.mutate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,mutateProperty: $dependencies_projection_write_property ,consecutiveIds: true diff --git a/cypher/Community_Detection/Community_Detection_3d_WeaklyConnectedComponents_Stream.cypher b/cypher/Community_Detection/Community_Detection_3d_WeaklyConnectedComponents_Stream.cypher index 14bf0ddfb..be0e68bf1 100644 --- a/cypher/Community_Detection/Community_Detection_3d_WeaklyConnectedComponents_Stream.cypher +++ b/cypher/Community_Detection/Community_Detection_3d_WeaklyConnectedComponents_Stream.cypher @@ -1,7 +1,7 @@ // Community Detection Weakly Connected Components Stream CALL gds.wcc.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property, consecutiveIds: true }) diff --git a/cypher/Community_Detection/Community_Detection_3e_WeaklyConnectedComponents_Write.cypher b/cypher/Community_Detection/Community_Detection_3e_WeaklyConnectedComponents_Write.cypher index 077db25ea..f2d5f948a 100644 --- a/cypher/Community_Detection/Community_Detection_3e_WeaklyConnectedComponents_Write.cypher +++ b/cypher/Community_Detection/Community_Detection_3e_WeaklyConnectedComponents_Write.cypher @@ -1,7 +1,7 @@ // Community Detection Weakly Connected Components write node property communityWeaklyConnectedComponentId CALL gds.wcc.write( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,consecutiveIds: true ,writeProperty: 'communityWeaklyConnectedComponentId' diff --git a/cypher/Community_Detection/Community_Detection_4a_Label_Propagation_Estimate.cypher b/cypher/Community_Detection/Community_Detection_4a_Label_Propagation_Estimate.cypher index 2b46e1ac5..d8a2925ac 100644 --- a/cypher/Community_Detection/Community_Detection_4a_Label_Propagation_Estimate.cypher +++ b/cypher/Community_Detection/Community_Detection_4a_Label_Propagation_Estimate.cypher @@ -1,7 +1,7 @@ // Community Detection Label Propagation Estimate CALL gds.labelPropagation.write.estimate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,writeProperty: $dependencies_projection_write_property ,consecutiveIds: true diff --git a/cypher/Community_Detection/Community_Detection_4b_Label_Propagation_Statistics.cypher b/cypher/Community_Detection/Community_Detection_4b_Label_Propagation_Statistics.cypher index 6eacef868..0c7180aa0 100644 --- a/cypher/Community_Detection/Community_Detection_4b_Label_Propagation_Statistics.cypher +++ b/cypher/Community_Detection/Community_Detection_4b_Label_Propagation_Statistics.cypher @@ -1,7 +1,7 @@ // Community Detection Label Propagation Statistics CALL gds.labelPropagation.stats( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,consecutiveIds: true }) diff --git a/cypher/Community_Detection/Community_Detection_4c_Label_Propagation_Mutate.cypher b/cypher/Community_Detection/Community_Detection_4c_Label_Propagation_Mutate.cypher index 1827f1db1..e6a163c46 100644 --- a/cypher/Community_Detection/Community_Detection_4c_Label_Propagation_Mutate.cypher +++ b/cypher/Community_Detection/Community_Detection_4c_Label_Propagation_Mutate.cypher @@ -1,7 +1,7 @@ // Community Detection Label Propagation Mutate CALL gds.labelPropagation.mutate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,mutateProperty: $dependencies_projection_write_property ,consecutiveIds: true diff --git a/cypher/Community_Detection/Community_Detection_4d_Label_Propagation_Stream.cypher b/cypher/Community_Detection/Community_Detection_4d_Label_Propagation_Stream.cypher index 71c2115fd..6909547d7 100644 --- a/cypher/Community_Detection/Community_Detection_4d_Label_Propagation_Stream.cypher +++ b/cypher/Community_Detection/Community_Detection_4d_Label_Propagation_Stream.cypher @@ -1,7 +1,7 @@ // Community Detection Label Propagation Stream CALL gds.labelPropagation.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,consecutiveIds: true }) diff --git a/cypher/Community_Detection/Community_Detection_4e_Label_Propagation_Write.cypher b/cypher/Community_Detection/Community_Detection_4e_Label_Propagation_Write.cypher index 0339d8d44..3d385370e 100644 --- a/cypher/Community_Detection/Community_Detection_4e_Label_Propagation_Write.cypher +++ b/cypher/Community_Detection/Community_Detection_4e_Label_Propagation_Write.cypher @@ -1,7 +1,7 @@ // Community Detection Label Propagation write node property communityLabelPropagationId CALL gds.labelPropagation.write( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,consecutiveIds: true ,writeProperty: 'communityLabelPropagationId' diff --git a/cypher/Community_Detection/Community_Detection_5a_K_Core_Decomposition_Estimate.cypher b/cypher/Community_Detection/Community_Detection_5a_K_Core_Decomposition_Estimate.cypher index 70857c416..ace1e4652 100644 --- a/cypher/Community_Detection/Community_Detection_5a_K_Core_Decomposition_Estimate.cypher +++ b/cypher/Community_Detection/Community_Detection_5a_K_Core_Decomposition_Estimate.cypher @@ -1,7 +1,7 @@ // Community Detection K-Core Decomposition Estimate CALL gds.kcore.write.estimate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { writeProperty: $dependencies_projection_write_property }) YIELD requiredMemory diff --git a/cypher/Community_Detection/Community_Detection_5b_K_Core_Decomposition_Statistics.cypher b/cypher/Community_Detection/Community_Detection_5b_K_Core_Decomposition_Statistics.cypher index 90ccdf50b..293bcad78 100644 --- a/cypher/Community_Detection/Community_Detection_5b_K_Core_Decomposition_Statistics.cypher +++ b/cypher/Community_Detection/Community_Detection_5b_K_Core_Decomposition_Statistics.cypher @@ -1,7 +1,7 @@ // Community Detection K-Core Decomposition Statistics CALL gds.kcore.stats( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { }) YIELD degeneracy, preProcessingMillis, computeMillis, postProcessingMillis RETURN degeneracy, preProcessingMillis, computeMillis, postProcessingMillis \ No newline at end of file diff --git a/cypher/Community_Detection/Community_Detection_5c_K_Core_Decomposition_Mutate.cypher b/cypher/Community_Detection/Community_Detection_5c_K_Core_Decomposition_Mutate.cypher index ac1ecf5b1..25082ad94 100644 --- a/cypher/Community_Detection/Community_Detection_5c_K_Core_Decomposition_Mutate.cypher +++ b/cypher/Community_Detection/Community_Detection_5c_K_Core_Decomposition_Mutate.cypher @@ -1,7 +1,7 @@ // Community Detection K-Core Decomposition Mutate CALL gds.kcore.mutate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { mutateProperty: $dependencies_projection_write_property }) YIELD degeneracy, nodePropertiesWritten, preProcessingMillis, computeMillis, postProcessingMillis, mutateMillis diff --git a/cypher/Community_Detection/Community_Detection_5d_K_Core_Decomposition_Stream.cypher b/cypher/Community_Detection/Community_Detection_5d_K_Core_Decomposition_Stream.cypher index 95fd6d4e2..36e7220fa 100644 --- a/cypher/Community_Detection/Community_Detection_5d_K_Core_Decomposition_Stream.cypher +++ b/cypher/Community_Detection/Community_Detection_5d_K_Core_Decomposition_Stream.cypher @@ -1,7 +1,7 @@ // Community Detection K-Core Decomposition Stream CALL gds.kcore.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { }) YIELD nodeId, coreValue WITH gds.util.asNode(nodeId) AS member diff --git a/cypher/Community_Detection/Community_Detection_5e_K_Core_Decomposition_Write.cypher b/cypher/Community_Detection/Community_Detection_5e_K_Core_Decomposition_Write.cypher index 050de3807..fb8fe66e3 100644 --- a/cypher/Community_Detection/Community_Detection_5e_K_Core_Decomposition_Write.cypher +++ b/cypher/Community_Detection/Community_Detection_5e_K_Core_Decomposition_Write.cypher @@ -1,7 +1,7 @@ // Community Detection K-Core Decomposition write node property communitykCoreDecompositionValue CALL gds.kcore.write( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { writeProperty: $dependencies_projection_write_property }) YIELD degeneracy diff --git a/cypher/Community_Detection/Community_Detection_6a_Approximate_Maximum_k_cut_Estimate.cypher b/cypher/Community_Detection/Community_Detection_6a_Approximate_Maximum_k_cut_Estimate.cypher index 88769682e..9feb260ae 100644 --- a/cypher/Community_Detection/Community_Detection_6a_Approximate_Maximum_k_cut_Estimate.cypher +++ b/cypher/Community_Detection/Community_Detection_6a_Approximate_Maximum_k_cut_Estimate.cypher @@ -1,7 +1,7 @@ // Community Detection Approximate Maximum k-cut Estimate CALL gds.maxkcut.mutate.estimate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,mutateProperty: $dependencies_projection_write_property ,k: toInteger($dependencies_maxkcut) diff --git a/cypher/Community_Detection/Community_Detection_6c_Approximate_Maximum_k_cut_Mutate.cypher b/cypher/Community_Detection/Community_Detection_6c_Approximate_Maximum_k_cut_Mutate.cypher index becda650f..2a26d4e4f 100644 --- a/cypher/Community_Detection/Community_Detection_6c_Approximate_Maximum_k_cut_Mutate.cypher +++ b/cypher/Community_Detection/Community_Detection_6c_Approximate_Maximum_k_cut_Mutate.cypher @@ -1,7 +1,7 @@ // Community Detection Approximate Maximum k-cut Mutate CALL gds.maxkcut.mutate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,mutateProperty: $dependencies_projection_write_property ,k: toInteger($dependencies_maxkcut) diff --git a/cypher/Community_Detection/Community_Detection_6d_Approximate_Maximum_k_cut_Stream.cypher b/cypher/Community_Detection/Community_Detection_6d_Approximate_Maximum_k_cut_Stream.cypher index f4d187157..948fa16a5 100644 --- a/cypher/Community_Detection/Community_Detection_6d_Approximate_Maximum_k_cut_Stream.cypher +++ b/cypher/Community_Detection/Community_Detection_6d_Approximate_Maximum_k_cut_Stream.cypher @@ -1,7 +1,7 @@ // Community Detection Approximate Maximum k-cut Stream CALL gds.maxkcut.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { }) YIELD nodeId, communityId WITH gds.util.asNode(nodeId) AS member diff --git a/cypher/Community_Detection/Community_Detection_7d_Modularity.cypher b/cypher/Community_Detection/Community_Detection_7d_Modularity.cypher index ab4906309..b730db1bc 100644 --- a/cypher/Community_Detection/Community_Detection_7d_Modularity.cypher +++ b/cypher/Community_Detection/Community_Detection_7d_Modularity.cypher @@ -1,7 +1,7 @@ // Community Detection Modularity CALL gds.alpha.modularity.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,communityProperty: $dependencies_projection_write_property }) diff --git a/cypher/Community_Detection/Community_Detection_7d_Modularity_Members.cypher b/cypher/Community_Detection/Community_Detection_7d_Modularity_Members.cypher index 730e3ac2a..e58b29776 100644 --- a/cypher/Community_Detection/Community_Detection_7d_Modularity_Members.cypher +++ b/cypher/Community_Detection/Community_Detection_7d_Modularity_Members.cypher @@ -1,7 +1,7 @@ // Community Detection Modularity Members CALL gds.modularity.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,communityProperty: $dependencies_projection_write_property }) diff --git a/cypher/Community_Detection/Community_Detection_7e_Write_Modularity.cypher b/cypher/Community_Detection/Community_Detection_7e_Write_Modularity.cypher index 7dae08b7d..f3b3d87e0 100644 --- a/cypher/Community_Detection/Community_Detection_7e_Write_Modularity.cypher +++ b/cypher/Community_Detection/Community_Detection_7e_Write_Modularity.cypher @@ -1,7 +1,7 @@ // Community Detection Modularity Write CALL gds.modularity.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,communityProperty: $dependencies_projection_write_property }) diff --git a/cypher/Dependencies_Projection/Dependencies_2_Delete_Subgraph.cypher b/cypher/Dependencies_Projection/Dependencies_2_Delete_Subgraph.cypher index 45b9c2720..7f203f018 100644 --- a/cypher/Dependencies_Projection/Dependencies_2_Delete_Subgraph.cypher +++ b/cypher/Dependencies_Projection/Dependencies_2_Delete_Subgraph.cypher @@ -1,5 +1,5 @@ // Delete filtered subgraph projection if exists. Variables: dependencies_projection - CALL gds.graph.drop($dependencies_projection + '-without-empty', false) + CALL gds.graph.drop($dependencies_projection + '-cleaned', false) YIELD graphName, nodeCount, relationshipCount, creationTime, modificationTime RETURN graphName, nodeCount, relationshipCount, creationTime, modificationTime \ No newline at end of file diff --git a/cypher/Dependencies_Projection/Dependencies_5_Create_Subgraph.cypher b/cypher/Dependencies_Projection/Dependencies_5_Create_Subgraph.cypher index 044a3571c..3d6f46528 100644 --- a/cypher/Dependencies_Projection/Dependencies_5_Create_Subgraph.cypher +++ b/cypher/Dependencies_Projection/Dependencies_5_Create_Subgraph.cypher @@ -1,7 +1,7 @@ //Create filtered subgraph projection without zero-degree nodes. Variables: dependencies_projection, dependencies_projection_node CALL gds.beta.graph.project.subgraph( - $dependencies_projection + '-without-empty', + $dependencies_projection + '-cleaned', $dependencies_projection, 'n.outgoingDependencies > 0 OR n.incomingDependencies > 0', '*' diff --git a/cypher/Dependencies_Projection/Dependencies_6_Check_Projection_Nodes.cypher b/cypher/Dependencies_Projection/Dependencies_6_Check_Projection_Nodes.cypher index 159eea751..5b1a71b18 100644 --- a/cypher/Dependencies_Projection/Dependencies_6_Check_Projection_Nodes.cypher +++ b/cypher/Dependencies_Projection/Dependencies_6_Check_Projection_Nodes.cypher @@ -1,7 +1,7 @@ // Check Projection Node Properties CALL gds.graph.nodeProperties.stream( - $dependencies_projection + '-without-empty' + $dependencies_projection + '-cleaned' ,['incomingDependencies', 'outgoingDependencies'] ) YIELD nodeId, targetNodeId, propertyValue, relationshipType diff --git a/cypher/Dependencies_Projection/Dependencies_7_Check_Projection_Relationships.cypher b/cypher/Dependencies_Projection/Dependencies_7_Check_Projection_Relationships.cypher index 46686aff2..96ec5b4fb 100644 --- a/cypher/Dependencies_Projection/Dependencies_7_Check_Projection_Relationships.cypher +++ b/cypher/Dependencies_Projection/Dependencies_7_Check_Projection_Relationships.cypher @@ -1,7 +1,7 @@ // Check Projection Relationships CALL gds.graph.relationshipProperty.stream( - $dependencies_projection + '-without-empty', + $dependencies_projection + '-cleaned', ,$dependencies_projection_weight_property ,['DEPENDS_ON'] ) diff --git a/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated.cypher b/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated.cypher index b9d0a1e53..14dbc5bdb 100644 --- a/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated.cypher +++ b/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated.cypher @@ -1,14 +1,14 @@ // Read a property from the projection. Variables: dependencies_projection, dependencies_projection_write_property CALL gds.graph.nodeProperties.stream( - $dependencies_projection + '-without-empty' + $dependencies_projection + '-cleaned' ,[$dependencies_projection_write_property] ) YIELD nodeId, nodeProperty, propertyValue WITH gds.util.asNode(nodeId) AS codeUnit ,nodeProperty AS propertyName ,propertyValue -RETURN DISTINCT coalesce(codeUnit.fqn, codeUnit.fileName, codeUnit.name) AS codeUnitName - ,coalesce(codeUnit.name, replace(last(split(codeUnit.fileName, '/')), '.jar', '')) AS shortCodeUnitName +RETURN DISTINCT coalesce(codeUnit.fqn, codeUnit.fileName, codeUnit.signature, codeUnit.name) AS codeUnitName + ,coalesce(codeUnit.name, replace(last(split(codeUnit.fileName, '/')), '.jar', '')) AS shortCodeUnitName ,propertyName ,propertyValue \ No newline at end of file diff --git a/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Extended.cypher b/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Extended.cypher index 0e0f10b1e..ef1435592 100644 --- a/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Extended.cypher +++ b/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Extended.cypher @@ -1,7 +1,7 @@ // Read a property from the projection into the Graph. Variables: dependencies_projection, dependencies_projection_write_property CALL gds.graph.nodeProperties.stream( - $dependencies_projection + '-without-empty' + $dependencies_projection + '-cleaned' ,[$dependencies_projection_write_property] ) YIELD nodeId, nodeProperty, propertyValue diff --git a/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Grouped.cypher b/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Grouped.cypher index 7b34db879..661abf5bc 100644 --- a/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Grouped.cypher +++ b/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Grouped.cypher @@ -1,7 +1,7 @@ // Read a property from the projection. Variables: dependencies_projection, dependencies_projection_write_property CALL gds.graph.nodeProperties.stream( - $dependencies_projection + '-without-empty' + $dependencies_projection + '-cleaned' ,[$dependencies_projection_write_property] ) YIELD nodeId, nodeProperty, propertyValue diff --git a/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Value_Descending.cypher b/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Value_Descending.cypher new file mode 100644 index 000000000..afc007bbc --- /dev/null +++ b/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Value_Descending.cypher @@ -0,0 +1,15 @@ +// Read a property from the projection and order it by its value descending. Variables: dependencies_projection, dependencies_projection_write_property + +CALL gds.graph.nodeProperties.stream( + $dependencies_projection + '-cleaned' + ,[$dependencies_projection_write_property] +) +YIELD nodeId, nodeProperty, propertyValue + WITH gds.util.asNode(nodeId) AS codeUnit + ,nodeProperty AS propertyName + ,propertyValue +RETURN DISTINCT coalesce(codeUnit.fqn, codeUnit.fileName, codeUnit.signature, codeUnit.name) AS codeUnitName + ,coalesce(codeUnit.name, replace(last(split(codeUnit.fileName, '/')), '.jar', '')) AS shortCodeUnitName + ,propertyName + ,propertyValue +ORDER BY propertyValue DESCENDING, codeUnitName ASCENDING \ No newline at end of file diff --git a/cypher/Dependencies_Projection/Dependencies_9_Write_Mutated.cypher b/cypher/Dependencies_Projection/Dependencies_9_Write_Mutated.cypher index 9313a226f..68e71d369 100644 --- a/cypher/Dependencies_Projection/Dependencies_9_Write_Mutated.cypher +++ b/cypher/Dependencies_Projection/Dependencies_9_Write_Mutated.cypher @@ -1,7 +1,7 @@ // Write a property from the projection into the Graph. Variables: dependencies_projection, dependencies_projection_write_property CALL gds.graph.nodeProperties.write( - $dependencies_projection + '-without-empty' + $dependencies_projection + '-cleaned' ,[$dependencies_projection_write_property] ) YIELD propertiesWritten, nodeProperties, writeMillis diff --git a/cypher/Method_Projection/Methods_1_Delete_Projection.cypher b/cypher/Method_Projection/Methods_1_Delete_Projection.cypher new file mode 100644 index 000000000..16cb66e1b --- /dev/null +++ b/cypher/Method_Projection/Methods_1_Delete_Projection.cypher @@ -0,0 +1,5 @@ +// Delete projection if existing. Variables: dependencies_projection + + CALL gds.graph.drop($dependencies_projection + '-cleaned', false) + YIELD graphName, nodeCount, relationshipCount, creationTime, modificationTime +RETURN graphName, nodeCount, relationshipCount, creationTime, modificationTime \ No newline at end of file diff --git a/cypher/Method_Projection/Methods_2_Create_Projection.cypher b/cypher/Method_Projection/Methods_2_Create_Projection.cypher new file mode 100644 index 000000000..0c3bfcbd5 --- /dev/null +++ b/cypher/Method_Projection/Methods_2_Create_Projection.cypher @@ -0,0 +1,13 @@ +// Create directed projection for methods. Variables: dependencies_projection, dependencies_projection_weight_property + + MATCH (source:Method)-[r:INVOKES]->(target:Method) + WHERE source.effectiveLineCount > 1 + AND target.effectiveLineCount > 1 + AND source.visibility = 'public' + AND target.visibility = 'public' + AND source.name <> '' + AND target.name <> '' + WITH gds.graph.project($dependencies_projection + '-cleaned', source, target) AS projection +RETURN projection.graphName AS graphName + ,projection.nodeCount AS nodeCount + ,projection.relationshipCount AS relationshipCount \ No newline at end of file diff --git a/cypher/Node_Embeddings/Node_Embeddings_1a_Fast_Random_Projection_Estimate.cypher b/cypher/Node_Embeddings/Node_Embeddings_1a_Fast_Random_Projection_Estimate.cypher index 8b98cb4a6..aae3e80be 100644 --- a/cypher/Node_Embeddings/Node_Embeddings_1a_Fast_Random_Projection_Estimate.cypher +++ b/cypher/Node_Embeddings/Node_Embeddings_1a_Fast_Random_Projection_Estimate.cypher @@ -1,7 +1,7 @@ // Node Embeddings 1a using Fast Random Projection: Estimate CALL gds.fastRP.stream.estimate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { embeddingDimension: toInteger($dependencies_projection_embedding_dimension) ,relationshipWeightProperty: $dependencies_projection_weight_property } diff --git a/cypher/Node_Embeddings/Node_Embeddings_1b_Fast_Random_Projection_Statistics.cypher b/cypher/Node_Embeddings/Node_Embeddings_1b_Fast_Random_Projection_Statistics.cypher index 2632aa855..4ba620113 100644 --- a/cypher/Node_Embeddings/Node_Embeddings_1b_Fast_Random_Projection_Statistics.cypher +++ b/cypher/Node_Embeddings/Node_Embeddings_1b_Fast_Random_Projection_Statistics.cypher @@ -1,7 +1,7 @@ // Node Embeddings 1b using Fast Random Projection: Statistics CALL gds.fastRP.stats( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { embeddingDimension: toInteger($dependencies_projection_embedding_dimension) ,relationshipWeightProperty: $dependencies_projection_weight_property } diff --git a/cypher/Node_Embeddings/Node_Embeddings_1c_Fast_Random_Projection_Mutate.cypher b/cypher/Node_Embeddings/Node_Embeddings_1c_Fast_Random_Projection_Mutate.cypher index ebb5e831c..ffa9561c6 100644 --- a/cypher/Node_Embeddings/Node_Embeddings_1c_Fast_Random_Projection_Mutate.cypher +++ b/cypher/Node_Embeddings/Node_Embeddings_1c_Fast_Random_Projection_Mutate.cypher @@ -1,7 +1,7 @@ // Node Embeddings 1c using Fast Random Projection: Mutate CALL gds.fastRP.mutate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { embeddingDimension: toInteger($dependencies_projection_embedding_dimension) ,relationshipWeightProperty: $dependencies_projection_weight_property ,mutateProperty: $dependencies_projection_write_property diff --git a/cypher/Node_Embeddings/Node_Embeddings_1d_Fast_Random_Projection_Stream.cypher b/cypher/Node_Embeddings/Node_Embeddings_1d_Fast_Random_Projection_Stream.cypher index 92818b891..440760cbc 100644 --- a/cypher/Node_Embeddings/Node_Embeddings_1d_Fast_Random_Projection_Stream.cypher +++ b/cypher/Node_Embeddings/Node_Embeddings_1d_Fast_Random_Projection_Stream.cypher @@ -1,7 +1,7 @@ // Node Embeddings 1d using Fast Random Projection: Stream CALL gds.fastRP.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { embeddingDimension: toInteger($dependencies_projection_embedding_dimension) ,relationshipWeightProperty: $dependencies_projection_weight_property } diff --git a/cypher/Node_Embeddings/Node_Embeddings_1e_Fast_Random_Projection_Write.cypher b/cypher/Node_Embeddings/Node_Embeddings_1e_Fast_Random_Projection_Write.cypher index 19eae9e76..836466f5d 100644 --- a/cypher/Node_Embeddings/Node_Embeddings_1e_Fast_Random_Projection_Write.cypher +++ b/cypher/Node_Embeddings/Node_Embeddings_1e_Fast_Random_Projection_Write.cypher @@ -1,7 +1,7 @@ // Node Embeddings 1d using Fast Random Projection: Write CALL gds.fastRP.write( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { embeddingDimension: toInteger($dependencies_projection_embedding_dimension) ,relationshipWeightProperty: $dependencies_projection_weight_property ,writeProperty: $dependencies_projection_write_property diff --git a/cypher/Node_Embeddings/Node_Embeddings_2a_Hash_GNN_Estimate.cypher b/cypher/Node_Embeddings/Node_Embeddings_2a_Hash_GNN_Estimate.cypher index 41fef5904..051362022 100644 --- a/cypher/Node_Embeddings/Node_Embeddings_2a_Hash_GNN_Estimate.cypher +++ b/cypher/Node_Embeddings/Node_Embeddings_2a_Hash_GNN_Estimate.cypher @@ -1,7 +1,7 @@ // Node Embeddings 2a using Hash GNN (Graph Neural Networks): Estimate CALL gds.beta.hashgnn.stream.estimate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { ,embeddingDensity: toInteger($dependencies_projection_embedding_dimension) * 2 ,iterations: 3 ,generateFeatures: { diff --git a/cypher/Node_Embeddings/Node_Embeddings_2c_Hash_GNN_Mutate.cypher b/cypher/Node_Embeddings/Node_Embeddings_2c_Hash_GNN_Mutate.cypher index 1fc78051d..f8ef945ec 100644 --- a/cypher/Node_Embeddings/Node_Embeddings_2c_Hash_GNN_Mutate.cypher +++ b/cypher/Node_Embeddings/Node_Embeddings_2c_Hash_GNN_Mutate.cypher @@ -1,7 +1,7 @@ // Node Embeddings 2b using Hash GNN (Graph Neural Networks): Mutate CALL gds.beta.hashgnn.mutate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { ,embeddingDensity: toInteger($dependencies_projection_embedding_dimension) * 2 ,iterations: 3 ,generateFeatures: { diff --git a/cypher/Node_Embeddings/Node_Embeddings_2d_Hash_GNN_Stream.cypher b/cypher/Node_Embeddings/Node_Embeddings_2d_Hash_GNN_Stream.cypher index c4985e637..9302b6cb4 100644 --- a/cypher/Node_Embeddings/Node_Embeddings_2d_Hash_GNN_Stream.cypher +++ b/cypher/Node_Embeddings/Node_Embeddings_2d_Hash_GNN_Stream.cypher @@ -1,7 +1,7 @@ // Node Embeddings 2c using Hash GNN (Graph Neural Networks): Stream CALL gds.beta.hashgnn.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { ,embeddingDensity: toInteger($dependencies_projection_embedding_dimension) * 2 ,iterations: 3 ,generateFeatures: { diff --git a/cypher/Node_Embeddings/Node_Embeddings_3a_Node2Vec_Estimate.cypher b/cypher/Node_Embeddings/Node_Embeddings_3a_Node2Vec_Estimate.cypher index 37b487d31..01882b134 100644 --- a/cypher/Node_Embeddings/Node_Embeddings_3a_Node2Vec_Estimate.cypher +++ b/cypher/Node_Embeddings/Node_Embeddings_3a_Node2Vec_Estimate.cypher @@ -1,7 +1,7 @@ // Node Embeddings 3a using Node2Vec: Estimate CALL gds.node2vec.write.estimate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { ,embeddingDimension: toInteger($dependencies_projection_embedding_dimension) ,iterations: 3 ,relationshipWeightProperty: $dependencies_projection_weight_property diff --git a/cypher/Node_Embeddings/Node_Embeddings_3c_Node2Vec_Mutate.cypher b/cypher/Node_Embeddings/Node_Embeddings_3c_Node2Vec_Mutate.cypher index f7220e651..fe3622c2d 100644 --- a/cypher/Node_Embeddings/Node_Embeddings_3c_Node2Vec_Mutate.cypher +++ b/cypher/Node_Embeddings/Node_Embeddings_3c_Node2Vec_Mutate.cypher @@ -1,7 +1,7 @@ // Node Embeddings 3c using Node2Vec: Mutate CALL gds.node2vec.mutate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { ,embeddingDimension: toInteger($dependencies_projection_embedding_dimension) ,iterations: 3 ,relationshipWeightProperty: $dependencies_projection_weight_property diff --git a/cypher/Node_Embeddings/Node_Embeddings_3d_Node2Vec_Stream.cypher b/cypher/Node_Embeddings/Node_Embeddings_3d_Node2Vec_Stream.cypher index ef4ce25e0..aca2ebe07 100644 --- a/cypher/Node_Embeddings/Node_Embeddings_3d_Node2Vec_Stream.cypher +++ b/cypher/Node_Embeddings/Node_Embeddings_3d_Node2Vec_Stream.cypher @@ -1,7 +1,7 @@ // Node Embeddings 3c using Node2Vec: Stream CALL gds.node2vec.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { ,embeddingDimension: toInteger($dependencies_projection_embedding_dimension) ,iterations: 3 ,relationshipWeightProperty: $dependencies_projection_weight_property diff --git a/cypher/Node_Embeddings/Node_Embeddings_3e_Node2Vec_Write.cypher b/cypher/Node_Embeddings/Node_Embeddings_3e_Node2Vec_Write.cypher index 83132b9e1..b93824c4a 100644 --- a/cypher/Node_Embeddings/Node_Embeddings_3e_Node2Vec_Write.cypher +++ b/cypher/Node_Embeddings/Node_Embeddings_3e_Node2Vec_Write.cypher @@ -1,7 +1,7 @@ // Node Embeddings 3d using Node2Vec: Write CALL gds.node2vec.write( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { ,embeddingDimension: toInteger($dependencies_projection_embedding_dimension) ,iterations: 3 ,relationshipWeightProperty: $dependencies_projection_weight_property diff --git a/cypher/Similarity/Similarity_1a_Estimate.cypher b/cypher/Similarity/Similarity_1a_Estimate.cypher index a552f8ab0..7a057c14d 100644 --- a/cypher/Similarity/Similarity_1a_Estimate.cypher +++ b/cypher/Similarity/Similarity_1a_Estimate.cypher @@ -1,7 +1,7 @@ // Similarity Estimate Memory CALL gds.nodeSimilarity.write.estimate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,writeRelationshipType: 'SIMILAR' ,writeProperty: 'score' diff --git a/cypher/Similarity/Similarity_1b_Statistics.cypher b/cypher/Similarity/Similarity_1b_Statistics.cypher index a37785bd9..619118cf1 100644 --- a/cypher/Similarity/Similarity_1b_Statistics.cypher +++ b/cypher/Similarity/Similarity_1b_Statistics.cypher @@ -1,7 +1,7 @@ // Similarity Statistics CALL gds.nodeSimilarity.stats( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,topK: 3 }) diff --git a/cypher/Similarity/Similarity_1c_Stream.cypher b/cypher/Similarity/Similarity_1c_Stream.cypher index bc96a7548..b318724eb 100644 --- a/cypher/Similarity/Similarity_1c_Stream.cypher +++ b/cypher/Similarity/Similarity_1c_Stream.cypher @@ -1,7 +1,7 @@ // Similarity Stream CALL gds.nodeSimilarity.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,topK: 3 }) diff --git a/cypher/Similarity/Similarity_1e_Write.cypher b/cypher/Similarity/Similarity_1e_Write.cypher index 947ff48ef..89b22e799 100644 --- a/cypher/Similarity/Similarity_1e_Write.cypher +++ b/cypher/Similarity/Similarity_1e_Write.cypher @@ -1,7 +1,7 @@ // Similarity Write CALL gds.nodeSimilarity.write( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: $dependencies_projection_weight_property ,writeRelationshipType: 'SIMILAR' ,writeProperty: 'score' diff --git a/cypher/Topological_Sort/Topological_Sort_List.cypher b/cypher/Topological_Sort/Topological_Sort_List.cypher index 4d3a19cd4..4e8453d00 100644 --- a/cypher/Topological_Sort/Topological_Sort_List.cypher +++ b/cypher/Topological_Sort/Topological_Sort_List.cypher @@ -2,7 +2,7 @@ // Needs graph-data-science plugin version >= 2.5.0 CALL gds.dag.topologicalSort.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { computeMaxDistanceFromSource: true }) YIELD nodeId, maxDistanceFromSource WITH nodeId diff --git a/cypher/Topological_Sort/Topological_Sort_Write.cypher b/cypher/Topological_Sort/Topological_Sort_Write.cypher index 09c518554..5cb60d9f2 100644 --- a/cypher/Topological_Sort/Topological_Sort_Write.cypher +++ b/cypher/Topological_Sort/Topological_Sort_Write.cypher @@ -2,7 +2,7 @@ // Needs graph-data-science plugin version >= 2.5.0 CALL gds.dag.topologicalSort.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { computeMaxDistanceFromSource: true }) YIELD nodeId, maxDistanceFromSource WITH nodeId diff --git a/scripts/analysis/analyze.sh b/scripts/analysis/analyze.sh index 9fcdb5e66..9fa54504a 100755 --- a/scripts/analysis/analyze.sh +++ b/scripts/analysis/analyze.sh @@ -71,7 +71,7 @@ while [[ $# -gt 0 ]]; do usage ;; esac - shift + shift || true # ignore error when there are no more arguments done # Assure that the analysis report compilation only consists of letters and numbers @@ -92,6 +92,10 @@ if [ ! -d "${ARTIFACTS_DIRECTORY}" ] ; then exit 1 fi +echo "analyze: analysisReportCompilation=${analysisReportCompilation}" +echo "analyze: settingsProfile=${settingsProfile}" +echo "analyze: exploreMode=${exploreMode}" + ## Get this "scripts/analysis" directory if not already set # Even if $BASH_SOURCE is made for Bourne-like shells it is also supported by others and therefore here the preferred solution. # CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes. diff --git a/scripts/configuration/template-neo4j-v4.conf b/scripts/configuration/template-neo4j-v4.conf index 5ba512e4e..1f2b16b36 100644 --- a/scripts/configuration/template-neo4j-v4.conf +++ b/scripts/configuration/template-neo4j-v4.conf @@ -16,7 +16,7 @@ dbms.memory.pagecache.size=1g dbms.jvm.additional=-XX:+ExitOnOutOfMemoryError # Memory: Limit the amount of memory that all of the running transaction can consume. -dbms.memory.transaction.global_max_size=2g +dbms.memory.transaction.global_max_size=3g # Memory: Limit the amount of memory that a single transaction can consume. -dbms.memory.transaction.max_size=2g \ No newline at end of file +dbms.memory.transaction.max_size=3g \ No newline at end of file diff --git a/scripts/configuration/template-neo4j.conf b/scripts/configuration/template-neo4j.conf index 201a9acd8..650d350c5 100644 --- a/scripts/configuration/template-neo4j.conf +++ b/scripts/configuration/template-neo4j.conf @@ -16,7 +16,7 @@ server.memory.pagecache.size=1g server.jvm.additional=-XX:+ExitOnOutOfMemoryError # Memory: Limit the amount of memory that all of the running transaction can consume. -db.memory.transaction.total.max=2g +db.memory.transaction.total.max=3g # Memory: Limit the amount of memory that a single transaction can consume. -db.memory.transaction.max=2g \ No newline at end of file +db.memory.transaction.max=3g \ No newline at end of file diff --git a/scripts/reports/CentralityCsv.sh b/scripts/reports/CentralityCsv.sh index e906db7a0..059a8faf5 100755 --- a/scripts/reports/CentralityCsv.sh +++ b/scripts/reports/CentralityCsv.sh @@ -36,18 +36,18 @@ REPORT_NAME="centrality-csv" FULL_REPORT_DIRECTORY="${REPORTS_DIRECTORY}/${REPORT_NAME}" mkdir -p "${FULL_REPORT_DIRECTORY}" -# Centrality Preparation -# Selects the nodes and relationships for the algorithm and creates an in-memory projection. +# Centrality preparation for dependencies between Artifacts, Packages and Types. +# Selects the dependent nodes and relationships for the algorithm and creates an in-memory projection. # Nodes without incoming and outgoing dependencies will be filtered out with a subgraph. # # Required Parameters: # - dependencies_projection=... -# Name prefix for the in-memory projection name for dependencies. Example: "package" +# Name prefix for the in-memory projection name for dependencies. Example: "type-centrality" # - dependencies_projection_node=... -# Label of the nodes that will be used for the projection. Example: "Package" +# Label of the nodes that will be used for the projection. Example: "Type" # - dependencies_projection_weight_property=... # Name of the node property that contains the dependency weight. Example: "weight" -createProjection() { +createDependencyProjection() { local PROJECTION_CYPHER_DIR="$CYPHER_DIR/Dependencies_Projection" execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_1_Delete_Projection.cypher" "${@}" @@ -56,17 +56,32 @@ createProjection() { execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_5_Create_Subgraph.cypher" "${@}" } +# Centrality preparation for method calls +# Selects the method nodes and relationships for the algorithm and creates an in-memory projection. +# Nodes without incoming and outgoing dependencies will be filtered out with a subgraph. +# +# Required Parameters: +# - dependencies_projection=... +# Name prefix for the in-memory projection name for dependencies. Example: "package" +createMethodProjection() { + local PROJECTION_CYPHER_DIR="$CYPHER_DIR/Method_Projection" + + execute_cypher "${PROJECTION_CYPHER_DIR}/Methods_1_Delete_Projection.cypher" "${@}" + execute_cypher "${PROJECTION_CYPHER_DIR}/Methods_2_Create_Projection.cypher" "${@}" +} + # Apply the centrality algorithm "Page Rank". # # Required Parameters: # - dependencies_projection=... -# Name prefix for the in-memory projection name for dependencies. Example: "package" +# Name prefix for the in-memory projection name for dependencies. Example: "type-centrality" # - dependencies_projection_node=... -# Label of the nodes that will be used for the projection. Example: "Package" +# Label of the nodes that will be used for the projection. Example: "Type" # - dependencies_projection_weight_property=... # Name of the node property that contains the dependency weight. Example: "weight" centralityWithPageRank() { local CENTRALITY_CYPHER_DIR="$CYPHER_DIR/Centrality" + local PROJECTION_CYPHER_DIR="$CYPHER_DIR/Dependencies_Projection" # Name of the property that will be written to the nodes containing the centrality score. # This is also used as a name with the first letter capitalized as a label for the top centraliy nodes. @@ -76,13 +91,18 @@ centralityWithPageRank() { execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_2a_Page_Rank_Estimate.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_2b_Page_Rank_Statistics.cypher" "${@}" + # Run the algorithm and write the result into the in-memory projection ("mutate") + execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_3c_Page_Rank_Mutate.cypher" "${@}" "${writePropertyName}" + # Stream to CSV local nodeLabel nodeLabel=$( extractQueryParameter "dependencies_projection_node" "${@}" ) - execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_3c_Page_Rank_Stream.cypher" "${@}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Page_Rank.csv" + execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_8_Stream_Mutated_Value_Descending.cypher" "${@}" "${writePropertyName}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Page_Rank.csv" + #execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_3d_Page_Rank_Stream.cypher" "${@}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Page_Rank.csv" - # Update Graph (node properties and labels) - execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_3d_Page_Rank_Write.cypher" "${@}" "${writePropertyName}" + # Update Graph (node properties and labels) using the already mutated property projection + execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_9_Write_Mutated.cypher" "${@}" "${writePropertyName}" + #execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_3e_Page_Rank_Write.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1c_Label_Delete.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1d_Label_Add.cypher" "${@}" "${writePropertyName}" } @@ -91,13 +111,14 @@ centralityWithPageRank() { # # Required Parameters: # - dependencies_projection=... -# Name prefix for the in-memory projection name for dependencies. Example: "package" +# Name prefix for the in-memory projection name for dependencies. Example: "type-centrality" # - dependencies_projection_node=... -# Label of the nodes that will be used for the projection. Example: "Package" +# Label of the nodes that will be used for the projection. Example: "Type" # - dependencies_projection_weight_property=... # Name of the node property that contains the dependency weight. Example: "weight" centralityWithArticleRank() { local CENTRALITY_CYPHER_DIR="$CYPHER_DIR/Centrality" + local PROJECTION_CYPHER_DIR="$CYPHER_DIR/Dependencies_Projection" # Name of the property that will be written to the nodes containing the centrality score. # This is also used as a name with the first letter capitalized as a label for the top centraliy nodes. @@ -107,13 +128,18 @@ centralityWithArticleRank() { execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_4a_Article_Rank_Estimate.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_4b_Article_Rank_Statistics.cypher" "${@}" + # Run the algorithm and write the result into the in-memory projection ("mutate") + execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_4c_Article_Rank_Mutate.cypher" "${@}" "${writePropertyName}" + # Stream to CSV local nodeLabel nodeLabel=$( extractQueryParameter "dependencies_projection_node" "${@}" ) - execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_4c_Article_Rank_Stream.cypher" "${@}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Article_Rank.csv" + execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_8_Stream_Mutated_Value_Descending.cypher" "${@}" "${writePropertyName}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Article_Rank.csv" + #execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_4d_Article_Rank_Stream.cypher" "${@}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Article_Rank.csv" - # Update Graph (node properties and labels) - execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_4d_Article_Rank_Write.cypher" "${@}" "${writePropertyName}" + # Update Graph (node properties and labels) using the already mutated property projection + execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_9_Write_Mutated.cypher" "${@}" "${writePropertyName}" + #execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_4e_Article_Rank_Write.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1c_Label_Delete.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1d_Label_Add.cypher" "${@}" "${writePropertyName}" } @@ -122,13 +148,14 @@ centralityWithArticleRank() { # # Required Parameters: # - dependencies_projection=... -# Name prefix for the in-memory projection name for dependencies. Example: "package" +# Name prefix for the in-memory projection name for dependencies. Example: "type-centrality" # - dependencies_projection_node=... -# Label of the nodes that will be used for the projection. Example: "Package" +# Label of the nodes that will be used for the projection. Example: "Type" # - dependencies_projection_weight_property=... # Name of the node property that contains the dependency weight. Example: "weight" centralityWithBetweenness() { local CENTRALITY_CYPHER_DIR="$CYPHER_DIR/Centrality" + local PROJECTION_CYPHER_DIR="$CYPHER_DIR/Dependencies_Projection" # Name of the property that will be written to the nodes containing the centrality score. # This is also used as a name with the first letter capitalized as a label for the top centraliy nodes. @@ -138,13 +165,18 @@ centralityWithBetweenness() { execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_5a_Betweeness_Estimate.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_5b_Betweeness_Statistics.cypher" "${@}" + # Run the algorithm and write the result into the in-memory projection ("mutate") + execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_5c_Betweeness_Mutate.cypher" "${@}" "${writePropertyName}" + # Stream to CSV local nodeLabel nodeLabel=$( extractQueryParameter "dependencies_projection_node" "${@}" ) - execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_5c_Betweeness_Stream.cypher" "${@}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Betweeness.csv" + execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_8_Stream_Mutated_Value_Descending.cypher" "${@}" "${writePropertyName}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Betweeness.csv" + #execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_5d_Betweeness_Stream.cypher" "${@}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Betweeness.csv" # Update Graph (node properties and labels) - execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_5d_Betweeness_Write.cypher" "${@}" "${writePropertyName}" + execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_9_Write_Mutated.cypher" "${@}" "${writePropertyName}" + #execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_5e_Betweeness_Write.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1c_Label_Delete.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1d_Label_Add.cypher" "${@}" "${writePropertyName}" } @@ -153,13 +185,14 @@ centralityWithBetweenness() { # # Required Parameters: # - dependencies_projection=... -# Name prefix for the in-memory projection name for dependencies. Example: "package" +# Name prefix for the in-memory projection name for dependencies. Example: "type-centrality" # - dependencies_projection_node=... -# Label of the nodes that will be used for the projection. Example: "Package" +# Label of the nodes that will be used for the projection. Example: "Type" # - dependencies_projection_weight_property=... # Name of the node property that contains the dependency weight. Example: "weight" centralityWithCostEffectiveLazyForwardCELF() { local CENTRALITY_CYPHER_DIR="$CYPHER_DIR/Centrality" + local PROJECTION_CYPHER_DIR="$CYPHER_DIR/Dependencies_Projection" # Name of the property that will be written to the nodes containing the centrality score. # This is also used as a name with the first letter capitalized as a label for the top centraliy nodes. @@ -169,13 +202,18 @@ centralityWithCostEffectiveLazyForwardCELF() { execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_6a_Cost_effective_Lazy_Forward_CELF_Estimate.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_6b_Cost_effective_Lazy_Forward_CELF_Statistics.cypher" "${@}" + # Run the algorithm and write the result into the in-memory projection ("mutate") + execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_6c_Cost_effective_Lazy_Forward_CELF_Mutate.cypher" "${@}" "${writePropertyName}" + # Stream to CSV local nodeLabel nodeLabel=$( extractQueryParameter "dependencies_projection_node" "${@}" ) - execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_6c_Cost_effective_Lazy_Forward_CELF_Stream.cypher" "${@}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Cost_effective_Lazy_Forward_CELF.csv" + execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_8_Stream_Mutated_Value_Descending.cypher" "${@}" "${writePropertyName}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Cost_Effective_Lazy_Forward_CELF.csv" + #execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_6d_Cost_effective_Lazy_Forward_CELF_Stream.cypher" "${@}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Cost_effective_Lazy_Forward_CELF.csv" # Update Graph (node properties and labels) - execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_6d_Cost_effective_Lazy_Forward_CELF_Write.cypher" "${@}" "${writePropertyName}" + execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_9_Write_Mutated.cypher" "${@}" "${writePropertyName}" + #execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_6e_Cost_effective_Lazy_Forward_CELF_Write.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1c_Label_Delete.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1d_Label_Add.cypher" "${@}" "${writePropertyName}" } @@ -184,13 +222,14 @@ centralityWithCostEffectiveLazyForwardCELF() { # # Required Parameters: # - dependencies_projection=... -# Name prefix for the in-memory projection name for dependencies. Example: "package" +# Name prefix for the in-memory projection name for dependencies. Example: "type-centrality" # - dependencies_projection_node=... -# Label of the nodes that will be used for the projection. Example: "Package" +# Label of the nodes that will be used for the projection. Example: "Type" # - dependencies_projection_weight_property=... # Name of the node property that contains the dependency weight. Example: "weight" centralityWithHarmonic() { local CENTRALITY_CYPHER_DIR="$CYPHER_DIR/Centrality" + local PROJECTION_CYPHER_DIR="$CYPHER_DIR/Dependencies_Projection" # Name of the property that will be written to the nodes containing the centrality score. # This is also used as a name with the first letter capitalized as a label for the top centraliy nodes. @@ -201,13 +240,18 @@ centralityWithHarmonic() { # execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_7a_Harmonic_Closeness_Estimate.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_7b_Harmonic_Closeness_Statistics.cypher" "${@}" + # Run the algorithm and write the result into the in-memory projection ("mutate") + execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_7c_Harmonic_Closeness_Mutate.cypher" "${@}" "${writePropertyName}" + # Stream to CSV local nodeLabel nodeLabel=$( extractQueryParameter "dependencies_projection_node" "${@}" ) - execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_7c_Harmonic_Closeness_Stream.cypher" "${@}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Harmonic.csv" + execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_8_Stream_Mutated_Value_Descending.cypher" "${@}" "${writePropertyName}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Harmonic_Closeness.csv" + #execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_7d_Harmonic_Closeness_Stream.cypher" "${@}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Harmonic.csv" # Update Graph (node properties and labels) - execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_7d_Harmonic_Closeness_Write.cypher" "${@}" "${writePropertyName}" + execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_9_Write_Mutated.cypher" "${@}" "${writePropertyName}" + #execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_7e_Harmonic_Closeness_Write.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1c_Label_Delete.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1d_Label_Add.cypher" "${@}" "${writePropertyName}" } @@ -216,13 +260,14 @@ centralityWithHarmonic() { # # Required Parameters: # - dependencies_projection=... -# Name prefix for the in-memory projection name for dependencies. Example: "package" +# Name prefix for the in-memory projection name for dependencies. Example: "type-centrality" # - dependencies_projection_node=... -# Label of the nodes that will be used for the projection. Example: "Package" +# Label of the nodes that will be used for the projection. Example: "Type" # - dependencies_projection_weight_property=... # Name of the node property that contains the dependency weight. Example: "weight" centralityWithCloseness() { local CENTRALITY_CYPHER_DIR="$CYPHER_DIR/Centrality" + local PROJECTION_CYPHER_DIR="$CYPHER_DIR/Dependencies_Projection" # Name of the property that will be written to the nodes containing the centrality score. # This is also used as a name with the first letter capitalized as a label for the top centraliy nodes. @@ -233,13 +278,18 @@ centralityWithCloseness() { # execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_8a_Closeness_Estimate.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_8b_Closeness_Statistics.cypher" "${@}" + # Run the algorithm and write the result into the in-memory projection ("mutate") + execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_8c_Closeness_Mutate.cypher" "${@}" "${writePropertyName}" + # Stream to CSV local nodeLabel nodeLabel=$( extractQueryParameter "dependencies_projection_node" "${@}" ) - execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_8c_Closeness_Stream.cypher" "${@}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Closeness.csv" + execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_8_Stream_Mutated_Value_Descending.cypher" "${@}" "${writePropertyName}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Betweeness.csv" + #execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_8d_Closeness_Stream.cypher" "${@}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Closeness.csv" # Update Graph (node properties and labels) - execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_8d_Closeness_Write.cypher" "${@}" "${writePropertyName}" + execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_9_Write_Mutated.cypher" "${@}" "${writePropertyName}" + #execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_8e_Closeness_Write.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1c_Label_Delete.cypher" "${@}" "${writePropertyName}" execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1d_Label_Add.cypher" "${@}" "${writePropertyName}" } @@ -248,33 +298,72 @@ centralityWithCloseness() { # # Required Parameters: # - dependencies_projection=... -# Name prefix for the in-memory projection name for dependencies. Example: "package" +# Name prefix for the in-memory projection name for dependencies. Example: "type-centrality" # - dependencies_projection_node=... -# Label of the nodes that will be used for the projection. Example: "centralityPageRank" +# Label of the nodes that will be used for the projection. Example: "Type" # - dependencies_projection_weight_property=... # Name of the node property that contains the dependency weight. Example: "weight" centralityWithHyperlinkInducedTopicSearchHITS() { local CENTRALITY_CYPHER_DIR="$CYPHER_DIR/Centrality" + local PROJECTION_CYPHER_DIR="$CYPHER_DIR/Dependencies_Projection" # Name of the property that will be written to the nodes containing the centrality score. # This is also used as a name with the first letter capitalized as a label for the top centraliy nodes. - local writePropertyName="dependencies_projection_write_property=centralityHyperlinkInducedTopicSearchAuthority" + local writePropertyName="dependencies_projection_write_property=centralityHyperlinkInducedTopicSearch" # Statistics execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_9a_Hyperlink_Induced_Topic_Search_HITS_Estimate.cypher" "${@}" "${writePropertyName}" # Note: There is an issue in gds version 2.5.0-preview3: https://github.com/neo4j/graph-data-science/issues/285 #execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_9b_Hyperlink_Induced_Topic_Search_HITS_Statistics.cypher" "${@}" + # Run the algorithm and write the result into the in-memory projection ("mutate") + # Note: There is an issue in gds version 2.5.0-preview3: https://github.com/neo4j/graph-data-science/issues/285 + execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_9c_Hyperlink_Induced_Topic_Search_HITS_Mutate.cypher" "${@}" "${writePropertyName}" + # Stream to CSV local nodeLabel nodeLabel=$( extractQueryParameter "dependencies_projection_node" "${@}" ) - execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_9c_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher" "${@}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Hyperlink_Induced_Topic_Search_HITS.csv" + execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream_Mutated.cypher" "${@}" "${writePropertyName}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Hyperlink_Induced_Topic_Search_HITS.csv" + #execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_8_Stream_Mutated_Value_Descending.cypher" "${@}" "${writePropertyName}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Hyperlink_Induced_Topic_Search_HITS.csv" + #execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher" "${@}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_Hyperlink_Induced_Topic_Search_HITS.csv" # Update Graph (node properties and labels) # Note: There is an issue in gds version 2.5.0-preview3: https://github.com/neo4j/graph-data-science/issues/285 - #execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Write.cypher" "${@}" "${writePropertyName}" - execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1c_Label_Delete.cypher" "${@}" "${writePropertyName}" - execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1d_Label_Add.cypher" "${@}" "${writePropertyName}" + #execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_9e_Hyperlink_Induced_Topic_Search_HITS_Write.cypher" "${@}" "${writePropertyName}" + execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_9_Write_Mutated.cypher" "${@}" "${writePropertyName}Authority" + execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_9_Write_Mutated.cypher" "${@}" "${writePropertyName}Hub" + execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1c_Label_Delete.cypher" "${@}" "${writePropertyName}Authority" + execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1c_Label_Delete.cypher" "${@}" "${writePropertyName}Hub" + execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1d_Label_Add.cypher" "${@}" "${writePropertyName}Authority" + execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_1d_Label_Add.cypher" "${@}" "${writePropertyName}Hub" +} + +listAllResults() { + local CENTRALITY_CYPHER_DIR="$CYPHER_DIR/Centrality" + + local nodeLabel + nodeLabel=$( extractQueryParameter "dependencies_projection_node" "${@}" ) + execute_cypher "${CENTRALITY_CYPHER_DIR}/Centrality_10_Summary.cypher" "${@}" > "${FULL_REPORT_DIRECTORY}/${nodeLabel}_Centrality_All.csv" +} + +# Run all contained centrality algorithms. +# +# Required Parameters: +# - dependencies_projection=... +# Name prefix for the in-memory projection name for dependencies. Example: "package" +# - dependencies_projection_node=... +# Label of the nodes that will be used for the projection. Example: "centralityPageRank" +# - dependencies_projection_weight_property=... +# Name of the node property that contains the dependency weight. Example: "weight" +runCentralityAlgorithms() { + time centralityWithPageRank "${@}" + time centralityWithArticleRank "${@}" + time centralityWithBetweenness "${@}" + time centralityWithCostEffectiveLazyForwardCELF "${@}" + time centralityWithHarmonic "${@}" + time centralityWithCloseness "${@}" + time centralityWithHyperlinkInducedTopicSearchHITS "${@}" + listAllResults "${@}" } # --------------------------------------------------------------- @@ -286,14 +375,8 @@ ARTIFACT_WEIGHT="dependencies_projection_weight_property=weight" # Artifact Centrality echo "centralityCsv: $(date +'%Y-%m-%dT%H:%M:%S%z') Processing artifact dependencies..." -createProjection "${ARTIFACT_PROJECTION}" "${ARTIFACT_NODE}" "${ARTIFACT_WEIGHT}" -time centralityWithPageRank "${ARTIFACT_PROJECTION}" "${ARTIFACT_NODE}" "${ARTIFACT_WEIGHT}" -time centralityWithArticleRank "${ARTIFACT_PROJECTION}" "${ARTIFACT_NODE}" "${ARTIFACT_WEIGHT}" -time centralityWithBetweenness "${ARTIFACT_PROJECTION}" "${ARTIFACT_NODE}" "${ARTIFACT_WEIGHT}" -time centralityWithCostEffectiveLazyForwardCELF "${ARTIFACT_PROJECTION}" "${ARTIFACT_NODE}" "${ARTIFACT_WEIGHT}" -time centralityWithHarmonic "${ARTIFACT_PROJECTION}" "${ARTIFACT_NODE}" "${ARTIFACT_WEIGHT}" -time centralityWithCloseness "${ARTIFACT_PROJECTION}" "${ARTIFACT_NODE}" "${ARTIFACT_WEIGHT}" -time centralityWithHyperlinkInducedTopicSearchHITS "${ARTIFACT_PROJECTION}" "${ARTIFACT_NODE}" "${ARTIFACT_WEIGHT}" +createDependencyProjection "${ARTIFACT_PROJECTION}" "${ARTIFACT_NODE}" "${ARTIFACT_WEIGHT}" +runCentralityAlgorithms "${ARTIFACT_PROJECTION}" "${ARTIFACT_NODE}" "${ARTIFACT_WEIGHT}" # --------------------------------------------------------------- @@ -304,14 +387,8 @@ PACKAGE_WEIGHT="dependencies_projection_weight_property=weight25PercentInterface # Package Centrality echo "centralityCsv: $(date +'%Y-%m-%dT%H:%M:%S%z') Processing package dependencies..." -createProjection "${PACKAGE_PROJECTION}" "${PACKAGE_NODE}" "${PACKAGE_WEIGHT}" -time centralityWithPageRank "${PACKAGE_PROJECTION}" "${PACKAGE_NODE}" "${PACKAGE_WEIGHT}" -time centralityWithArticleRank "${PACKAGE_PROJECTION}" "${PACKAGE_NODE}" "${PACKAGE_WEIGHT}" -time centralityWithBetweenness "${PACKAGE_PROJECTION}" "${PACKAGE_NODE}" "${PACKAGE_WEIGHT}" -time centralityWithCostEffectiveLazyForwardCELF "${PACKAGE_PROJECTION}" "${PACKAGE_NODE}" "${PACKAGE_WEIGHT}" -time centralityWithHarmonic "${PACKAGE_PROJECTION}" "${PACKAGE_NODE}" "${PACKAGE_WEIGHT}" -time centralityWithCloseness "${PACKAGE_PROJECTION}" "${PACKAGE_NODE}" "${PACKAGE_WEIGHT}" -time centralityWithHyperlinkInducedTopicSearchHITS "${PACKAGE_PROJECTION}" "${PACKAGE_NODE}" "${PACKAGE_WEIGHT}" +createDependencyProjection "${PACKAGE_PROJECTION}" "${PACKAGE_NODE}" "${PACKAGE_WEIGHT}" +runCentralityAlgorithms "${PACKAGE_PROJECTION}" "${PACKAGE_NODE}" "${PACKAGE_WEIGHT}" # --------------------------------------------------------------- @@ -322,13 +399,21 @@ TYPE_WEIGHT="dependencies_projection_weight_property=weight" # Type Centrality echo "centralityCsv: $(date +'%Y-%m-%dT%H:%M:%S%z') Processing type dependencies..." -createProjection "${TYPE_PROJECTION}" "${TYPE_NODE}" "${TYPE_WEIGHT}" -time centralityWithPageRank "${TYPE_PROJECTION}" "${TYPE_NODE}" "${TYPE_WEIGHT}" -time centralityWithArticleRank "${TYPE_PROJECTION}" "${TYPE_NODE}" "${TYPE_WEIGHT}" -time centralityWithBetweenness "${TYPE_PROJECTION}" "${TYPE_NODE}" "${TYPE_WEIGHT}" -time centralityWithCostEffectiveLazyForwardCELF "${TYPE_PROJECTION}" "${TYPE_NODE}" "${TYPE_WEIGHT}" -time centralityWithHarmonic "${TYPE_PROJECTION}" "${TYPE_NODE}" "${TYPE_WEIGHT}" -time centralityWithCloseness "${TYPE_PROJECTION}" "${TYPE_NODE}" "${TYPE_WEIGHT}" -time centralityWithHyperlinkInducedTopicSearchHITS "${TYPE_PROJECTION}" "${TYPE_NODE}" "${TYPE_WEIGHT}" +createDependencyProjection "${TYPE_PROJECTION}" "${TYPE_NODE}" "${TYPE_WEIGHT}" +runCentralityAlgorithms "${TYPE_PROJECTION}" "${TYPE_NODE}" "${TYPE_WEIGHT}" + +# --------------------------------------------------------------- + +# Method Query Parameters +METHOD_PROJECTION="dependencies_projection=method-centrality" +METHOD_NODE="dependencies_projection_node=Method" +METHOD_WEIGHT="dependencies_projection_weight_property=" + +# Method Centrality +echo "centralityCsv: $(date +'%Y-%m-%dT%H:%M:%S%z') Processing method dependencies..." +createMethodProjection "${METHOD_PROJECTION}" +runCentralityAlgorithms "${METHOD_PROJECTION}" "${METHOD_NODE}" "${METHOD_WEIGHT}" + +# --------------------------------------------------------------- echo "centralityCsv: $(date +'%Y-%m-%dT%H:%M:%S%z') Successfully finished" \ No newline at end of file diff --git a/scripts/reports/CommunityCsv.sh b/scripts/reports/CommunityCsv.sh index ea2cc524d..6e4330389 100755 --- a/scripts/reports/CommunityCsv.sh +++ b/scripts/reports/CommunityCsv.sh @@ -99,7 +99,6 @@ detectCommunitiesWithLouvain() { execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_9_Write_Mutated.cypher" "${@}" "${writePropertyNameIntermediate}" execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_10_Delete_Label.cypher" "${@}" "${writePropertyName}" "${writeLabelName}" execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_11_Add_Label.cypher" "${@}" "${writePropertyName}" "${writeLabelName}" - execute_cypher "${COMMUNITY_DETECTION_CYPHER_DIR}/Community_Detection_7e_Write_Modularity.cypher" "${@}" "${writePropertyName}" } # Community Detection using the Leiden Algorithm @@ -144,6 +143,18 @@ detectCommunitiesWithLeiden() { execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_9_Write_Mutated.cypher" "${@}" "${writePropertyNameIntermediate}" execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_10_Delete_Label.cypher" "${@}" "${writePropertyName}" "${writeLabelName}" execute_cypher "${PROJECTION_CYPHER_DIR}/Dependencies_11_Add_Label.cypher" "${@}" "${writePropertyName}" "${writeLabelName}" +} + +# Write modularity for Leiden communities +# +# Required Parameters: +# - dependencies_projection=... +# Name prefix for the in-memory projection name for dependencies. Example: "package" +# - dependencies_projection_weight_property=... +# Name of the node property that contains the dependency weight. Example: "weight" +writeLeidenModularity() { + local COMMUNITY_DETECTION_CYPHER_DIR="${CYPHER_DIR}/Community_Detection" + local writePropertyName="dependencies_projection_write_property=communityLeidenId" execute_cypher "${COMMUNITY_DETECTION_CYPHER_DIR}/Community_Detection_7e_Write_Modularity.cypher" "${@}" "${writePropertyName}" } @@ -320,6 +331,7 @@ ARTIFACT_KCUT="dependencies_maxkcut=5" # default = 2 # Artifact Community Detection echo "communityCsv: $(date +'%Y-%m-%dT%H:%M:%S%z') Processing artifact dependencies..." detectCommunities "${ARTIFACT_PROJECTION}" "${ARTIFACT_NODE}" "${ARTIFACT_WEIGHT}" "${ARTIFACT_GAMMA}" "${ARTIFACT_KCUT}" +writeLeidenModularity "${ARTIFACT_PROJECTION}" "${ARTIFACT_NODE}" "${ARTIFACT_WEIGHT}" # --------------------------------------------------------------- @@ -333,6 +345,7 @@ PACKAGE_KCUT="dependencies_maxkcut=20" # default = 2 # Package Community Detection echo "communityCsv: $(date +'%Y-%m-%dT%H:%M:%S%z') communityCsv: Processing package dependencies..." detectCommunities "${PACKAGE_PROJECTION}" "${PACKAGE_NODE}" "${PACKAGE_WEIGHT}" "${PACKAGE_GAMMA}" "${PACKAGE_KCUT}" +writeLeidenModularity "${PACKAGE_PROJECTION}" "${PACKAGE_NODE}" "${PACKAGE_WEIGHT}" # Package Community Detection - Special CSV Queries after update execute_cypher "${CYPHER_DIR}/Community_Detection/Which_package_community_spans_several_artifacts_and_how_are_the_packages_distributed.cypher" > "${FULL_REPORT_DIRECTORY}/Package_Communities_Leiden_That_Span_Multiple_Artifacts.csv" diff --git a/scripts/setupNeo4j.sh b/scripts/setupNeo4j.sh index f1fc185e7..287802922 100755 --- a/scripts/setupNeo4j.sh +++ b/scripts/setupNeo4j.sh @@ -15,7 +15,7 @@ NEO4J_APOC_PLUGIN_VERSION=${NEO4J_APOC_PLUGIN_VERSION:-"5.12.0"} #Awesome Proced NEO4J_APOC_PLUGIN_EDITION=${NEO4J_APOC_PLUGIN_EDITION:-"core"} #Awesome Procedures for Neo4j Plugin Edition (Neo4j v4.4.x "all", Neo4j >= v5 "core") NEO4J_APOC_PLUGIN_GITHUB=${NEO4J_APOC_PLUGIN_GITHUB:-"neo4j/apoc"} #Awesome Procedures for Neo4j Plugin GitHub User/Repository (Neo4j v4.4.x "neo4j-contrib/neo4j-apoc-procedures", Neo4j >= v5 "neo4j/apoc") NEO4J_GDS_PLUGIN_VERSION=${NEO4J_GDS_PLUGIN_VERSION:-"2.5.0"} # Graph Data Science Plugin Version 2.4.x of is compatible with Neo4j 5.x -NEO4J_OPEN_GDS_PLUGIN_VERSION=${NEO4J_OPEN_GDS_PLUGIN_VERSION:-"2.5.0-alpha03"} # Graph Data Science Plugin Version 2.4.x of is compatible with Neo4j 5.x +NEO4J_OPEN_GDS_PLUGIN_VERSION=${NEO4J_OPEN_GDS_PLUGIN_VERSION:-"2.5.0"} # Graph Data Science Plugin Version 2.4.x of is compatible with Neo4j 5.x NEO4J_GDS_PLUGIN_EDITION=${NEO4J_GDS_PLUGIN_EDITION:-"open"} # Graph Data Science Plugin Edition: "open" for OpenGDS, "full" for the full version with Neo4j license NEO4J_DATA_PATH=${NEO4J_DATA_PATH:-"$( pwd -P )/data"} # Path where Neo4j writes its data to (outside tools dir) NEO4J_RUNTIME_PATH=${NEO4J_RUNTIME_PATH:-"$( pwd -P )/runtime"} # Path where Neo4j puts runtime data to (e.g. logs) (outside tools dir)