-
-
Save usmanakhtar/64a7978f28e0d0554b79e84218a2f77b to your computer and use it in GitHub Desktop.
Dyldo magic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment