From 5f444a86fef386687e139071f18e37c0e9e5c71e Mon Sep 17 00:00:00 2001 From: JohT Date: Mon, 9 Oct 2023 11:39:20 +0200 Subject: [PATCH 1/9] Optimize centrality reports using in-memory mutate --- .../Centrality_2a_Page_Rank_Estimate.cypher | 2 +- .../Centrality_2b_Page_Rank_Statistics.cypher | 2 +- .../Centrality_3c_Page_Rank_Mutate.cypher | 35 +++++ ... => Centrality_3d_Page_Rank_Stream.cypher} | 2 +- ...r => Centrality_3e_Page_Rank_Write.cypher} | 2 +- ...Centrality_4a_Article_Rank_Estimate.cypher | 3 +- ...ntrality_4b_Article_Rank_Statistics.cypher | 3 +- .../Centrality_4c_Article_Rank_Mutate.cypher | 35 +++++ ... Centrality_4d_Article_Rank_Stream.cypher} | 2 +- ...> Centrality_4e_Article_Rank_Write.cypher} | 2 +- .../Centrality_5a_Betweeness_Estimate.cypher | 2 +- ...Centrality_5b_Betweeness_Statistics.cypher | 2 +- .../Centrality_5c_Betweeness_Mutate.cypher | 27 ++++ ...=> Centrality_5d_Betweeness_Stream.cypher} | 2 +- ... => Centrality_5e_Betweeness_Write.cypher} | 2 +- ...ffective_Lazy_Forward_CELF_Estimate.cypher | 4 +- ...ective_Lazy_Forward_CELF_Statistics.cypher | 4 +- ..._effective_Lazy_Forward_CELF_Mutate.cypher | 17 +++ ...effective_Lazy_Forward_CELF_Stream.cypher} | 4 +- ..._effective_Lazy_Forward_CELF_Write.cypher} | 4 +- ...rality_7c_Harmonic_Closeness_Mutate.cypher | 26 ++++ ...ality_7d_Harmonic_Closeness_Stream.cypher} | 2 +- ...rality_7e_Harmonic_Closeness_Write.cypher} | 2 +- .../Centrality_8b_Closeness_Statistics.cypher | 2 +- .../Centrality_8c_Closeness_Mutate.cypher | 27 ++++ ... => Centrality_8d_Closeness_Stream.cypher} | 2 +- ...r => Centrality_8e_Closeness_Write.cypher} | 2 +- ..._Induced_Topic_Search_HITS_Estimate.cypher | 4 +- ...nduced_Topic_Search_HITS_Statistics.cypher | 2 +- ...nk_Induced_Topic_Search_HITS_Mutate.cypher | 20 +++ ...k_Induced_Topic_Search_HITS_Stream.cypher} | 2 +- ...ed_Topic_Search_HITS_Stream_Mutated.cypher | 19 +++ ...nk_Induced_Topic_Search_HITS_Write.cypher} | 6 +- .../Dependencies_8_Stream_Mutated.cypher | 4 +- ...s_8_Stream_Mutated_Value_Descending.cypher | 15 ++ scripts/reports/CentralityCsv.sh | 132 ++++++++++++------ 36 files changed, 346 insertions(+), 77 deletions(-) create mode 100644 cypher/Centrality/Centrality_3c_Page_Rank_Mutate.cypher rename cypher/Centrality/{Centrality_3c_Page_Rank_Stream.cypher => Centrality_3d_Page_Rank_Stream.cypher} (94%) rename cypher/Centrality/{Centrality_3d_Page_Rank_Write.cypher => Centrality_3e_Page_Rank_Write.cypher} (96%) create mode 100644 cypher/Centrality/Centrality_4c_Article_Rank_Mutate.cypher rename cypher/Centrality/{Centrality_4c_Article_Rank_Stream.cypher => Centrality_4d_Article_Rank_Stream.cypher} (93%) rename cypher/Centrality/{Centrality_4d_Article_Rank_Write.cypher => Centrality_4e_Article_Rank_Write.cypher} (96%) create mode 100644 cypher/Centrality/Centrality_5c_Betweeness_Mutate.cypher rename cypher/Centrality/{Centrality_5c_Betweeness_Stream.cypher => Centrality_5d_Betweeness_Stream.cypher} (92%) rename cypher/Centrality/{Centrality_5d_Betweeness_Write.cypher => Centrality_5e_Betweeness_Write.cypher} (95%) create mode 100644 cypher/Centrality/Centrality_6c_Cost_effective_Lazy_Forward_CELF_Mutate.cypher rename cypher/Centrality/{Centrality_6c_Cost_effective_Lazy_Forward_CELF_Stream.cypher => Centrality_6d_Cost_effective_Lazy_Forward_CELF_Stream.cypher} (77%) rename cypher/Centrality/{Centrality_6d_Cost_effective_Lazy_Forward_CELF_Write.cypher => Centrality_6e_Cost_effective_Lazy_Forward_CELF_Write.cypher} (76%) create mode 100644 cypher/Centrality/Centrality_7c_Harmonic_Closeness_Mutate.cypher rename cypher/Centrality/{Centrality_7c_Harmonic_Closeness_Stream.cypher => Centrality_7d_Harmonic_Closeness_Stream.cypher} (80%) rename cypher/Centrality/{Centrality_7d_Harmonic_Closeness_Write.cypher => Centrality_7e_Harmonic_Closeness_Write.cypher} (94%) create mode 100644 cypher/Centrality/Centrality_8c_Closeness_Mutate.cypher rename cypher/Centrality/{Centrality_8c_Closeness_Stream.cypher => Centrality_8d_Closeness_Stream.cypher} (92%) rename cypher/Centrality/{Centrality_8d_Closeness_Write.cypher => Centrality_8e_Closeness_Write.cypher} (96%) create mode 100644 cypher/Centrality/Centrality_9c_Hyperlink_Induced_Topic_Search_HITS_Mutate.cypher rename cypher/Centrality/{Centrality_9c_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher => Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher} (87%) create mode 100644 cypher/Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream_Mutated.cypher rename cypher/Centrality/{Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Write.cypher => Centrality_9e_Hyperlink_Induced_Topic_Search_HITS_Write.cypher} (61%) create mode 100644 cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Value_Descending.cypher diff --git a/cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher b/cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher index 9cfd12a46..976f7c16a 100644 --- a/cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher +++ b/cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher @@ -1,4 +1,4 @@ -//Centrality 2a Page Rank Estimate Memory +// Centrality 2a Page Rank Estimate Memory CALL gds.pageRank.write.estimate( $dependencies_projection + '-without-empty', { diff --git a/cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher b/cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher index c41d8d581..c9d8027e0 100644 --- a/cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher +++ b/cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher @@ -1,4 +1,4 @@ -//Centrality 2b Page Rank Statistics +// Centrality 2b Page Rank Statistics CALL gds.pageRank.stats( $dependencies_projection + '-without-empty', { 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..dc6968b5a --- /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 + '-without-empty', { + maxIterations: 50 + ,dampingFactor: 0.85 + ,tolerance: 0.00000001 + ,scaler: "L2Norm" + ,relationshipWeightProperty: $dependencies_projection_weight_property + ,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 94% rename from cypher/Centrality/Centrality_3c_Page_Rank_Stream.cypher rename to cypher/Centrality/Centrality_3d_Page_Rank_Stream.cypher index 28abbd527..81f06141e 100644 --- a/cypher/Centrality/Centrality_3c_Page_Rank_Stream.cypher +++ b/cypher/Centrality/Centrality_3d_Page_Rank_Stream.cypher @@ -1,4 +1,4 @@ -//Centrality 3c Page Rank Stream +// Centrality 3d Page Rank Stream CALL gds.pageRank.stream( $dependencies_projection + '-without-empty', { diff --git a/cypher/Centrality/Centrality_3d_Page_Rank_Write.cypher b/cypher/Centrality/Centrality_3e_Page_Rank_Write.cypher similarity index 96% rename from cypher/Centrality/Centrality_3d_Page_Rank_Write.cypher rename to cypher/Centrality/Centrality_3e_Page_Rank_Write.cypher index 6d192bb98..17cb750c9 100644 --- a/cypher/Centrality/Centrality_3d_Page_Rank_Write.cypher +++ b/cypher/Centrality/Centrality_3e_Page_Rank_Write.cypher @@ -1,4 +1,4 @@ -//Centrality 3d Page Rank Write +// Centrality 3e Page Rank Write CALL gds.pageRank.write( $dependencies_projection + '-without-empty', { diff --git a/cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher b/cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher index aca0c8ad1..d5194601f 100644 --- a/cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher +++ b/cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher @@ -1,4 +1,5 @@ -//Centrality 4a Article Rank Estimate Memory +// Centrality 4a Article Rank Estimate Memory + CALL gds.articleRank.write.estimate( $dependencies_projection + '-without-empty', { writeProperty: $dependencies_projection_write_property diff --git a/cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher b/cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher index b2626c33a..e221c7c2e 100644 --- a/cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher +++ b/cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher @@ -1,4 +1,5 @@ -//Centrality 4b Article Rank Statistics +// Centrality 4b Article Rank Statistics + CALL gds.articleRank.stats( $dependencies_projection + '-without-empty', { maxIterations: 30 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..317a0fe8b --- /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 + '-without-empty', { + maxIterations: 30 + ,dampingFactor: 0.85 + ,tolerance: 0.00000001 + ,scaler: "L2Norm" + ,relationshipWeightProperty: $dependencies_projection_weight_property + ,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 93% rename from cypher/Centrality/Centrality_4c_Article_Rank_Stream.cypher rename to cypher/Centrality/Centrality_4d_Article_Rank_Stream.cypher index 804515ef4..191df539b 100644 --- a/cypher/Centrality/Centrality_4c_Article_Rank_Stream.cypher +++ b/cypher/Centrality/Centrality_4d_Article_Rank_Stream.cypher @@ -1,4 +1,4 @@ -//Centrality 4c Article Rank Stream +//Centrality 4d Article Rank Stream CALL gds.articleRank.stream( $dependencies_projection + '-without-empty', { diff --git a/cypher/Centrality/Centrality_4d_Article_Rank_Write.cypher b/cypher/Centrality/Centrality_4e_Article_Rank_Write.cypher similarity index 96% rename from cypher/Centrality/Centrality_4d_Article_Rank_Write.cypher rename to cypher/Centrality/Centrality_4e_Article_Rank_Write.cypher index 90e7d4cd8..2b7b1919f 100644 --- a/cypher/Centrality/Centrality_4d_Article_Rank_Write.cypher +++ b/cypher/Centrality/Centrality_4e_Article_Rank_Write.cypher @@ -1,4 +1,4 @@ -//Centrality 4d Article Rank Write +//Centrality 4e Article Rank Write CALL gds.articleRank.write( $dependencies_projection + '-without-empty', { diff --git a/cypher/Centrality/Centrality_5a_Betweeness_Estimate.cypher b/cypher/Centrality/Centrality_5a_Betweeness_Estimate.cypher index 7763f3407..5beadfffa 100644 --- a/cypher/Centrality/Centrality_5a_Betweeness_Estimate.cypher +++ b/cypher/Centrality/Centrality_5a_Betweeness_Estimate.cypher @@ -1,4 +1,4 @@ -//Centrality 5a Betweeness Estimate +// Centrality 5a Betweeness Estimate CALL gds.betweenness.write.estimate( $dependencies_projection + '-without-empty', { diff --git a/cypher/Centrality/Centrality_5b_Betweeness_Statistics.cypher b/cypher/Centrality/Centrality_5b_Betweeness_Statistics.cypher index 0b8b6c66a..0def4e5ec 100644 --- a/cypher/Centrality/Centrality_5b_Betweeness_Statistics.cypher +++ b/cypher/Centrality/Centrality_5b_Betweeness_Statistics.cypher @@ -1,4 +1,4 @@ -//Centrality 5b Betweeness Statistics +// Centrality 5b Betweeness Statistics CALL gds.betweenness.stats( $dependencies_projection + '-without-empty', { diff --git a/cypher/Centrality/Centrality_5c_Betweeness_Mutate.cypher b/cypher/Centrality/Centrality_5c_Betweeness_Mutate.cypher new file mode 100644 index 000000000..d6b11eb6d --- /dev/null +++ b/cypher/Centrality/Centrality_5c_Betweeness_Mutate.cypher @@ -0,0 +1,27 @@ +// Centrality 5c Betweeness Mutate + +CALL gds.betweenness.mutate( + $dependencies_projection + '-without-empty', { + relationshipWeightProperty: $dependencies_projection_weight_property + ,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 92% rename from cypher/Centrality/Centrality_5c_Betweeness_Stream.cypher rename to cypher/Centrality/Centrality_5d_Betweeness_Stream.cypher index 09120f602..231900836 100644 --- a/cypher/Centrality/Centrality_5c_Betweeness_Stream.cypher +++ b/cypher/Centrality/Centrality_5d_Betweeness_Stream.cypher @@ -1,4 +1,4 @@ -// Centrality 5c Betweeness Stream +// Centrality 5d Betweeness Stream CALL gds.betweenness.stream( $dependencies_projection + '-without-empty', { diff --git a/cypher/Centrality/Centrality_5d_Betweeness_Write.cypher b/cypher/Centrality/Centrality_5e_Betweeness_Write.cypher similarity index 95% rename from cypher/Centrality/Centrality_5d_Betweeness_Write.cypher rename to cypher/Centrality/Centrality_5e_Betweeness_Write.cypher index 34f2dae85..fedc18a21 100644 --- a/cypher/Centrality/Centrality_5d_Betweeness_Write.cypher +++ b/cypher/Centrality/Centrality_5e_Betweeness_Write.cypher @@ -1,4 +1,4 @@ -// Centrality 5d Betweeness Write +// Centrality 5e Betweeness Write CALL gds.betweenness.write( $dependencies_projection + '-without-empty', { 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..d80425f35 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,6 +1,6 @@ -// Centrality 6c Cost-effective Lazy Forward (CELF) Estimate +// Centrality 6a Cost-effective Lazy Forward (CELF) Estimate - CALL gds.beta.influenceMaximization.celf.write.estimate( + CALL gds.influenceMaximization.celf.write.estimate( $dependencies_projection + '-without-empty', { 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..d10d1aaf3 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,6 +1,6 @@ -// Centrality 6b Cost-effective Lazy Forward (CELF) Estimate +// Centrality 6b Cost-effective Lazy Forward (CELF) Statistics -CALL gds.beta.influenceMaximization.celf.stats( +CALL gds.influenceMaximization.celf.stats( $dependencies_projection + '-without-empty', { seedSetSize: 5 }) 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..2d12a87b8 --- /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 + '-without-empty', { + 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 77% 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..3eee06f2b 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,6 +1,6 @@ -// Centrality 6c Cost-effective Lazy Forward (CELF) Stream +// Centrality 6d Cost-effective Lazy Forward (CELF) Stream - CALL gds.beta.influenceMaximization.celf.stream( + CALL gds.influenceMaximization.celf.stream( $dependencies_projection + '-without-empty', { seedSetSize: 5 }) 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 76% 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..0b1b484dc 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,6 +1,6 @@ -// Centrality 6d Cost-effective Lazy Forward (CELF) Write +// Centrality 6e Cost-effective Lazy Forward (CELF) Write - CALL gds.beta.influenceMaximization.celf.write( + CALL gds.influenceMaximization.celf.write( $dependencies_projection + '-without-empty', { seedSetSize: 5 ,writeProperty: $dependencies_projection_write_property 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..bae44b7a4 --- /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 + '-without-empty', { + 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..9697d2e01 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 + '-without-empty', {}) 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 94% rename from cypher/Centrality/Centrality_7d_Harmonic_Closeness_Write.cypher rename to cypher/Centrality/Centrality_7e_Harmonic_Closeness_Write.cypher index 7f9f0efb0..1b3a07ab4 100644 --- a/cypher/Centrality/Centrality_7d_Harmonic_Closeness_Write.cypher +++ b/cypher/Centrality/Centrality_7e_Harmonic_Closeness_Write.cypher @@ -1,6 +1,6 @@ // Centrality 7d Harmonic Closeness Write -CALL gds.alpha.closeness.harmonic.write( +CALL gds.closeness.harmonic.write( $dependencies_projection + '-without-empty', { ,writeProperty: $dependencies_projection_write_property }) diff --git a/cypher/Centrality/Centrality_8b_Closeness_Statistics.cypher b/cypher/Centrality/Centrality_8b_Closeness_Statistics.cypher index 9e23c6d6e..4cf3a0406 100644 --- a/cypher/Centrality/Centrality_8b_Closeness_Statistics.cypher +++ b/cypher/Centrality/Centrality_8b_Closeness_Statistics.cypher @@ -1,6 +1,6 @@ //Centrality 8b Closeness Statistics -CALL gds.beta.closeness.stats( +CALL gds.closeness.stats( $dependencies_projection + '-without-empty', { useWassermanFaust: true }) diff --git a/cypher/Centrality/Centrality_8c_Closeness_Mutate.cypher b/cypher/Centrality/Centrality_8c_Closeness_Mutate.cypher new file mode 100644 index 000000000..e01323bef --- /dev/null +++ b/cypher/Centrality/Centrality_8c_Closeness_Mutate.cypher @@ -0,0 +1,27 @@ +// Centrality 8c Closeness Mutate + +CALL gds.closeness.mutate( + $dependencies_projection + '-without-empty', { + 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 92% rename from cypher/Centrality/Centrality_8c_Closeness_Stream.cypher rename to cypher/Centrality/Centrality_8d_Closeness_Stream.cypher index ecb68123e..cfa1bf7e2 100644 --- a/cypher/Centrality/Centrality_8c_Closeness_Stream.cypher +++ b/cypher/Centrality/Centrality_8d_Closeness_Stream.cypher @@ -1,6 +1,6 @@ // Centrality 8c Closeness Stream -CALL gds.beta.closeness.stream( +CALL gds.closeness.stream( $dependencies_projection + '-without-empty', { useWassermanFaust: true }) diff --git a/cypher/Centrality/Centrality_8d_Closeness_Write.cypher b/cypher/Centrality/Centrality_8e_Closeness_Write.cypher similarity index 96% rename from cypher/Centrality/Centrality_8d_Closeness_Write.cypher rename to cypher/Centrality/Centrality_8e_Closeness_Write.cypher index 8004ed657..5d76f39ce 100644 --- a/cypher/Centrality/Centrality_8d_Closeness_Write.cypher +++ b/cypher/Centrality/Centrality_8e_Closeness_Write.cypher @@ -1,6 +1,6 @@ // Centrality 8d Closeness Write -CALL gds.beta.closeness.write( +CALL gds.closeness.write( $dependencies_projection + '-without-empty', { 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..ece03c662 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 @@ -3,8 +3,8 @@ CALL gds.alpha.hits.write.estimate( $dependencies_projection + '-without-empty', { 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..4b86d88f5 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,4 +1,4 @@ -// 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', { 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..33e0ca4bc --- /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 + '-without-empty', { + 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 87% 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..24cda3e10 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,4 +1,4 @@ -// 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', { 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 61% 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..50cc132a8 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', { 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/Dependencies_Projection/Dependencies_8_Stream_Mutated.cypher b/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated.cypher index b9d0a1e53..950387d13 100644 --- a/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated.cypher +++ b/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated.cypher @@ -8,7 +8,7 @@ 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_Value_Descending.cypher b/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Value_Descending.cypher new file mode 100644 index 000000000..9759fbdba --- /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 + '-without-empty' + ,[$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/scripts/reports/CentralityCsv.sh b/scripts/reports/CentralityCsv.sh index e906db7a0..420ca544b 100755 --- a/scripts/reports/CentralityCsv.sh +++ b/scripts/reports/CentralityCsv.sh @@ -67,6 +67,7 @@ createProjection() { # 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 +77,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}" } @@ -98,6 +104,7 @@ centralityWithPageRank() { # 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 +114,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}" } @@ -129,6 +141,7 @@ centralityWithArticleRank() { # 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 +151,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}" } @@ -160,6 +178,7 @@ centralityWithBetweenness() { # 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 +188,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}" } @@ -191,6 +215,7 @@ centralityWithCostEffectiveLazyForwardCELF() { # 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 +226,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}" } @@ -223,6 +253,7 @@ centralityWithHarmonic() { # 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 +264,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}" } @@ -255,26 +291,57 @@ centralityWithCloseness() { # 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" +} + +# 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() { + createProjection "${@}" + time centralityWithPageRank "${@}" + time centralityWithArticleRank "${@}" + time centralityWithBetweenness "${@}" + time centralityWithCostEffectiveLazyForwardCELF "${@}" + time centralityWithHarmonic "${@}" + time centralityWithCloseness "${@}" + time centralityWithHyperlinkInducedTopicSearchHITS "${@}" } # --------------------------------------------------------------- @@ -286,14 +353,7 @@ 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}" +runCentralityAlgorithms "${ARTIFACT_PROJECTION}" "${ARTIFACT_NODE}" "${ARTIFACT_WEIGHT}" # --------------------------------------------------------------- @@ -304,14 +364,7 @@ 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}" +runCentralityAlgorithms "${PACKAGE_PROJECTION}" "${PACKAGE_NODE}" "${PACKAGE_WEIGHT}" # --------------------------------------------------------------- @@ -322,13 +375,6 @@ 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}" +runCentralityAlgorithms "${TYPE_PROJECTION}" "${TYPE_NODE}" "${TYPE_WEIGHT}" echo "centralityCsv: $(date +'%Y-%m-%dT%H:%M:%S%z') Successfully finished" \ No newline at end of file From 22b14861a162cba35a09eb2d28b00b629a48c4ed Mon Sep 17 00:00:00 2001 From: JohT Date: Sat, 14 Oct 2023 09:29:04 +0200 Subject: [PATCH 2/9] Fix command line input error for explore mode --- scripts/analysis/analyze.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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. From 0215a8898ae28083c4bcf69208a9d383a2f35d85 Mon Sep 17 00:00:00 2001 From: JohT Date: Sat, 14 Oct 2023 09:34:09 +0200 Subject: [PATCH 3/9] Support empty=no relationship weight parameter --- cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher | 2 +- cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher | 2 +- cypher/Centrality/Centrality_3c_Page_Rank_Mutate.cypher | 2 +- cypher/Centrality/Centrality_3d_Page_Rank_Stream.cypher | 2 +- cypher/Centrality/Centrality_3e_Page_Rank_Write.cypher | 2 +- cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher | 2 +- cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher | 2 +- cypher/Centrality/Centrality_4c_Article_Rank_Mutate.cypher | 2 +- cypher/Centrality/Centrality_4d_Article_Rank_Stream.cypher | 2 +- cypher/Centrality/Centrality_4e_Article_Rank_Write.cypher | 2 +- cypher/Centrality/Centrality_5a_Betweeness_Estimate.cypher | 2 +- cypher/Centrality/Centrality_5b_Betweeness_Statistics.cypher | 2 +- cypher/Centrality/Centrality_5c_Betweeness_Mutate.cypher | 2 +- cypher/Centrality/Centrality_5d_Betweeness_Stream.cypher | 2 +- cypher/Centrality/Centrality_5e_Betweeness_Write.cypher | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher b/cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher index 976f7c16a..fb31e1716 100644 --- a/cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher +++ b/cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher @@ -6,7 +6,7 @@ CALL gds.pageRank.write.estimate( ,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 c9d8027e0..c161394c3 100644 --- a/cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher +++ b/cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher @@ -5,7 +5,7 @@ CALL gds.pageRank.stats( 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 index dc6968b5a..3a685f817 100644 --- a/cypher/Centrality/Centrality_3c_Page_Rank_Mutate.cypher +++ b/cypher/Centrality/Centrality_3c_Page_Rank_Mutate.cypher @@ -6,7 +6,7 @@ CALL gds.pageRank.mutate( ,dampingFactor: 0.85 ,tolerance: 0.00000001 ,scaler: "L2Norm" - ,relationshipWeightProperty: $dependencies_projection_weight_property + ,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END ,mutateProperty: $dependencies_projection_write_property }) YIELD nodePropertiesWritten diff --git a/cypher/Centrality/Centrality_3d_Page_Rank_Stream.cypher b/cypher/Centrality/Centrality_3d_Page_Rank_Stream.cypher index 81f06141e..bc8c5f83e 100644 --- a/cypher/Centrality/Centrality_3d_Page_Rank_Stream.cypher +++ b/cypher/Centrality/Centrality_3d_Page_Rank_Stream.cypher @@ -5,7 +5,7 @@ CALL gds.pageRank.stream( 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_3e_Page_Rank_Write.cypher b/cypher/Centrality/Centrality_3e_Page_Rank_Write.cypher index 17cb750c9..812cdc44d 100644 --- a/cypher/Centrality/Centrality_3e_Page_Rank_Write.cypher +++ b/cypher/Centrality/Centrality_3e_Page_Rank_Write.cypher @@ -5,7 +5,7 @@ CALL gds.pageRank.write( 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 d5194601f..c9fce73b0 100644 --- a/cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher +++ b/cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher @@ -6,7 +6,7 @@ CALL gds.articleRank.write.estimate( ,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 e221c7c2e..484ef2ed8 100644 --- a/cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher +++ b/cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher @@ -5,7 +5,7 @@ CALL gds.articleRank.stats( 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 index 317a0fe8b..b4e1e6c2b 100644 --- a/cypher/Centrality/Centrality_4c_Article_Rank_Mutate.cypher +++ b/cypher/Centrality/Centrality_4c_Article_Rank_Mutate.cypher @@ -6,7 +6,7 @@ CALL gds.articleRank.mutate( ,dampingFactor: 0.85 ,tolerance: 0.00000001 ,scaler: "L2Norm" - ,relationshipWeightProperty: $dependencies_projection_weight_property + ,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END ,mutateProperty: $dependencies_projection_write_property }) YIELD nodePropertiesWritten diff --git a/cypher/Centrality/Centrality_4d_Article_Rank_Stream.cypher b/cypher/Centrality/Centrality_4d_Article_Rank_Stream.cypher index 191df539b..8acd3e7b5 100644 --- a/cypher/Centrality/Centrality_4d_Article_Rank_Stream.cypher +++ b/cypher/Centrality/Centrality_4d_Article_Rank_Stream.cypher @@ -5,7 +5,7 @@ CALL gds.articleRank.stream( 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_4e_Article_Rank_Write.cypher b/cypher/Centrality/Centrality_4e_Article_Rank_Write.cypher index 2b7b1919f..314ec3fc0 100644 --- a/cypher/Centrality/Centrality_4e_Article_Rank_Write.cypher +++ b/cypher/Centrality/Centrality_4e_Article_Rank_Write.cypher @@ -5,7 +5,7 @@ CALL gds.articleRank.write( 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 5beadfffa..f6ffc2fa5 100644 --- a/cypher/Centrality/Centrality_5a_Betweeness_Estimate.cypher +++ b/cypher/Centrality/Centrality_5a_Betweeness_Estimate.cypher @@ -2,7 +2,7 @@ CALL gds.betweenness.write.estimate( $dependencies_projection + '-without-empty', { - relationshipWeightProperty: $dependencies_projection_weight_property + 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 0def4e5ec..1185e7af7 100644 --- a/cypher/Centrality/Centrality_5b_Betweeness_Statistics.cypher +++ b/cypher/Centrality/Centrality_5b_Betweeness_Statistics.cypher @@ -2,7 +2,7 @@ CALL gds.betweenness.stats( $dependencies_projection + '-without-empty', { - relationshipWeightProperty: $dependencies_projection_weight_property + 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 index d6b11eb6d..8fe99c51b 100644 --- a/cypher/Centrality/Centrality_5c_Betweeness_Mutate.cypher +++ b/cypher/Centrality/Centrality_5c_Betweeness_Mutate.cypher @@ -2,7 +2,7 @@ CALL gds.betweenness.mutate( $dependencies_projection + '-without-empty', { - relationshipWeightProperty: $dependencies_projection_weight_property + relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END ,mutateProperty: $dependencies_projection_write_property }) YIELD nodePropertiesWritten diff --git a/cypher/Centrality/Centrality_5d_Betweeness_Stream.cypher b/cypher/Centrality/Centrality_5d_Betweeness_Stream.cypher index 231900836..81484c733 100644 --- a/cypher/Centrality/Centrality_5d_Betweeness_Stream.cypher +++ b/cypher/Centrality/Centrality_5d_Betweeness_Stream.cypher @@ -2,7 +2,7 @@ CALL gds.betweenness.stream( $dependencies_projection + '-without-empty', { - relationshipWeightProperty: $dependencies_projection_weight_property + 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_5e_Betweeness_Write.cypher b/cypher/Centrality/Centrality_5e_Betweeness_Write.cypher index fedc18a21..c966339b4 100644 --- a/cypher/Centrality/Centrality_5e_Betweeness_Write.cypher +++ b/cypher/Centrality/Centrality_5e_Betweeness_Write.cypher @@ -2,7 +2,7 @@ CALL gds.betweenness.write( $dependencies_projection + '-without-empty', { - relationshipWeightProperty: $dependencies_projection_weight_property + relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END ,writeProperty: $dependencies_projection_write_property }) YIELD nodePropertiesWritten From 8b367950ad8afbc4397b2c1f95e546fb32b0831d Mon Sep 17 00:00:00 2001 From: JohT Date: Sat, 14 Oct 2023 09:34:35 +0200 Subject: [PATCH 4/9] Add centrality for methods --- .../Methods_1_Delete_Projection.cypher | 5 ++ .../Methods_2_Create_Projection.cypher | 13 ++++ scripts/reports/CentralityCsv.sh | 70 +++++++++++++------ 3 files changed, 68 insertions(+), 20 deletions(-) create mode 100644 cypher/Method_Projection/Methods_1_Delete_Projection.cypher create mode 100644 cypher/Method_Projection/Methods_2_Create_Projection.cypher 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..ad52dead6 --- /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 + '-without-empty', 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..ff30596f2 --- /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 + '-without-empty', 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/scripts/reports/CentralityCsv.sh b/scripts/reports/CentralityCsv.sh index 420ca544b..63f2b5741 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,13 +56,27 @@ 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() { @@ -97,9 +111,9 @@ 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() { @@ -134,9 +148,9 @@ 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() { @@ -171,9 +185,9 @@ 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() { @@ -208,9 +222,9 @@ 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() { @@ -246,9 +260,9 @@ 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() { @@ -284,9 +298,9 @@ 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() { @@ -334,7 +348,6 @@ centralityWithHyperlinkInducedTopicSearchHITS() { # - dependencies_projection_weight_property=... # Name of the node property that contains the dependency weight. Example: "weight" runCentralityAlgorithms() { - createProjection "${@}" time centralityWithPageRank "${@}" time centralityWithArticleRank "${@}" time centralityWithBetweenness "${@}" @@ -353,6 +366,7 @@ ARTIFACT_WEIGHT="dependencies_projection_weight_property=weight" # Artifact Centrality echo "centralityCsv: $(date +'%Y-%m-%dT%H:%M:%S%z') Processing artifact dependencies..." +createDependencyProjection "${ARTIFACT_PROJECTION}" "${ARTIFACT_NODE}" "${ARTIFACT_WEIGHT}" runCentralityAlgorithms "${ARTIFACT_PROJECTION}" "${ARTIFACT_NODE}" "${ARTIFACT_WEIGHT}" # --------------------------------------------------------------- @@ -364,6 +378,7 @@ PACKAGE_WEIGHT="dependencies_projection_weight_property=weight25PercentInterface # Package Centrality echo "centralityCsv: $(date +'%Y-%m-%dT%H:%M:%S%z') Processing package dependencies..." +createDependencyProjection "${PACKAGE_PROJECTION}" "${PACKAGE_NODE}" "${PACKAGE_WEIGHT}" runCentralityAlgorithms "${PACKAGE_PROJECTION}" "${PACKAGE_NODE}" "${PACKAGE_WEIGHT}" # --------------------------------------------------------------- @@ -375,6 +390,21 @@ TYPE_WEIGHT="dependencies_projection_weight_property=weight" # Type Centrality echo "centralityCsv: $(date +'%Y-%m-%dT%H:%M:%S%z') Processing type dependencies..." +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 From 8376ed4be6bd179bee94d2ace478642d33a2ded4 Mon Sep 17 00:00:00 2001 From: JohT Date: Sat, 14 Oct 2023 09:39:50 +0200 Subject: [PATCH 5/9] Update open graph data science to v2.5.0 --- scripts/setupNeo4j.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From f68d1e632f290026c2f4c5efaecf20399144dde5 Mon Sep 17 00:00:00 2001 From: JohT Date: Sat, 14 Oct 2023 10:21:25 +0200 Subject: [PATCH 6/9] Raise transaction memory to 3 GB --- scripts/configuration/template-neo4j-v4.conf | 4 ++-- scripts/configuration/template-neo4j.conf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 From fa12929d3ce5c1ff1551cb2fac5fdc660381a1f9 Mon Sep 17 00:00:00 2001 From: JohT Date: Sat, 14 Oct 2023 10:30:45 +0200 Subject: [PATCH 7/9] Write Modularity only for Artifacts & Packages Restrict it to Leiden Communities for performance reasons. --- scripts/reports/CommunityCsv.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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" From 2fa1342c4e951fdceea52af7b814abb47a343fc2 Mon Sep 17 00:00:00 2001 From: JohT Date: Sat, 14 Oct 2023 11:40:24 +0200 Subject: [PATCH 8/9] Rename "without-empty" to "cleaned" Focus on "what" over "how" to be more general for different use cases. --- cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher | 2 +- cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher | 2 +- cypher/Centrality/Centrality_3c_Page_Rank_Mutate.cypher | 2 +- cypher/Centrality/Centrality_3d_Page_Rank_Stream.cypher | 2 +- cypher/Centrality/Centrality_3e_Page_Rank_Write.cypher | 2 +- cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher | 2 +- cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher | 2 +- cypher/Centrality/Centrality_4c_Article_Rank_Mutate.cypher | 2 +- cypher/Centrality/Centrality_4d_Article_Rank_Stream.cypher | 2 +- cypher/Centrality/Centrality_4e_Article_Rank_Write.cypher | 2 +- cypher/Centrality/Centrality_5a_Betweeness_Estimate.cypher | 2 +- cypher/Centrality/Centrality_5b_Betweeness_Statistics.cypher | 2 +- cypher/Centrality/Centrality_5c_Betweeness_Mutate.cypher | 2 +- cypher/Centrality/Centrality_5d_Betweeness_Stream.cypher | 2 +- cypher/Centrality/Centrality_5e_Betweeness_Write.cypher | 2 +- ...ntrality_6a_Cost_effective_Lazy_Forward_CELF_Estimate.cypher | 2 +- ...rality_6b_Cost_effective_Lazy_Forward_CELF_Statistics.cypher | 2 +- ...Centrality_6c_Cost_effective_Lazy_Forward_CELF_Mutate.cypher | 2 +- ...Centrality_6d_Cost_effective_Lazy_Forward_CELF_Stream.cypher | 2 +- .../Centrality_6e_Cost_effective_Lazy_Forward_CELF_Write.cypher | 2 +- .../Centrality_7b_Harmonic_Closeness_Statistics.cypher | 2 +- .../Centrality/Centrality_7c_Harmonic_Closeness_Mutate.cypher | 2 +- .../Centrality/Centrality_7d_Harmonic_Closeness_Stream.cypher | 2 +- cypher/Centrality/Centrality_7e_Harmonic_Closeness_Write.cypher | 2 +- cypher/Centrality/Centrality_8b_Closeness_Statistics.cypher | 2 +- cypher/Centrality/Centrality_8c_Closeness_Mutate.cypher | 2 +- cypher/Centrality/Centrality_8d_Closeness_Stream.cypher | 2 +- cypher/Centrality/Centrality_8e_Closeness_Write.cypher | 2 +- ...ality_9a_Hyperlink_Induced_Topic_Search_HITS_Estimate.cypher | 2 +- ...ity_9b_Hyperlink_Induced_Topic_Search_HITS_Statistics.cypher | 2 +- ...trality_9c_Hyperlink_Induced_Topic_Search_HITS_Mutate.cypher | 2 +- ...trality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher | 2 +- ...ntrality_9e_Hyperlink_Induced_Topic_Search_HITS_Write.cypher | 2 +- .../Community_Detection_1a_Louvain_Estimate.cypher | 2 +- .../Community_Detection_1b_Louvain_Statistics.cypher | 2 +- .../Community_Detection_1c_Louvain_Mutate.cypher | 2 +- .../Community_Detection_1d_Louvain_Stream.cypher | 2 +- .../Community_Detection_1d_Stream_Intermediate_Mutated.cypher | 2 +- ...ction_1e_Louvain_Write_intermediateLouvainCommunityId.cypher | 2 +- ...mmunity_Detection_1e_Louvain_Write_louvainCommunityId.cypher | 2 +- .../Community_Detection_2a_Leiden_Estimate.cypher | 2 +- .../Community_Detection_2b_Leiden_Statistics.cypher | 2 +- .../Community_Detection_2c_Leiden_Mutate.cypher | 2 +- .../Community_Detection_2d_Leiden_Stream.cypher | 2 +- .../Community_Detection_2d_Leiden_Write_Node_Property.cypher | 2 +- ...unity_Detection_3a_WeaklyConnectedComponents_Estimate.cypher | 2 +- ...ity_Detection_3b_WeaklyConnectedComponents_Statistics.cypher | 2 +- ...mmunity_Detection_3c_WeaklyConnectedComponents_Mutate.cypher | 2 +- ...mmunity_Detection_3d_WeaklyConnectedComponents_Stream.cypher | 2 +- ...ommunity_Detection_3e_WeaklyConnectedComponents_Write.cypher | 2 +- .../Community_Detection_4a_Label_Propagation_Estimate.cypher | 2 +- .../Community_Detection_4b_Label_Propagation_Statistics.cypher | 2 +- .../Community_Detection_4c_Label_Propagation_Mutate.cypher | 2 +- .../Community_Detection_4d_Label_Propagation_Stream.cypher | 2 +- .../Community_Detection_4e_Label_Propagation_Write.cypher | 2 +- .../Community_Detection_5a_K_Core_Decomposition_Estimate.cypher | 2 +- ...ommunity_Detection_5b_K_Core_Decomposition_Statistics.cypher | 2 +- .../Community_Detection_5c_K_Core_Decomposition_Mutate.cypher | 2 +- .../Community_Detection_5d_K_Core_Decomposition_Stream.cypher | 2 +- .../Community_Detection_5e_K_Core_Decomposition_Write.cypher | 2 +- ...unity_Detection_6a_Approximate_Maximum_k_cut_Estimate.cypher | 2 +- ...mmunity_Detection_6c_Approximate_Maximum_k_cut_Mutate.cypher | 2 +- ...mmunity_Detection_6d_Approximate_Maximum_k_cut_Stream.cypher | 2 +- .../Community_Detection_7d_Modularity.cypher | 2 +- .../Community_Detection_7d_Modularity_Members.cypher | 2 +- .../Community_Detection_7e_Write_Modularity.cypher | 2 +- .../Dependencies_2_Delete_Subgraph.cypher | 2 +- .../Dependencies_5_Create_Subgraph.cypher | 2 +- .../Dependencies_6_Check_Projection_Nodes.cypher | 2 +- .../Dependencies_7_Check_Projection_Relationships.cypher | 2 +- .../Dependencies_8_Stream_Mutated.cypher | 2 +- .../Dependencies_8_Stream_Mutated_Extended.cypher | 2 +- .../Dependencies_8_Stream_Mutated_Grouped.cypher | 2 +- .../Dependencies_8_Stream_Mutated_Value_Descending.cypher | 2 +- .../Dependencies_Projection/Dependencies_9_Write_Mutated.cypher | 2 +- cypher/Method_Projection/Methods_1_Delete_Projection.cypher | 2 +- cypher/Method_Projection/Methods_2_Create_Projection.cypher | 2 +- .../Node_Embeddings_1a_Fast_Random_Projection_Estimate.cypher | 2 +- .../Node_Embeddings_1b_Fast_Random_Projection_Statistics.cypher | 2 +- .../Node_Embeddings_1c_Fast_Random_Projection_Mutate.cypher | 2 +- .../Node_Embeddings_1d_Fast_Random_Projection_Stream.cypher | 2 +- .../Node_Embeddings_1e_Fast_Random_Projection_Write.cypher | 2 +- .../Node_Embeddings/Node_Embeddings_2a_Hash_GNN_Estimate.cypher | 2 +- .../Node_Embeddings/Node_Embeddings_2c_Hash_GNN_Mutate.cypher | 2 +- .../Node_Embeddings/Node_Embeddings_2d_Hash_GNN_Stream.cypher | 2 +- .../Node_Embeddings/Node_Embeddings_3a_Node2Vec_Estimate.cypher | 2 +- .../Node_Embeddings/Node_Embeddings_3c_Node2Vec_Mutate.cypher | 2 +- .../Node_Embeddings/Node_Embeddings_3d_Node2Vec_Stream.cypher | 2 +- cypher/Node_Embeddings/Node_Embeddings_3e_Node2Vec_Write.cypher | 2 +- cypher/Similarity/Similarity_1a_Estimate.cypher | 2 +- cypher/Similarity/Similarity_1b_Statistics.cypher | 2 +- cypher/Similarity/Similarity_1c_Stream.cypher | 2 +- cypher/Similarity/Similarity_1e_Write.cypher | 2 +- cypher/Topological_Sort/Topological_Sort_List.cypher | 2 +- cypher/Topological_Sort/Topological_Sort_Write.cypher | 2 +- 95 files changed, 95 insertions(+), 95 deletions(-) diff --git a/cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher b/cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher index fb31e1716..1d894a22b 100644 --- a/cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher +++ b/cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher @@ -1,7 +1,7 @@ // 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 diff --git a/cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher b/cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher index c161394c3..cd2d88900 100644 --- a/cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher +++ b/cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher @@ -1,7 +1,7 @@ // Centrality 2b Page Rank Statistics CALL gds.pageRank.stats( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { maxIterations: 50 ,dampingFactor: 0.85 ,tolerance: 0.00000001 diff --git a/cypher/Centrality/Centrality_3c_Page_Rank_Mutate.cypher b/cypher/Centrality/Centrality_3c_Page_Rank_Mutate.cypher index 3a685f817..94d11584d 100644 --- a/cypher/Centrality/Centrality_3c_Page_Rank_Mutate.cypher +++ b/cypher/Centrality/Centrality_3c_Page_Rank_Mutate.cypher @@ -1,7 +1,7 @@ // Centrality 3c Page Rank Mutate CALL gds.pageRank.mutate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { maxIterations: 50 ,dampingFactor: 0.85 ,tolerance: 0.00000001 diff --git a/cypher/Centrality/Centrality_3d_Page_Rank_Stream.cypher b/cypher/Centrality/Centrality_3d_Page_Rank_Stream.cypher index bc8c5f83e..02acb8990 100644 --- a/cypher/Centrality/Centrality_3d_Page_Rank_Stream.cypher +++ b/cypher/Centrality/Centrality_3d_Page_Rank_Stream.cypher @@ -1,7 +1,7 @@ // Centrality 3d Page Rank Stream CALL gds.pageRank.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { maxIterations: 50 ,dampingFactor: 0.85 ,tolerance: 0.00000001 diff --git a/cypher/Centrality/Centrality_3e_Page_Rank_Write.cypher b/cypher/Centrality/Centrality_3e_Page_Rank_Write.cypher index 812cdc44d..0591a3d8b 100644 --- a/cypher/Centrality/Centrality_3e_Page_Rank_Write.cypher +++ b/cypher/Centrality/Centrality_3e_Page_Rank_Write.cypher @@ -1,7 +1,7 @@ // Centrality 3e Page Rank Write CALL gds.pageRank.write( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { maxIterations: 50 ,dampingFactor: 0.85 ,tolerance: 0.00000001 diff --git a/cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher b/cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher index c9fce73b0..5c926cb58 100644 --- a/cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher +++ b/cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher @@ -1,7 +1,7 @@ // 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 diff --git a/cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher b/cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher index 484ef2ed8..80141de9d 100644 --- a/cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher +++ b/cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher @@ -1,7 +1,7 @@ // Centrality 4b Article Rank Statistics CALL gds.articleRank.stats( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { maxIterations: 30 ,dampingFactor: 0.85 ,tolerance: 0.00000001 diff --git a/cypher/Centrality/Centrality_4c_Article_Rank_Mutate.cypher b/cypher/Centrality/Centrality_4c_Article_Rank_Mutate.cypher index b4e1e6c2b..443b1e1f1 100644 --- a/cypher/Centrality/Centrality_4c_Article_Rank_Mutate.cypher +++ b/cypher/Centrality/Centrality_4c_Article_Rank_Mutate.cypher @@ -1,7 +1,7 @@ //Centrality 4c Article Rank Mutate CALL gds.articleRank.mutate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { maxIterations: 30 ,dampingFactor: 0.85 ,tolerance: 0.00000001 diff --git a/cypher/Centrality/Centrality_4d_Article_Rank_Stream.cypher b/cypher/Centrality/Centrality_4d_Article_Rank_Stream.cypher index 8acd3e7b5..6ff8e3eb4 100644 --- a/cypher/Centrality/Centrality_4d_Article_Rank_Stream.cypher +++ b/cypher/Centrality/Centrality_4d_Article_Rank_Stream.cypher @@ -1,7 +1,7 @@ //Centrality 4d Article Rank Stream CALL gds.articleRank.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { maxIterations: 30 ,dampingFactor: 0.85 ,tolerance: 0.00000001 diff --git a/cypher/Centrality/Centrality_4e_Article_Rank_Write.cypher b/cypher/Centrality/Centrality_4e_Article_Rank_Write.cypher index 314ec3fc0..400941159 100644 --- a/cypher/Centrality/Centrality_4e_Article_Rank_Write.cypher +++ b/cypher/Centrality/Centrality_4e_Article_Rank_Write.cypher @@ -1,7 +1,7 @@ //Centrality 4e Article Rank Write CALL gds.articleRank.write( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { maxIterations: 50 ,dampingFactor: 0.85 ,tolerance: 0.00000001 diff --git a/cypher/Centrality/Centrality_5a_Betweeness_Estimate.cypher b/cypher/Centrality/Centrality_5a_Betweeness_Estimate.cypher index f6ffc2fa5..2f8c37610 100644 --- a/cypher/Centrality/Centrality_5a_Betweeness_Estimate.cypher +++ b/cypher/Centrality/Centrality_5a_Betweeness_Estimate.cypher @@ -1,7 +1,7 @@ // Centrality 5a Betweeness Estimate CALL gds.betweenness.write.estimate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END ,writeProperty: $dependencies_projection_write_property }) diff --git a/cypher/Centrality/Centrality_5b_Betweeness_Statistics.cypher b/cypher/Centrality/Centrality_5b_Betweeness_Statistics.cypher index 1185e7af7..2a4ff8b39 100644 --- a/cypher/Centrality/Centrality_5b_Betweeness_Statistics.cypher +++ b/cypher/Centrality/Centrality_5b_Betweeness_Statistics.cypher @@ -1,7 +1,7 @@ // Centrality 5b Betweeness Statistics CALL gds.betweenness.stats( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END }) YIELD preProcessingMillis diff --git a/cypher/Centrality/Centrality_5c_Betweeness_Mutate.cypher b/cypher/Centrality/Centrality_5c_Betweeness_Mutate.cypher index 8fe99c51b..64cd092ab 100644 --- a/cypher/Centrality/Centrality_5c_Betweeness_Mutate.cypher +++ b/cypher/Centrality/Centrality_5c_Betweeness_Mutate.cypher @@ -1,7 +1,7 @@ // Centrality 5c Betweeness Mutate CALL gds.betweenness.mutate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END ,mutateProperty: $dependencies_projection_write_property }) diff --git a/cypher/Centrality/Centrality_5d_Betweeness_Stream.cypher b/cypher/Centrality/Centrality_5d_Betweeness_Stream.cypher index 81484c733..ff68ff127 100644 --- a/cypher/Centrality/Centrality_5d_Betweeness_Stream.cypher +++ b/cypher/Centrality/Centrality_5d_Betweeness_Stream.cypher @@ -1,7 +1,7 @@ // Centrality 5d Betweeness Stream CALL gds.betweenness.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END }) YIELD nodeId, score diff --git a/cypher/Centrality/Centrality_5e_Betweeness_Write.cypher b/cypher/Centrality/Centrality_5e_Betweeness_Write.cypher index c966339b4..e8587cb54 100644 --- a/cypher/Centrality/Centrality_5e_Betweeness_Write.cypher +++ b/cypher/Centrality/Centrality_5e_Betweeness_Write.cypher @@ -1,7 +1,7 @@ // Centrality 5e Betweeness Write CALL gds.betweenness.write( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END ,writeProperty: $dependencies_projection_write_property }) 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 d80425f35..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 6a Cost-effective Lazy Forward (CELF) Estimate CALL gds.influenceMaximization.celf.write.estimate( - $dependencies_projection + '-without-empty', { + $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 d10d1aaf3..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) Statistics CALL gds.influenceMaximization.celf.stats( - $dependencies_projection + '-without-empty', { + $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 index 2d12a87b8..01586af5a 100644 --- a/cypher/Centrality/Centrality_6c_Cost_effective_Lazy_Forward_CELF_Mutate.cypher +++ b/cypher/Centrality/Centrality_6c_Cost_effective_Lazy_Forward_CELF_Mutate.cypher @@ -1,7 +1,7 @@ // Centrality 6c Cost-effective Lazy Forward (CELF) Mutate CALL gds.influenceMaximization.celf.mutate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { seedSetSize: 5 ,mutateProperty: $dependencies_projection_write_property }) diff --git a/cypher/Centrality/Centrality_6d_Cost_effective_Lazy_Forward_CELF_Stream.cypher b/cypher/Centrality/Centrality_6d_Cost_effective_Lazy_Forward_CELF_Stream.cypher index 3eee06f2b..3da7ebe4f 100644 --- a/cypher/Centrality/Centrality_6d_Cost_effective_Lazy_Forward_CELF_Stream.cypher +++ b/cypher/Centrality/Centrality_6d_Cost_effective_Lazy_Forward_CELF_Stream.cypher @@ -1,7 +1,7 @@ // Centrality 6d Cost-effective Lazy Forward (CELF) Stream CALL gds.influenceMaximization.celf.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { seedSetSize: 5 }) YIELD nodeId, spread diff --git a/cypher/Centrality/Centrality_6e_Cost_effective_Lazy_Forward_CELF_Write.cypher b/cypher/Centrality/Centrality_6e_Cost_effective_Lazy_Forward_CELF_Write.cypher index 0b1b484dc..2f47c283b 100644 --- a/cypher/Centrality/Centrality_6e_Cost_effective_Lazy_Forward_CELF_Write.cypher +++ b/cypher/Centrality/Centrality_6e_Cost_effective_Lazy_Forward_CELF_Write.cypher @@ -1,7 +1,7 @@ // Centrality 6e Cost-effective Lazy Forward (CELF) Write CALL gds.influenceMaximization.celf.write( - $dependencies_projection + '-without-empty', { + $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 index bae44b7a4..efeb37f0e 100644 --- a/cypher/Centrality/Centrality_7c_Harmonic_Closeness_Mutate.cypher +++ b/cypher/Centrality/Centrality_7c_Harmonic_Closeness_Mutate.cypher @@ -1,7 +1,7 @@ // Centrality 7c Harmonic Closeness Mutate CALL gds.closeness.harmonic.mutate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { mutateProperty: $dependencies_projection_write_property }) YIELD nodePropertiesWritten diff --git a/cypher/Centrality/Centrality_7d_Harmonic_Closeness_Stream.cypher b/cypher/Centrality/Centrality_7d_Harmonic_Closeness_Stream.cypher index 9697d2e01..03ae1f918 100644 --- a/cypher/Centrality/Centrality_7d_Harmonic_Closeness_Stream.cypher +++ b/cypher/Centrality/Centrality_7d_Harmonic_Closeness_Stream.cypher @@ -1,6 +1,6 @@ // Centrality 7a Harmonic Closeness Stream -CALL gds.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_7e_Harmonic_Closeness_Write.cypher b/cypher/Centrality/Centrality_7e_Harmonic_Closeness_Write.cypher index 1b3a07ab4..6b1fadae5 100644 --- a/cypher/Centrality/Centrality_7e_Harmonic_Closeness_Write.cypher +++ b/cypher/Centrality/Centrality_7e_Harmonic_Closeness_Write.cypher @@ -1,7 +1,7 @@ // Centrality 7d Harmonic Closeness Write CALL gds.closeness.harmonic.write( - $dependencies_projection + '-without-empty', { + $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 4cf3a0406..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.closeness.stats( - $dependencies_projection + '-without-empty', { + $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 index e01323bef..9928376df 100644 --- a/cypher/Centrality/Centrality_8c_Closeness_Mutate.cypher +++ b/cypher/Centrality/Centrality_8c_Closeness_Mutate.cypher @@ -1,7 +1,7 @@ // Centrality 8c Closeness Mutate CALL gds.closeness.mutate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { useWassermanFaust: true ,mutateProperty: $dependencies_projection_write_property }) diff --git a/cypher/Centrality/Centrality_8d_Closeness_Stream.cypher b/cypher/Centrality/Centrality_8d_Closeness_Stream.cypher index cfa1bf7e2..c9691206c 100644 --- a/cypher/Centrality/Centrality_8d_Closeness_Stream.cypher +++ b/cypher/Centrality/Centrality_8d_Closeness_Stream.cypher @@ -1,7 +1,7 @@ // Centrality 8c Closeness Stream CALL gds.closeness.stream( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { useWassermanFaust: true }) YIELD nodeId, score diff --git a/cypher/Centrality/Centrality_8e_Closeness_Write.cypher b/cypher/Centrality/Centrality_8e_Closeness_Write.cypher index 5d76f39ce..6b3695a39 100644 --- a/cypher/Centrality/Centrality_8e_Closeness_Write.cypher +++ b/cypher/Centrality/Centrality_8e_Closeness_Write.cypher @@ -1,7 +1,7 @@ // Centrality 8d Closeness Write CALL gds.closeness.write( - $dependencies_projection + '-without-empty', { + $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 ece03c662..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,7 +1,7 @@ // 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 + 'Authority' ,hubProperty: $dependencies_projection_write_property + 'Hub' 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 4b86d88f5..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) 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 index 33e0ca4bc..be193d202 100644 --- a/cypher/Centrality/Centrality_9c_Hyperlink_Induced_Topic_Search_HITS_Mutate.cypher +++ b/cypher/Centrality/Centrality_9c_Hyperlink_Induced_Topic_Search_HITS_Mutate.cypher @@ -1,7 +1,7 @@ // Centrality 9c Hyperlink-Induced Topic Search (HITS) Mutate CALL gds.alpha.hits.mutate( - $dependencies_projection + '-without-empty', { + $dependencies_projection + '-cleaned', { hitsIterations: 20 ,authProperty: $dependencies_projection_write_property + 'Authority' ,hubProperty: $dependencies_projection_write_property + 'Hub' diff --git a/cypher/Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher b/cypher/Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher index 24cda3e10..4f9f8edd7 100644 --- a/cypher/Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher +++ b/cypher/Centrality/Centrality_9d_Hyperlink_Induced_Topic_Search_HITS_Stream.cypher @@ -1,7 +1,7 @@ // 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_9e_Hyperlink_Induced_Topic_Search_HITS_Write.cypher b/cypher/Centrality/Centrality_9e_Hyperlink_Induced_Topic_Search_HITS_Write.cypher index 50cc132a8..30c595e17 100644 --- a/cypher/Centrality/Centrality_9e_Hyperlink_Induced_Topic_Search_HITS_Write.cypher +++ b/cypher/Centrality/Centrality_9e_Hyperlink_Induced_Topic_Search_HITS_Write.cypher @@ -1,7 +1,7 @@ // 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 + 'Authority' ,hubProperty: $dependencies_projection_write_property + 'Hub' 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 950387d13..14dbc5bdb 100644 --- a/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated.cypher +++ b/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated.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_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 index 9759fbdba..afc007bbc 100644 --- a/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Value_Descending.cypher +++ b/cypher/Dependencies_Projection/Dependencies_8_Stream_Mutated_Value_Descending.cypher @@ -1,7 +1,7 @@ // 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 + '-without-empty' + $dependencies_projection + '-cleaned' ,[$dependencies_projection_write_property] ) YIELD nodeId, nodeProperty, propertyValue 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 index ad52dead6..16cb66e1b 100644 --- a/cypher/Method_Projection/Methods_1_Delete_Projection.cypher +++ b/cypher/Method_Projection/Methods_1_Delete_Projection.cypher @@ -1,5 +1,5 @@ // Delete projection if existing. 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/Method_Projection/Methods_2_Create_Projection.cypher b/cypher/Method_Projection/Methods_2_Create_Projection.cypher index ff30596f2..0c3bfcbd5 100644 --- a/cypher/Method_Projection/Methods_2_Create_Projection.cypher +++ b/cypher/Method_Projection/Methods_2_Create_Projection.cypher @@ -7,7 +7,7 @@ AND target.visibility = 'public' AND source.name <> '' AND target.name <> '' - WITH gds.graph.project($dependencies_projection + '-without-empty', source, target) AS projection + 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 From 44dfc6ff83d32f6dde587d348e9df671633ea064 Mon Sep 17 00:00:00 2001 From: JohT Date: Sat, 14 Oct 2023 12:27:36 +0200 Subject: [PATCH 9/9] Add centrality summary containing all values --- cypher/Centrality/Centrality_10_Summary.cypher | 17 +++++++++++++++++ scripts/reports/CentralityCsv.sh | 9 +++++++++ 2 files changed, 26 insertions(+) create mode 100644 cypher/Centrality/Centrality_10_Summary.cypher 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/scripts/reports/CentralityCsv.sh b/scripts/reports/CentralityCsv.sh index 63f2b5741..059a8faf5 100755 --- a/scripts/reports/CentralityCsv.sh +++ b/scripts/reports/CentralityCsv.sh @@ -338,6 +338,14 @@ centralityWithHyperlinkInducedTopicSearchHITS() { 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: @@ -355,6 +363,7 @@ runCentralityAlgorithms() { time centralityWithHarmonic "${@}" time centralityWithCloseness "${@}" time centralityWithHyperlinkInducedTopicSearchHITS "${@}" + listAllResults "${@}" } # ---------------------------------------------------------------