<commit_before>#!/bin/bash
#
# Batch script to "sponge" required ontologies via Virtuoso RDF Proxy Service.
#
# Author: <NAME>
#

RDF_PROXY="http://localhost:8890/about/rdf/"
LOG_FILE=$0.log

# create a lookup for ontologies/URLs
declare -A RDF
RDF[FALDO]="http://biohackathon.org/resource/faldo.rdf"
RDF[SO]="http://purl.obolibrary.org/obo/so.owl"
RDF[RO]="http://localhost:8890/about/rdf/http://purl.obolibrary.org/obo/ro.owl"
RDF[SIO]="http://semanticscience.org/ontology/sio.owl"
RDF[VT]="http://localhost:8890/about/rdf/http://purl.obolibrary.org/obo/vt.owl"
RDF[CMO]="http://localhost:8890/about/rdf/http://purl.obolibrary.org/obo/cmo.owl"
RDF[LPT]="http://localhost:8890/about/rdf/http://data.bioontology.org/ontologies/LPT/download?apikey=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb&download_format=rdf"
RDF[LBO]="http://localhost:8890/about/rdf/http://data.bioontology.org/ontologies/LBO/download?apikey=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb&download_format=rdf"
# Note: LPT and LBO do not resolve via BioPortal's PURLs, so need to use these "ugly" URLs.
# To rename RDF graph IRIs use Virtuoso Conductor, follow Linked Data->Graphs in the menu.

rm -f ${LOG_FILE}
for name in "${!RDF[@]}"
do
  echo "[$(date +'%d/%b/%Y %T')] Sponging '$name' ontology into Virtuoso RDF Quad Store..." >> ${LOG_FILE}
  curl -Ss -I -H "Accept: application/rdf+xml" "$RDF_PROXY/${RDF[$name]}" &>> ${LOG_FILE}
done<commit_msg>Update proxy URL; fix URIs for some ontologies & update doc<commit_after>#!/bin/bash
#
# Batch script to "sponge" required ontologies via Virtuoso RDF Proxy Service.
#
# Author: <NAME>
#
# Prerequisite: GRANT EXECUTE ON "DB.DBA.EXEC_AS" to "SPARQL";
#

RDF_PROXY="http://localhost:8890/describe/"
LOG_FILE=$0.log

# create a lookup for ontologies/URLs
declare -A RDF
RDF[FALDO]="http://biohackathon.org/resource/faldo.rdf"
RDF[SIO]="http://semanticscience.org/ontology/sio.owl"
RDF[SO]="http://purl.obolibrary.org/so.owl"
RDF[RO]="http://purl.obolibrary.org/ro.owl"
RDF[VT]="http://purl.obolibrary.org/obo/vt.owl"
RDF[CMO]="http://purl.obolibrary.org/obo/cmo.owl"
# Note: Must download LPT and LBO because they do not resolve properly via BioPortal's PURL.
# Then upload the files via "Linked Data" -> "Quad Store Upload" tabs in Virtuoso Conductor.
RDF[LPT]="http://data.bioontology.org/ontologies/LPT/download?apikey=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb&download_format=rdf"
RDF[LBO]="http://data.bioontology.org/ontologies/LBO/download?apikey=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb&download_format=rdf"

rm -f ${LOG_FILE}
for name in "${!RDF[@]}"
do
  url="${RDF_PROXY}?url=${RDF[$name]}&sponger:get=add"
  echo "[$(date +'%d/%b/%Y %T')] Sponging '$name' ontology into Virtuoso RDF Quad Store via '${url}'..." >> ${LOG_FILE}
  curl -Ss -I -H "Accept: application/rdf+xml" "$url" &>> ${LOG_FILE}
done
{'fraction_non_alphanumeric': 0.1834698966868543, 'fraction_numerical': 0.03918774492340577, 'mean_word_length': 5.396355353075171, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '313386', 'n_tokens_mistral': 1272, 'n_tokens_neox': 1185, 'n_words': 202}