Skip to content

Commit 485ca7d

Browse files
committed
Add Hyperlink-Induced Topic Search (HITS) as optional feature
1 parent ab93af6 commit 485ca7d

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

domains/anomaly-detection/anomalyDetectionCsv.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ anomaly_detection_features() {
5959
# Determine the article rank if not already done
6060
execute_cypher_queries_until_results "${ANOMALY_DETECTION_FEATURE_CYPHER_DIR}/AnomalyDetectionFeature-ArticleRank-Exists.cypher" \
6161
"${ANOMALY_DETECTION_FEATURE_CYPHER_DIR}/AnomalyDetectionFeature-ArticleRank-Write.cypher" "${@}"
62+
# Determine the HyperlinkInducedTopicSearch (HITS) Authority and Hub score if not already done
63+
execute_cypher_queries_until_results "${ANOMALY_DETECTION_FEATURE_CYPHER_DIR}/AnomalyDetectionFeature-HyperlinkInducedTopicSearch-HITS-Exists.cypher" \
64+
"${ANOMALY_DETECTION_FEATURE_CYPHER_DIR}/AnomalyDetectionFeature-HyperlinkInducedTopicSearch-HITS-Write.cypher" "${@}"
6265
}
6366
# Run queries to find anomalies in the graph.
6467
#

domains/anomaly-detection/anomalyDetectionPython.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ anomaly_detection_features() {
104104
# Determine the article rank if not already done
105105
execute_cypher_queries_until_results "${ANOMALY_DETECTION_FEATURE_CYPHER_DIR}/AnomalyDetectionFeature-ArticleRank-Exists.cypher" \
106106
"${ANOMALY_DETECTION_FEATURE_CYPHER_DIR}/AnomalyDetectionFeature-ArticleRank-Write.cypher" "${@}"
107+
# Determine the HyperlinkInducedTopicSearch (HITS) Authority and Hub score if not already done
108+
execute_cypher_queries_until_results "${ANOMALY_DETECTION_FEATURE_CYPHER_DIR}/AnomalyDetectionFeature-HyperlinkInducedTopicSearch-HITS-Exists.cypher" \
109+
"${ANOMALY_DETECTION_FEATURE_CYPHER_DIR}/AnomalyDetectionFeature-HyperlinkInducedTopicSearch-HITS-Write.cypher" "${@}"
107110
}
108111

109112
# Execute the Python scripts for anomaly detection.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Return the first node with a centralityHyperlinkInducedTopicSearch(Authority/Hub) (HITS) if it exists
2+
3+
MATCH (codeUnit)
4+
WHERE $projection_node_label IN labels(codeUnit)
5+
AND codeUnit.centralityHyperlinkInducedTopicSearchAuthority IS NOT NULL
6+
AND codeUnit.centralityHyperlinkInducedTopicSearchHub IS NOT NULL
7+
RETURN codeUnit.name AS shortCodeUnitName
8+
,elementId(codeUnit) AS nodeElementId
9+
,codeUnit.centralityHyperlinkInducedTopicSearchAuthority AS hyperlinkInducedTopicSearchAuthority
10+
,codeUnit.centralityHyperlinkInducedTopicSearchHub AS hyperlinkInducedTopicSearchHub
11+
LIMIT 1
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Calculates and writes the Hyperlink-Induced Topic Search (HITS) centrality scores for anomaly detection
2+
3+
CALL gds.hits.write(
4+
$projection_name + '-directed-cleaned', {
5+
authProperty: 'centralityHyperlinkInducedTopicSearchAuthority'
6+
,hubProperty: 'centralityHyperlinkInducedTopicSearchHub'
7+
})
8+
YIELD nodePropertiesWritten, ranIterations, didConverge, preProcessingMillis, computeMillis, writeMillis
9+
RETURN nodePropertiesWritten, ranIterations, didConverge, preProcessingMillis, computeMillis, writeMillis

0 commit comments

Comments
 (0)