From 939dc3dbf942508850d9028a129996a844a57fe5 Mon Sep 17 00:00:00 2001 From: holegar Date: Mon, 16 Sep 2024 12:21:09 +0100 Subject: [PATCH] Added Stats node placeholder - Changes versioning Added a new node as a placeholder to record the knowledge graph's general statistics at the time of creation. --- rres-endpoints/config/datasets/plants-lite-58-cfg.sh | 4 +++- rres-endpoints/config/default-cfg.sh | 2 +- rres-endpoints/endpoint-steps/neo-index.sh | 12 +++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/rres-endpoints/config/datasets/plants-lite-58-cfg.sh b/rres-endpoints/config/datasets/plants-lite-58-cfg.sh index d59c7d3..64579b8 100644 --- a/rres-endpoints/config/datasets/plants-lite-58-cfg.sh +++ b/rres-endpoints/config/datasets/plants-lite-58-cfg.sh @@ -5,7 +5,9 @@ oxl_home="$KNET_HOME/etl-test/plants-lite/$KETL_DATASET_VERSION" export KETL_SRC_OXL="$oxl_home/generic/knowledge-network.oxl" -export KETL_OUT="$KETL_OUT_HOME/$KETL_DATASET_ID/$KETL_DATASET_VERSION" +# Sam 20240909 - New versioning convention +export KETL_OUT="$KETL_OUT_HOME/$KETL_DATASET_ID/v$KETL_DATASET_VERSION-RC1" + ## Neo  # diff --git a/rres-endpoints/config/default-cfg.sh b/rres-endpoints/config/default-cfg.sh index 23a89a1..3cb2259 100644 --- a/rres-endpoints/config/default-cfg.sh +++ b/rres-endpoints/config/default-cfg.sh @@ -50,7 +50,7 @@ export KETL_NEOEXPORT_HOME='' # ===> Override this in config/datasets/name-ver.sh, so that we can keep track # of the version that was used for a given dataset # -export KETL_NEO_VERSION='5.16.0' +export KETL_NEO_VERSION='5.20.0' # The KnetMiner codebase export KNET_WEBAPP='' diff --git a/rres-endpoints/endpoint-steps/neo-index.sh b/rres-endpoints/endpoint-steps/neo-index.sh index b7c7364..84c5a96 100644 --- a/rres-endpoints/endpoint-steps/neo-index.sh +++ b/rres-endpoints/endpoint-steps/neo-index.sh @@ -32,6 +32,16 @@ printf "\n\n Creating Neo indexing (full-text and semantic motifs)\n\n" "$KNET_INITIALIZER_HOME/knet-init.sh" \ -c "$knet_cfg/config/config-etl.yml" --neo-index=config:// --neo-motifs --in "$oxl_src" +# Sam 2024/09/13: Run the Cypher query to generate stats node in Neo4j +printf "\nRunning Cypher query to generate stats node in Neo4j\n" -echo -e "\nAll Neo4j indexing done\n" +export PATH=$PATH:$KNET_SOFTWARE/neo4j-community-5.20.0-etl/bin + +query="MATCH (g:Gene) +WITH count(g) AS geneCount +CREATE (s:Stats { Stats: '{\"geneCount\": ' + geneCount + '}' })" + +cypher-shell -u "$KETL_NEO_USR" -p "$KETL_NEO_PWD" --format plain "$query" + +echo -e "\nAll Neo4j indexing and stats generation done\n" echo `date` >"$out_flag"