1. gromgull
  2. old-phd-code

Overview

This is parts of the code used to implement the sub-graph extraction and similarity metrics for my PhD. 

It was initially part of a larger framework of learning modules, I have not tried to distangle it. 

It may not work in it's current form :) 

An example how to setup the clustering is: 

g=rdflib.Graph()

g.load("data/rdf/foaf.rdf")

i=list(set(g.subjects(rdflib.RDF.type, rdflib.URIRef("http://xmlns.com/foaf/0.1/Person"))))

# or by sparql if you have more complicated data
#i=getIndividualsByQuery(SPARQL_PREFIX+' select ?x where { ?x rdf:type ?z. ?z rdfs:subClassOf pimo:Thing }', g)[0]

b=Beowulf()
b.store=g
b.extract=extractDepthLimit
b.preproc=preprocFeatureVector
b.sim=simFeatureVectorSets

b.run(individuals=i)


The Beowulf.run method has some info on getting the results. 

Have fun !

If you happen to use some of this I'd be happy if you cite me: 

@PHDTHESIS{grimnes08,
  author = {G. AA. Grimnes},
  title = {A goal directed learning agent for the Semantic Web},
  school = {University of Aberdeen},
  year = {2009},
  url = {http://www.dfki.uni-kl.de/\~grimnes/papers/grimnes_thesis_final.pdf}
}

Note that several of the methods are not my original ones, so please cite relevant work if you re-use!

- Gunnar
http://gromgull.net