Statistik RDFDump


#author : Nur Aini Rakhmawati#
#twitter : @nuraini
#Date : 18 October 2012
awk '
{
s=$1
p=$2
o=$3
subj[s]=1
pre[p]=1
obj[o]=1
triple++
if ( match(p,"http://www.w3.org/1999/02/22-rdf-syntax-ns#type")!=0)
{
	entity++
	class[o]=1
	
}
else if(match(o, "^<", obj)!=0 )
	{
		uri++		
	}
else if(match(o, "^_:", obj)!=0 )
		bnode++
else
	literal++
}
END { 
for(no in class) { 
	totalC=totalC+class[no]	
}
for(no in subj) { 
	totalS=totalS+subj[no]	
}
for(no in pre) { 
	totalP=totalP+pre[no]	
}
for(no in obj) { 
	totalO=totalO+obj[no]	
}

printf("Triples %d\n",triple)
printf("Subject %d\n",totalS)
printf("Predicate %d\n",totalP)
printf("Object %d\n",totalO)

printf("class %d\n",totalC)
printf("entity %d\n",entity)
printf("uri %d\n",uri)
printf("literal %d\n",literal)
printf("bnode %d\n",bnode)
}' $1
Iklan
  1. No trackbacks yet.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s