File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1+ // Data verification DEPENDS_ON relationship distinct label constellations
2+
3+ MATCH (s )- [ r : DEPENDS_ON ] -> (t )
4+ WHERE s <> t
5+ RETURN count (DISTINCT s ) AS sourceNodeCount
Original file line number Diff line number Diff line change 22
33# Prepares and validates the graph database before analysis
44
5- # Requires executeQueryFunctions.sh
5+ # Requires executeQueryFunctions.sh, parseCsvFunctions.sh
66
77# Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands)
88set -o errexit -o pipefail
@@ -27,13 +27,23 @@ echo "prepareAnalysis: CYPHER_DIR=${CYPHER_DIR}"
2727# Define functions to execute a cypher query from within the given file (first and only argument)
2828source " ${SCRIPTS_DIR} /executeQueryFunctions.sh"
2929
30+ # Define function(s) (e.g. is_csv_column_greater_zero) to parse CSV format strings from Cypher query results.
31+ source " ${SCRIPTS_DIR} /parseCsvFunctions.sh"
32+
3033# Local Constants
3134PACKAGE_WEIGHTS_CYPHER_DIR=" $CYPHER_DIR /Package_Relationship_Weights"
3235PACKAGE_METRICS_CYPHER_DIR=" $CYPHER_DIR /Metrics"
3336EXTERNAL_DEPENDENCIES_CYPHER_DIR=" $CYPHER_DIR /External_Dependencies"
3437ARTIFACT_DEPENDENCIES_CYPHER_DIR=" $CYPHER_DIR /Artifact_Dependencies"
3538TYPES_CYPHER_DIR=" $CYPHER_DIR /Types"
3639
40+ # Preparation - Data verification: DEPENDS_ON releationships
41+ dataVerificationResult=$( execute_cypher " ${CYPHER_DIR} /Data_verification_DEPENDS_ON_relationships.cypher" " ${@ } " )
42+ if ! is_csv_column_greater_zero " ${dataVerificationResult} " " sourceNodeCount" ; then
43+ echo " prepareAnalysis: Error: Data verification failed. At least one DEPENDS_ON relationship constellation required."
44+ exit 1
45+ fi
46+
3747# Preparation - Create indices
3848execute_cypher " ${CYPHER_DIR} /Create_index_for_full_qualified_type_name.cypher"
3949
You can’t perform that action at this time.
0 commit comments