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

Database created is empty #48

Closed
joeflack4 opened this issue Aug 10, 2022 · 3 comments
Closed

Database created is empty #48

joeflack4 opened this issue Aug 10, 2022 · 3 comments

Comments

@joeflack4
Copy link

joeflack4 commented Aug 10, 2022

Overview

I ran: semsql make doid.db, and when I examined the tables, everything except the following tables were empty:

  1. prefix
  2. sqlite_master

I don't think these two tables are specific to the ontology either; I think they are the same for every DB I would create, based on some kind of semsql templating.

Replicating this issue

  1. Have semsql
  2. Download and unzip doid.owl.zip
  3. Run semsql make doid.db from unzipped directory.

Log

pip freeze | grep semsql
semsql==0.2.0
sh run.sh semsql make mirror/doid.db
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
2022.08.10 20:27:14:401 zio-default-async-1 INFO org.renci.relationgraph.Main.program:57
    Running reasoner
2022.08.10 20:27:18:101 zio-default-async-1 INFO org.renci.relationgraph.Main.program:60
    Done running reasoner
2022.08.10 20:27:34:861 zio-default-async-4 INFO org.renci.relationgraph.Main.program:70
    Computed relations in 16.696s
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.
Edit: I also tried 0.2.0 and this happens for that version as well.

Related: Point (5) in this comment of OAK issue 90: empty db.

@joeflack4 joeflack4 changed the title Database Database created is empty Aug 10, 2022
@joeflack4
Copy link
Author

@matentzn FYI

@joeflack4 joeflack4 changed the title Database created is empty Database created is empty (0.1.7) Aug 10, 2022
@joeflack4 joeflack4 changed the title Database created is empty (0.1.7) Database created is empty Aug 10, 2022
@cmungall
Copy link
Collaborator

That's very unusual

Just to be completely sure, can you report the results of this:

sqlite3 mirror/doid.db -cmd "SELECT COUNT(*) FROM statements;"

@joeflack4
Copy link
Author

@cmungall My bad. I'm new to this PyCharm DB browser. It seems that, even after I deleted .template.db, that is the DB that was still somehow opening up when I was double clicking doid.db. The 0 results were consistent with nothing coming back from .entities() (under earlier circumstances), so I felt as if the DB browser was corroborating.

It seems I'm good now.

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

2 participants