def findOWLClass(graph,uri): """ Returns a class object (using eltk's metaclasses) based on a given URI :param graph: the context graph :type graph: rdflib.Graph.Graph :param uri: a URI for some class :type uri: rdflib.URIRef.URIRef :rtype: eltk.kb.Meta.OWLClass """ #create the class cls = OWLClass.new(uri) #call various SPARQL functions # #for superclasses cls.bases = getBaseClasses(graph,uri) # #for subclasses cls.subclasses = getSubClasses(graph,uri) # #for class members cls.individuals = getClassIndividuals(graph,uri) return cls
def setUp(self): self.Word=OWLClass.new(u'Wordɖ') self.Root=OWLClass.new(u'http://foo.org#Root') self.RootWord=OWLClass.new(u'RootWord',(self.Word,self.Root)) self.rw1=self.Word(u'myrootword1',[self.Root])