Exemple #1
0
def main(argv):
    ifc_file = ''
    try:
        opts, args = getopt.getopt(argv, "h")
    except getopt.GetoptError:
        print('load_ifc.py <ifc_file>')
        sys.exit(2)
    if opts == ['-h'] or len(args) != 1:
        print('load_ifc.py <ifc_file>')
        sys.exit()
    ifc_file = args[0]
    db_accessor = DBAccessor()
    db_accessor.set_handler(init_handlers(url=ONTO_URL))
    ifc_import = IfcImport(ifc_file, db_accessor=db_accessor)
    ifc_import.execute()
Exemple #2
0
def db_accessor():
    '''Creates a well-configured DBAccessor so as to store elements in the data
     model'''
    accessor = DBAccessor()
    accessor.set_handler(init_handlers())
    return accessor
Exemple #3
0
def init_app(app):
    """Initialize ontology manager"""

    base_url = app.config['ONTOLOGY_BASE_URL']
    db_accessor.set_handler(init_handlers(base_url))