Skip to content

Commit

Permalink
SoTeSoLa reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
grammarware committed Jul 21, 2012
1 parent 7a12745 commit 320e975
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions hackathon-reverse/wiki-graph-python/.gitignore
@@ -0,0 +1 @@
wiki
6 changes: 6 additions & 0 deletions hackathon-reverse/wiki-graph-python/Makefile
@@ -0,0 +1,6 @@
all:
rm -rf wiki
git clone git://github.com/SoTeSoLa/SoTeSoLa.wiki.git wiki
./makeGraph.py wiki | sed 's/Home/SoTeSoLa/' > rel.dot
dot -Tpdf rel.dot > rel.pdf
open rel.pdf
15 changes: 15 additions & 0 deletions hackathon-reverse/wiki-graph-python/makeGraph.py
@@ -0,0 +1,15 @@
#! /usr/bin/env python

import os, glob, sys
rel = []
for mw in glob.glob( os.path.join(sys.argv[1], '*.mediawiki') ):
f = open(mw,'r')
m = mw.split('/')[-1].split('.')[0]
m = '-'.join(map(lambda w:w[0].lower()+w[1:],m.split('-')))
m = m[0].upper()+m[1:]
for l in f.read().split('[[')[1:]:
r = l.split(']]')[0].split('|')[0].replace(' ','-')
r = r[0].upper()+r[1:]
if (m,r) not in rel: rel.append((m,r))
f.close()
print 'digraph Relation { node [shape=box]'+'\n'.join('"%s" -> "%s"' % (m,v) for (m,v) in rel)+'}'
22 changes: 22 additions & 0 deletions hackathon-reverse/wiki-graph-python/rel.dot
@@ -0,0 +1,22 @@
digraph Relation { node [shape=box]"Community-resources" -> "Research"
"Community-resources" -> "LinkedData"
"Data-driven" -> "Reverse-engineering"
"Folksonomy" -> "Research"
"Folksonomy" -> "LinkedData"
"SoTeSoLa" -> "Reverse-engineering"
"SoTeSoLa" -> "Re-engineering"
"SoTeSoLa" -> "Research"
"SoTeSoLa" -> "LinkedData"
"SoTeSoLa" -> "Community-resources"
"SoTeSoLa" -> "Folksonomy"
"SoTeSoLa" -> "Data-driven"
"SoTeSoLa" -> "Megamodeling"
"LinkedData" -> "Research"
"LinkedData" -> "Community-resources"
"LinkedData" -> "Reverse-engineering"
"Megamodeling" -> "Community-resources"
"Megamodeling" -> "Folksonomy"
"Re-engineering" -> "Reverse-engineering"
"Research" -> "LinkedData"
"Reverse-engineering" -> "Re-engineering"
"Reverse-engineering" -> "LinkedData"}
Binary file added hackathon-reverse/wiki-graph-python/rel.pdf
Binary file not shown.

0 comments on commit 320e975

Please sign in to comment.