-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakeLinks.sh
More file actions
executable file
·20 lines (14 loc) · 840 Bytes
/
Copy pathmakeLinks.sh
File metadata and controls
executable file
·20 lines (14 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
LINK=`curl https://www.mpi-inf.mpg.de/departments/databases-and-information-systems/research/yago-naga/yago/downloads/ | egrep -o "http://resources.mpi-inf.mpg.de/yago-naga/yago([0-9]{1,}\.)+[0-9]{1,}/yagoDBpediaInstances.ttl.7z"`
curl -O "$LINK"
OUT=yago_links.nt
#DEBUG
FILESIZE7Z=$(stat -c%s ./yagoDBpediaInstances.ttl.7z)
echo "file size of yagoDBpediaInstances.ttl.7z = $FILESIZE7Z b"
#
7za e -so -bd yagoDBpediaInstances.ttl.7z 2>/dev/null | grep sameAs | awk -F " " '{ gsub( /\\\\/,"\\",$3) gsub( /\\u00/,"%",$3) sub(/</,"<http://yago-knowledge.org/resource/",$1) gsub(/\\u00/,"%",$1); print $3 " <http://www.w3.org/2002/07/owl#sameAs> " $1 " ."}' | grep -v '\\' |sort -u > $OUT
#DEBUG
FILESIZE_ASCII=$(stat -c%s ./yago_links.nt)
echo "file size of $OUT = $FILESIZE_ASCII b"
#
rm yagoDBpediaInstances.ttl.7z