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

Misc small SqlImplementation issues #294

Open
5 tasks
joeflack4 opened this issue Sep 23, 2022 · 1 comment
Open
5 tasks

Misc small SqlImplementation issues #294

joeflack4 opened this issue Sep 23, 2022 · 1 comment

Comments

@joeflack4
Copy link
Contributor

I was going to make an issue about having a problem with SqlImplementation.entities() not getting any entities and producing errors, but I think I'm having more general problems with SqlImplementation.

My version: oaklib==0.1.23
edit: I realize now that this is outdated. I fixed that on my end. I will need to re-run and see if still empty.

Sub-issue list

Checked means fixed.

  • 1. Orphan .template.db.tmp
  • 2. Unsquelched stdout
  • 3. Unhandled error: missing local file
  • 4. Interactive sqlite session when running Python script from makefile
  • 5. .entities() returns nothing

Sub-issues

1. Orphan .template.db.tmp

I think that it hung at some point; possibly related to issue (4) below. I think that when I terminated, OAK did not exit gracefully and delete this temp file from the directory where I called.

This still applies to 0.2.0, when using OAK or semsql separately.

Related: INCATools/semantic-sql#47

2. Unsquelched stdout

Last tried version: 0.1.23
I don't know if this is useful to some users. I'd prefer not seeing it by default.

What I ran
From Python:

ontology = SqlImplementation(OntologyResource(slug='mondo-ingest/src/ontology/components/omim.owl', local=True))

Output

cat /Users/joeflack4/virtualenvs/mondo-ingest/lib/python3.9/site-packages/semsql/builder//sql_schema/semsql.sql | sqlite3 .template.db.tmp && \
	echo .exit | sqlite3 -echo .template.db.tmp -cmd ".mode csv" -cmd ".import /Users/joeflack4/virtualenvs/mondo-ingest/lib/python3.9/site-packages/semsql/builder//prefixes/prefixes.csv prefix" && \
	mv .template.db.tmp .template.db
.exit
robot remove -i components/omim.owl --axioms "equivalent disjoint annotation" -o components/omim-min.owl
relation-graph --disable-owl-nothing true \
                       --ontology-file components/omim-min.owl\
                       --output-file components/omim-relation-graph.tsv.ttl.tmp \
                       --equivalence-as-subclass true \
	               --output-subclasses true \
                       --reflexive-subclasses true && \

Possible solutions
Add a bool argument verbose to the necessary super / interface classes, defaulting to False. Can then connect this to the CLI with a --verbose option.

3. Unhandled error: missing local file

I ran Python from my IDE:

ontology = SqlImplementation(OntologyResource(slug='components/omim.owl', local=True))

But I think it had the wrong working directory at first, and I got this error:

make: *** No rule to make target components/omim.db'. Stop.`

Suggestion:
Handle this exception and instead show something like:

FileNotFoundError: 'components/omim.owl'

4. Interactive sqlite session when running Python script from makefile

My Python script got ran from a makefile. I believe that this is the line which triggered the following terminal output:

ontology = SqlImplementation(OntologyResource(slug='components/omim.owl', local=True))

Terminal output:

/usr/local/lib/python3.10/dist-packages/rdflib_jsonld/__init__.py:9: DeprecationWarning: The rdflib-jsonld package has been integrated into rdflib as of rdflib==6.0.0.  Please remove rdflib-jsonld from your project's dependencies.
  warnings.warn(
make[1]: Entering directory '/work/src/ontology'
cat /usr/local/lib/python3.10/dist-packages/semsql/builder//sql_schema/semsql.sql | sqlite3 .template.db.tmp && \
sqlite3 -echo .template.db.tmp -cmd ".mode csv" -cmd ".import /usr/local/lib/python3.10/dist-packages/semsql/builder//prefixes/prefixes.csv prefix" -cmd ".exit" && \
mv .template.db.tmp .template.db
SQLite version 3.37.2 2022-01-06 13:25:41
Enter ".help" for usage hints.
sqlite>

This may be related to my issue (1) above. I think when I quit this, it may have left remnants of some temp DB file, but I'm not sure.

Also at some point, my terminal froze, and I tried CTRL+D plus like 7 other ways to try to kill the process, but I couldn't terminate and ultimately had to close the window. It may have been related to this issue; not sure.

5. .entities() returns nothing

This was the case for 0.1.23. I haven't tried again using 0.2.0, though I did see that my 0.2.0 DB that was created manually by semsql was not empty.

Related: INCATools/semantic-sql#48

@joeflack4
Copy link
Contributor Author

Still experiencing these issues, so I moved them over from #90 to this new issue.

@joeflack4 joeflack4 changed the title Misc SqlImplementation issues Misc small SqlImplementation issues Nov 15, 2023
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

1 participant