Skip to content

Instantly share code, notes, and snippets.

@albertmeronyo
Last active April 23, 2017 10:19
Show Gist options
  • Save albertmeronyo/43b192fc9652ab1147d6 to your computer and use it in GitHub Desktop.
Save albertmeronyo/43b192fc9652ab1147d6 to your computer and use it in GitHub Desktop.
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
@usmanakhtar
Copy link

Hi,

Can you please explain the output of this content file generated by this script?
I know DYLDO dataset..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment