Skip to content

Commit

Permalink
add ic score to neo4j
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesamcl committed Nov 5, 2024
1 parent 6023eef commit 211d0ef
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions 07_create_db/neo4j/create_indexes.cypher
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@ CREATE INDEX id_id FOR (n:Id) ON n.`id`
;
CALL db.awaitIndexes(10800)
;
MATCH (ancestor:`ols:Class`)<-[:`biolink:broad_match`*1..]-(subclass:`ols:Class`)
WITH ancestor, count(DISTINCT subclass) AS num_desc
SET ancestor.num_desc = num_desc
;
WITH COLLECT { MATCH (cl:`ols:Class`) RETURN max(cl.num_desc) }[0] AS max_num_desc
MATCH (cl2:`ols:Class`)
SET cl2.ic = 1.0 - (cl2.num_desc/max_num_desc)
;
CREATE INDEX ic FOR (n:GraphNode) ON (n.ic)
;
CALL db.awaitIndexes(10800)
;

0 comments on commit 211d0ef

Please sign in to comment.