Пример #1
0
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)
Пример #2
0
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)
Пример #3
0
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)
Пример #4
0
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)
Пример #5
0
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)
Пример #6
0
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)