#! /bin/bash

uri_file=$1

LOCAL_DIR="./data"
rm -r "./data/rdf"
rm -r "./data/parselog"
mkdir "./data/rdf"
mkdir "./data/parselog"

for domain in `find ./data/uris -type f | sed "s|./data/uris/||"` ; do
	echo "working on domain $domain"
	for u in `cat ./data/uris/$domain | head -500` ;do
		echo "fetching $u"
	   	rapper -g $u 2>> ./data/parselog/$domain.txt > /tmp/viaf.nt
		cat /tmp/viaf.nt >> ./data/rdf/$domain.all.nt
		rapper -g /tmp/viaf.nt  | grep "^<${u}>" >> ./data/rdf/$domain.sfilter.nt 
	done  
done



