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

SQLite console opens (0.1.7) #46

Open
joeflack4 opened this issue Aug 10, 2022 · 4 comments
Open

SQLite console opens (0.1.7) #46

joeflack4 opened this issue Aug 10, 2022 · 4 comments

Comments

@joeflack4
Copy link

joeflack4 commented Aug 10, 2022

Overview

When using semsql, the SQLite console opens. I need to exit it manually in order for the command to continue. Since this is running in a pipeline that is meant to be automated, I shouldn't use semsql until I can fix this.

Log

Problem beings at sqlite>:

sh [run.sh](http://run.sh/) semsql make mirror/doid.db; beep
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>

relation-graph --disable-owl-nothing true \
                       --ontology-file mirror/doid.owl\
                       --output-file mirror/doid-relation-graph.tsv.ttl.tmp \
                       --equivalence-as-subclass true \
               --output-subclasses true \
                       --reflexive-subclasses true && \
riot --out RDFXML mirror/doid-relation-graph.tsv.ttl.tmp > mirror/doid-relation-graph.tsv.owl.tmp && \
sqlite3 mirror/doid-relation-graph.tsv.db.tmp -cmd ".mode csv" ".import /usr/local/lib/python3.10/dist-packages/semsql/builder//prefixes/prefixes.csv prefix" && \
rdftab mirror/doid-relation-graph.tsv.db.tmp < mirror/doid-relation-graph.tsv.owl.tmp && \
sqlite3 mirror/doid-relation-graph.tsv.db.tmp -cmd '.separator "\t"' -cmd '.header on' "SELECT subject,predicate,object FROM statements " > mirror/doid-relation-graph.tsv.tmp && \
mv mirror/doid-relation-graph.tsv.tmp mirror/doid-relation-graph.tsv && \
rm mirror/doid-relation-graph.tsv.*.tmp
ls
2022.08.10 14:30:55:858 zio-default-async-1 INFO org.renci.relationgraph.Main.program:57
    Running reasoner
2022.08.10 14:31:01:715 zio-default-async-1 INFO org.renci.relationgraph.Main.program:60
    Done running reasoner
2022.08.10 14:31:27:450 zio-default-async-4 INFO org.renci.relationgraph.Main.program:70
    Computed relations in 25.638s
beep
cp .template.db mirror/doid.db.tmp && \
rdftab mirror/doid.db.tmp < mirror/doid.owl && \
sqlite3 mirror/doid.db.tmp -cmd '.separator "\t"' ".import mirror/doid-relation-graph.tsv entailed_edge" && \
gzip mirror/doid-relation-graph.tsv && \
cat /usr/local/lib/python3.10/dist-packages/semsql/builder//indexes/*.sql | sqlite3 mirror/doid.db.tmp && \
mv mirror/doid.db.tmp mirror/doid.db

Additional information

Version: 0.1.7: Using this version because I'm not currently able to use the next highest version, 0.2.0.

I have to exit using Ctrl+D. @hrshdhgd Do you happen to have this issue? Do you know of any other way to exit the SQLite console? Also, this causes a bug if I have a chained command, where my terminal window freezes and I have to close it. For example, I'm doing semsql make mirror/doid.db; beep. The ; beep part makes a sound after running so I know it's done. But if there is a ; or an && and I use Ctrl+D to exit the console, instead of it continuing, my terminal freezes at this point.

@joeflack4
Copy link
Author

@matentzn FYI just wanting to let you know where I'm at.

@hrshdhgd
Copy link
Collaborator

hrshdhgd commented Aug 10, 2022

To be honest, I haven't directly used semsql as a user. We could get together and figure it out if you have time. In terms of not being able to use the latest version. I think it requires an installation of relation-graph which is a project under Chris' org. I have no idea if it is ready for prime time.

@joeflack4
Copy link
Author

@hrshdhgd Yeah, I figured that would be the case for relation-graph. That's a little too involved to install that with the pipeline we have. I think I'll wait until that is automatically installed along with semsql. For now, I'll probably just use ProntoImplementation, since I'm not having any issues with it, rather thanSqlImplementation.

I would meet with you to try to solve this if I could, but I don't have the bandwidth at the moment. Thanks for asking though; maybe in the future.

@matentzn
Copy link
Contributor

@hrshdhgd it seems you are using it in mondo-ingest as a prerequisite to oak matching!

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