@@ -80,15 +80,15 @@ cypher_query=$(echo -n "${original_cypher_query}" | jq -Rsa .)
8080# echo "Cypher Query: $cypher_query"
8181
8282# Put the query inside the structure that is expected by the Neo4j HTTP API
83- cypher_query_for_api=" {\" statements\" :[{\" statement\" :${cypher_query} ,\" includeStats\" : true }]}"
83+ cypher_query_for_api=" {\" statements\" :[{\" statement\" :${cypher_query} ,\" includeStats\" : false }]}"
8484# echo "Cypher Query for API: ${cypher_query_for_api}"
8585
8686# Calls the Neo4j HTTP API using cURL ( https://curl.se )
8787cyper_query_result=$( curl --silent -S --fail-with-body -H Accept:application/json -H Content-Type:application/json \
8888 -u neo4j:" ${NEO4J_INITIAL_PASSWORD} " \
8989 " http://localhost:${NEO4J_HTTP_PORT} /${NEO4J_HTTP_TRANSACTION_ENDPOINT} " \
9090 -d " ${cypher_query_for_api} " )
91- # echo "Cypher Query Result: $cyper_query_result"
91+ # echo "executeQuery: Cypher Query Result: ${ cyper_query_result} "
9292
9393# If there is a error message print it to syserr >&2 in red color
9494error_message=$( echo " ${cyper_query_result} " | jq -r ' .errors[0] // empty' )
102102if [ " ${no_source_reference} " = true ] ; then
103103 echo -n " ${cyper_query_result} " | jq -r ' (.results[0])? | .columns,(.data[].row)? | map(if type == "array" then join(",") else . end) | flatten | @csv'
104104else
105- cypher_query_file_basename= $( basename -- " $ {cypher_query_file_name} " )
106- sourceFileReferenceInfo=" Source Cypher File: ${cypher_query_file_basename } "
105+ cypher_query_file_relative_name= $ {cypher_query_file_name#/**/ cypher / }
106+ sourceFileReferenceInfo=" Source Cypher File: ${cypher_query_file_relative_name } "
107107 echo -n " ${cyper_query_result} " | jq -r --arg sourceReference " ${sourceFileReferenceInfo} " ' (.results[0])? | .columns + [$sourceReference], (.data[].row)? + [""] | map(if type == "array" then join(",") else . end) | flatten | @csv'
108108fi
0 commit comments