<commit_before>#! /bin/bash

# http api tests : run-time environment initialization
#
# environment :
# STORE_URL : host http url
# STORE_ACCOUNT : account name
# STORE_REPOSITORY : individual repository
# STORE_TOKEN : the authentication token

if [[ "" == "${STORE_URL}" ]]
then
  export STORE_URL="http://localhost"
fi
# strip the protocol and possible user authentication to yield the actual host
export STORE_HOST=${STORE_URL#*http://} 
# strip a possible port
export STORE_HOST=${STORE_HOST%:*}
export STORE_SITE="dydra.com"           # the abstract site name
export STORE_ACCOUNT="openrdf-sesame"
export STORE_REPOSITORY="mem-rdf"
export STORE_REPOSITORY_PUBLIC="public"
export STORE_CLIENT_IP="127.0.0.1"
export STORE_PREFIX="rdf"
export STORE_DGRAPH="sesame"
export STORE_IGRAPH="http://example.org"
export STORE_NAMED_GRAPH="http://${STORE_SITE}/${STORE_ACCOUNT}/${STORE_REPOSITORY}/graph-name"
export STORE_NAMED_GRAPH_URL="${STORE_URL}/${STORE_ACCOUNT}/${STORE_REPOSITORY}/graph-name"
export STORE_IS_LOCAL=false
fgrep 127.0.0.1 /etc/hosts | fgrep -q ${STORE_HOST} &&  export STORE_IS_LOCAL=true

export STATUS_OK=200
export STATUS_DELETE_SUCCESS=204
export STATUS_PATCH_SUCCESS="201|204"
export POST_SUCCESS="201|204"
export STATUS_POST_SUCCESS="201|204"
export PUT_SUCCESS="201|204"
export STATUS_PUT_SUCCESS="201|204"
export PATCH_SUCCESS=201
export STATUS_CREATED=201
export STATUS_NO_CONTENT=204
export STATUS_UPDATED="201|204"
export DELETE_SUCCESS=204
export STATUS_BAD_REQUEST=400
export STATUS_UNAUTHORIZED=401
export STATUS_NOT_FOUND=404
export STATUS_NOT_ACCEPTABLE=406
export STATUS_UNSUPPORTED_MEDIA=415

if [[ "" == "${CURL}" ]]
then
  export CURL="curl --ipv4"
fi
# export SPARQL_URL="${STORE_URL}/${STORE_ACCOUNT}/${STORE_REPOSITORY}"
export SPARQL_URL="${STORE_URL}/${STORE_ACCOUNT}/${STORE_REPOSITORY}/sparql"
export GRAPH_STORE_URL="${STORE_URL}/${STORE_ACCOUNT}/${STORE_REPOSITORY}/service"

if [[ "" == "${STORE_CLIENT_IP_AUTHORIZED}" ]]
then 
  export STORE_CLIENT_IP_AUTHORIZED=true
fi

if [[ "" == "${STORE_TOKEN}" ]]
then 
  export STORE_TOKEN=`cat ~/.dydra/token-${STORE_ACCOUNT}@${STORE_HOST}`
fi
if [[ "" == "${STORE_TOKEN_JHACKER}" ]]<commit_msg>curl diagnostics...<commit_after>#! /bin/bash

# http api tests : run-time environment initialization
#
# environment :
# STORE_URL : host http url
# STORE_ACCOUNT : account name
# STORE_REPOSITORY : individual repository
# STORE_TOKEN : the authentication token

if [[ "" == "${STORE_URL}" ]]
then
  export STORE_URL="http://localhost"
fi
# strip the protocol and possible user authentication to yield the actual host
export STORE_HOST=${STORE_URL#*http://} 
# strip a possible port
export STORE_HOST=${STORE_HOST%:*}
export STORE_SITE="dydra.com"           # the abstract site name
export STORE_ACCOUNT="openrdf-sesame"
export STORE_REPOSITORY="mem-rdf"
export STORE_REPOSITORY_PUBLIC="public"
export STORE_CLIENT_IP="127.0.0.1"
export STORE_PREFIX="rdf"
export STORE_DGRAPH="sesame"
export STORE_IGRAPH="http://example.org"
export STORE_NAMED_GRAPH="http://${STORE_SITE}/${STORE_ACCOUNT}/${STORE_REPOSITORY}/graph-name"
export STORE_NAMED_GRAPH_URL="${STORE_URL}/${STORE_ACCOUNT}/${STORE_REPOSITORY}/graph-name"
export STORE_IS_LOCAL=false
fgrep 127.0.0.1 /etc/hosts | fgrep -q ${STORE_HOST} &&  export STORE_IS_LOCAL=true

export STATUS_OK=200
export STATUS_DELETE_SUCCESS=204
export STATUS_PATCH_SUCCESS="201|204"
export POST_SUCCESS="201|204"
export STATUS_POST_SUCCESS="201|204"
export PUT_SUCCESS="201|204"
export STATUS_PUT_SUCCESS="201|204"
export PATCH_SUCCESS=201
export STATUS_CREATED=201
export STATUS_NO_CONTENT=204
export STATUS_UPDATED="201|204"
export DELETE_SUCCESS=204
export STATUS_BAD_REQUEST=400
export STATUS_UNAUTHORIZED=401
export STATUS_NOT_FOUND=404
export STATUS_NOT_ACCEPTABLE=406
export STATUS_UNSUPPORTED_MEDIA=415

if [[ "" == "${CURL}" ]]
then
  export CURL="curl -v --ipv4"
fi
# export SPARQL_URL="${STORE_URL}/${STORE_ACCOUNT}/${STORE_REPOSITORY}"
export SPARQL_URL="${STORE_URL}/${STORE_ACCOUNT}/${STORE_REPOSITORY}/sparql"
export GRAPH_STORE_URL="${STORE_URL}/${STORE_ACCOUNT}/${STORE_REPOSITORY}/service"

if [[ "" == "${STORE_CLIENT_IP_AUTHORIZED}" ]]
then 
  export STORE_CLIENT_IP_AUTHORIZED=true
fi

if [[ "" == "${STORE_TOKEN}" ]]
then 
  export STORE_TOKEN=`cat ~/.dydra/token-${STORE_ACCOUNT}@${STORE_HOST}`
fi
if [[ "" == "${STORE_TOKEN_JHACKER}" ]]
{'fraction_non_alphanumeric': 0.13552361396303902, 'fraction_numerical': 0.03741729409080539, 'mean_word_length': 7.414587332053743, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7499587', 'n_tokens_mistral': 1810, 'n_tokens_neox': 1651, 'n_words': 292}