Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 77 lines (65 sloc) 1.37 KB
#!/bin/bash
# This sets SIZES
. ./init
DIRS="${SIZES:-50k 250k 1m 5m 25m 100m 200m}"
echo "== Loading: $DIRS"
#LOADER=tdbloader2
LOADER=tdbloader
JENADB=TDB-DB
[ -d "$JENADB" ] || { echo "Not a directory: $JENADB" ; exit 1 ; }
# Check
OK='yes'
for d in $DIRS
do
SET="$DATADIR/data-$d"
if [ ! -e "$SET/data.nt" -a ! -e "$SET/data.nt.gz" ]
then
echo "No data for $SET"
OK='no'
continue
fi
DB="$JENADB/DB-$d"
if [ ! -e "$DB" ] ; then
mkdir -p "$DB"
fi
LOC="$DB/Store"
if [ -e "$LOC" ]
then
echo "** already exists : $LOC"
OK='no'
continue
fi
done
if [ $OK != "yes" ]
then
exit 1
fi
# Load
for d in $DIRS
do
SET="$DATADIR/data-$d"
echo "==== Load data : $SET"
DB="$JENADB/DB-$d"
LOC="$DB/Store"
rm -rf $LOC
mkdir -p "$LOC"
echo "== Load ($d)"
if [ -e "$SET/data.nt" ] ; then
echo "== Load from $SET/data.nt"
$LOADER --loc "$LOC" "$SET/data.nt"
elif [ -e "$SET/data.nt.gz" ] ; then
echo "== Load from $SET/data.nt.gz"
$LOADER --loc "$LOC" "$SET/data.nt.gz"
else
echo "No data.nt or data.nt.gz for $SET"
continue
fi
if [ ! -e "$LOC/stats.opt" ]
then
echo "== Stats ($d)"
tdbstats --loc "$LOC" > stats.opt
mv stats.opt "$LOC"
fi
echo "== Assembler ($d)"
sed -e "s/SIZE/$d/" assembler-template.ttl > "$DB/assembler.ttl"
done