Esempio n. 1
0
 def setup(self):
     super(TestOntologyTool, self).setup()
     # ot => OntologyTool
     self.ot = OntologyTool(u"_sanity_check_ns")
     # Add a couple keywords to this other namespace in the
     # hope that this will make it easier to catch problems
     # involving code which ignores the namespace
     self.keyword_new(description=u"In the sanity check NS.")
     self.keyword_new(name=u"testKW2",
                      description=u"In the sanity check NS.")
     self.ot.namespace = u"testNS"
Esempio n. 2
0
 def setup(self):
     super(TestDotTool, self).setup()
     self.ot = OntologyTool(u'gv_test_ns')
     self.gc = GraphChecker()
Esempio n. 3
0
File: owl.py Progetto: nsi-iff/pyOLS
    for rel in oi.getRelations():
        ot.addRelation(**rel)
    db.flush()

    for kw in oi.getKeywords():
        ot.addKeyword(**kw)
    db.flush()

    for kwr in oi.getKeywordRelationshps():
        ot.addKeywordRelationship(*kwr)
    db.flush()

if __name__ == "__main__":
    # This is a bit of simple test code because I don't want to formalize
    # any unit tests before the input format is decided upon
    from pyols.tests import setup_test_db
    from pyols.api import OntologyTool
    from pyols import graphviz
    from pyols.model import *
    from pyols.config import config

    setup_test_db()
    ot = OntologyTool(u"foo")
    ot.importOWL(open("../doc/beer.owl").read())

    config['graphviz_path'] = '/usr/bin/'
    open("/tmp/x.png", "w").write(ot.getOntologyGraph().data)

    print ot.exportOWL()