def populate_test_kb(connstring=None): ''' Create some testing KB classes and object on the NotreDAM database ''' if connstring is None: connstring = notredam_connstring() kb_test.test_create_object_classes(connstring) kb_test.test_create_derived_classes(connstring) kb_test.test_create_derived_class_objects(connstring)
def init_notredam_kb(connstring=None): ''' Initialize the knowledge base assuming that it is going to populate a NotreDAM database ''' if connstring is None: connstring = notredam_connstring() s = schema.Schema() s.init_db(connstring)
def preinit_notredam_kb(connstring=None): ''' Create knowledge base tables which are required *before* creating Django tables ''' if connstring is None: connstring = notredam_connstring() # The 'object' table is also used by Django's models.Object, which # only references some columns. Thus, we need to create the # complete table here --- and all the tables it depends from # FIXME: try to maintain schema isolation s = schema.Schema() tables = [s.class_t, s.object_t] s.create_tables(connstring, tables)