#!/bin/bash

# get all variables and functions and mkdirs
source functions.sh

# delete and clone
rm -r $MARVINEXTRACTIONDIR/*
cd marvin-extraction
git clone "https://github.com/dbpedia/extraction-framework.git" $DIEFDIR &>/dev/null
cd $DIEFDIR
# reset the ontology and some files that are changes
mvn clean install 2>&1 | tee $LOGDIR/installDIEF.log


# concat universial props
echo "base-dir=$EXTRACTIONBASEDIR" > $DIEFDIR/core/src/main/resources/universal.properties 
echo "log-dir=$LOGDIR/extraction/" >> $DIEFDIR/core/src/main/resources/universal.properties  
cat $CONFIGDIR/universal.properties.template >> $DIEFDIR/core/src/main/resources/universal.properties 


