I kept getting this error, and I've found some very surprising behaviour.
from owlready2.pymedtermino2 import umls
umls.default_world.set_backend(filename = "/home/username/pymedtermino.sqlite3")
print(umls.get_ontology("http://PYM/").load()["SNOMEDCT_US"][302509004])
# runs correctly; prints: SNOMEDCT_US["302509004"] # Entire heart
but adding an extra import:
from owlready2.pymedtermino2 import umls
from owlready2.pymedtermino2.model import MetaConcept as mc # <- this one here
umls.default_world.set_backend(filename = "/home/username/pymedtermino.sqlite3")
print(umls.get_ontology("http://PYM/").load()["SNOMEDCT_US"][302509004])
# fails with: ValueError: Cannot save existent quadstore in '/home/adam/pymedtermino.sqlite3': File already exists!
# Use a new filename for saving quadstore or, for opening an already existent quadstore, do not create any triple before calling set_backend().
The work around is obvious (put the db load in front of the second import) but there's something odd going on in there.