Skip to content

Commit f04d573

Browse files
committed
Add Hyperlink-Induced Topic Search (HITS) as optional feature
1 parent 967a8a3 commit f04d573

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
@@ -60,6 +60,9 @@ anomaly_detection_features() {
6060
# Determine the article rank if not already done
6161
execute_cypher_queries_until_results "${ANOMALY_DETECTION_FEATURE_CYPHER_DIR}/AnomalyDetectionFeature-ArticleRank-Exists.cypher" \
6262
"${ANOMALY_DETECTION_FEATURE_CYPHER_DIR}/AnomalyDetectionFeature-ArticleRank-Write.cypher" "${@}"
63+
# Determine the HyperlinkInducedTopicSearch (HITS) Authority and Hub score if not already done
64+
execute_cypher_queries_until_results "${ANOMALY_DETECTION_FEATURE_CYPHER_DIR}/AnomalyDetectionFeature-HyperlinkInducedTopicSearch-HITS-Exists.cypher" \
65+
"${ANOMALY_DETECTION_FEATURE_CYPHER_DIR}/AnomalyDetectionFeature-HyperlinkInducedTopicSearch-HITS-Write.cypher" "${@}"
6366
}
6467

6568
# Run queries to find anomalies in the graph.

domains/anomaly-detection/anomalyDetectionPython.sh

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

110113
# 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)