Skip to content

Instantly share code, notes, and snippets.

View usmanakhtar's full-sized avatar

Usman A. usmanakhtar

View GitHub Profile
@usmanakhtar
usmanakhtar / dyldo.sh
Created April 23, 2017 10:17 — forked from albertmeronyo/dyldo.sh
Dyldo magic
#!/usr/bin/bash
wget -r -l2 --no-parent -A "data.nq.gz" http://swse.deri.org/dyldo/data/
for d in `ls`; do zcat $d/data.nq.gz | egrep -i "http://www.w3.org/2002/07/owl#Thing|http://www.w3.org/2000/01/rdf-schema#subClassOf|http://www.w3.org/1999/02/22-rdf-syntax-ns#type|http://www.w3.org/2000/01/rdf-schema#label" | gzip > $d/owldata.nq.gz ; done
for d in `ls`; do zcat $d/owldata.nq.gz | rev | cut -d" " -f2 | rev | sort | uniq > $d/owlNG; done
for d in `ls`; do cat $d/owlNG >> totalOWLNG; done
sort totalOWLNG | uniq -c | grep "144 <" | cut -d" " -f8 > totalUniqOWLNG
for d in `ls`; do for i in `seq 1 \`cat totalUniqNG | wc -l\``; do (zcat $d/owldata.nq.gz | grep -e `sed -n "$i{p;q}"` | gzip) > $i/$d-$i.nq.gz ; done; done