Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot reload Pymedtermino2 Quadstore Non-Exclusively #9

Open
davis-white opened this issue Jul 6, 2021 · 3 comments
Open

Cannot reload Pymedtermino2 Quadstore Non-Exclusively #9

davis-white opened this issue Jul 6, 2021 · 3 comments

Comments

@davis-white
Copy link

Hello, I am working on a project where several processes need to use the Pymedtermino2 submodule concurrently and am having issues on both reloading the quadstore after the initial importation, and also non-exclusively accessing the reloaded quadstore.

When working with the first importation using the following code, everything works perfectly and I can access the database from multiple processes concurrently.

default_world.set_backend(filename = "pym.sqlite3", exclusive=False)
import_umls(umls_path, terminologies = ["ICD10", "SNOMEDCT_US", "CUI"])
default_world.save()
PYM = get_ontology("http://PYM/").load()

My problems start to arise when I am trying to reload the data from the quadstore saved in pym.sqlite3. If I am starting fresh and just imported everything, the following code can be run multiple times from different processes.

if not os.path.exists('pym.sqlite3'):
try:
default_world.set_backend(filename = "pym.sqlite3", exclusive=False)
PYM = get_ontology("http://PYM/").load()
default_world.save()
except:
PYM = World(filename= 'pym.sqlite3', exclusive=False).get_ontology('http://PYM").load()

The try block is placed there since upon the second time calling set_backend in a session, I recieve a ValueError: Cannot save existent quadstore in 'pym.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().

Additionally, I am getting many variations on OperationalError: database is locked whenever I try to access the database repeatedly.

Is there any guidance on what I am doing wrong or are there any possible bugs? Thanks for the help.

@davis-white davis-white changed the title Cannot reload Pymedtermino2 Quadstore Exclusively Cannot reload Pymedtermino2 Quadstore Non-Exclusively Jul 6, 2021
@pseudomonas
Copy link

pseudomonas commented Aug 30, 2021

I'm having the same issue. But this is apparently not the github repository of the package maintainer.
The package mailing list is http://owlready.8326.n8.nabble.com but that's broken. https://bitbucket.org/jibalamy/owlready2/src/master/ is the primary package repository

ETA: aha, the forum URL has been updated on Bitbucket to http://owlready.306.s1.nabble.com (this has not yet propagated to readthedocs etc)

@pseudomonas
Copy link

Did you find any workaround for this issue?

@pwin
Copy link
Owner

pwin commented Aug 31, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants