@@ -0,0 +1,1277 @@
+import os%0Aimport shutil%0Afrom indra.sources import eidos%0Afrom indra.assemblers.bmi_wrapper import BMIModel%0Afrom indra.assemblers import PysbAssembler%0A%0A%0Adef text_to_stmts(text):%0A    fname = text.replace(' ', '_') + '.jsonld'%0A    if os.path.exists(fname):%0A        ep = eidos.process_json_ld_file(fname)%0A    else:%0A        ep = eidos.process_text(text)%0A        shutil.move('eidos_output.json', fname)%0A    return ep.statements%0A%0A%0Adef make_component_repo(bmi_models):%0A    for m in bmi_models:%0A        m.export_into_python()%0A    comps = %5Bm.make_repository_component() for m in bmi_models%5D%0A    rep_str = '%3Crepository%3E%25s%3C/repository%3E' %25 '%5Cn'.join(comps)%0A    with open('component_repository.xml', 'w') as fh:%0A        fh.write(rep_str)%0A    with open('component_providers.txt', 'w') as fh:%0A        fh.write('model0 model0%5Cnmodel1 model1')%0A%0A%0A%0Aif __name__ == '__main__':%0A    model_txts = %5B'rainfall causes floods', 'floods cause displacement'%5D%0A    stmts = %5Btext_to_stmts(t) for t in model_txts%5D%0A    bmi_models = %5B%5D%0A    for idx, model_stmts in enumerate(stmts):%0A        pa = PysbAssembler()%0A        pa.add_statements(model_stmts)%0A        model = pa.make_model()%0A        model.name = 'model%25d' %25 idx%0A        bm = BMIModel(model)%0A        bmi_models.append(bm)%0A    make_component_repo(bmi_models)%0A

Add demo example for BMI