def test_all(self): num_axrefs = 0 nk = 0 for i in self.manager.all_individual(): show(i) for f in i.facts_out(): axrefs = f.axiomrefs num_axrefs += len(axrefs) anns = f.annotations if len(anns) > 0: dict = annotations_to_dict(anns) print(str(dict)) nk += len(dict.keys()) self.assertTrue(num_axrefs > 0) self.assertTrue(nk > 0)
def convert(self): o = self._ontology_manager g = nx.DiGraph() self._graph = g for c in o.all_cls(): self.add_node(c) for s in c.superclasses(): self.add_edge(c,s,'subClassOf') for (p,ds) in c.svf_superclass_map().items(): for d in ds: self.add_edge(c,d,p) for i in o.all_individual(): self.add_node(i) for f in i.facts_out(): dict = annotations_to_dict(f.annotations) self.add_edge(f.s, f.o, f.p, dict)
def convert(self): o = self._ontology_manager g = nx.DiGraph() self._graph = g for c in o.all_cls(): self.add_node(c) for s in c.superclasses(): self.add_edge(c, s, 'subClassOf') for (p, ds) in c.svf_superclass_map().items(): for d in ds: self.add_edge(c, d, p) for i in o.all_individual(): self.add_node(i) for f in i.facts_out(): dict = annotations_to_dict(f.annotations) self.add_edge(f.s, f.o, f.p, dict)