Skip to content

Commit fcd6a09

Browse files
committed
updates
1 parent 51d92f7 commit fcd6a09

File tree

8 files changed

+275
-19
lines changed

8 files changed

+275
-19
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ bin/%:
220220
DATE = $(shell date -u +"%Y-%m-%d")
221221

222222
s3-deploy:
223-
aws s3 sync stage s3://bbop-sqlite --acl public-read && \
223+
aws s3 sync stage s3://bbop-sqlite --acl public-read
224+
225+
s3-version:
224226
aws s3 sync stage s3://bbop-sqlite/releases/$(DATE) --acl public-read
225227

226228
s3-deploy-%: stage/%.db.gz

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,10 @@ runoak -i sqlite:envo.owl search t~biome
205205

206206
Even if using OAK, it can be useful to access SQL tables directly to do complex multi-join queries in a performant way.
207207

208+
## Optimization
209+
210+
```bash
211+
poetry run semsql view2table edge --full-index | sqlite3 $db/mydb.db
212+
```
213+
214+
See [indexes](indexes) for some ready-made indexes

ontologies.Makefile

Lines changed: 147 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ db/bcio.owl: download/bcio.owl
153153

154154

155155
download/icd10who.owl: STAMP
156-
curl -L -s https://github.com/monarch-initiative/mondo-ingest/releases/download/v2023-04-05/icd10who.owl > $@.tmp
156+
curl -L -s https://github.com/monarch-initiative/mondo-ingest/releases/latest/download/icd10who.owl > $@.tmp
157157
sha256sum -b $@.tmp > $@.sha256
158158
mv $@.tmp $@
159159

@@ -163,6 +163,39 @@ db/icd10who.owl: download/icd10who.owl
163163
cp $< $@
164164

165165

166+
download/ordo.owl: STAMP
167+
curl -L -s https://github.com/monarch-initiative/mondo-ingest/releases/latest/download/ordo.owl > $@.tmp
168+
sha256sum -b $@.tmp > $@.sha256
169+
mv $@.tmp $@
170+
171+
.PRECIOUS: download/ordo.owl
172+
173+
db/ordo.owl: download/ordo.owl
174+
cp $< $@
175+
176+
177+
download/gard.owl: STAMP
178+
curl -L -s https://github.com/monarch-initiative/mondo-ingest/releases/latest/download/gard.owl > $@.tmp
179+
sha256sum -b $@.tmp > $@.sha256
180+
mv $@.tmp $@
181+
182+
.PRECIOUS: download/gard.owl
183+
184+
db/gard.owl: download/gard.owl
185+
cp $< $@
186+
187+
188+
download/mondo-ingest.owl: STAMP
189+
curl -L -s https://github.com/monarch-initiative/mondo-ingest/releases/latest/download/mondo-ingest.owl > $@.tmp
190+
sha256sum -b $@.tmp > $@.sha256
191+
mv $@.tmp $@
192+
193+
.PRECIOUS: download/mondo-ingest.owl
194+
195+
db/mondo-ingest.owl: download/mondo-ingest.owl
196+
cp $< $@
197+
198+
166199
download/oeo.owl: STAMP
167200
curl -L -s http://openenergy-platform.org/ontology/oeo/ > $@.tmp
168201
sha256sum -b $@.tmp > $@.sha256
@@ -174,6 +207,17 @@ db/oeo.owl: download/oeo.owl
174207
cp $< $@
175208

176209

210+
download/biovoices.owl: STAMP
211+
curl -L -s https://zenodo.org/record/5589773/files/ontology.owl?download=1 > $@.tmp
212+
sha256sum -b $@.tmp > $@.sha256
213+
mv $@.tmp $@
214+
215+
.PRECIOUS: download/biovoices.owl
216+
217+
db/biovoices.owl: download/biovoices.owl
218+
robot relax -i $< merge -o $@
219+
220+
177221
download/omop.owl: STAMP
178222
curl -L -s None > $@.tmp
179223
sha256sum -b $@.tmp > $@.sha256
@@ -185,6 +229,28 @@ db/omop.owl: download/omop.owl
185229
cp $< $@
186230

187231

232+
download/occo.owl: STAMP
233+
curl -L -s https://raw.githubusercontent.com/Occupation-Ontology/OccO/main/src/ontology/occo-merged.owl > $@.tmp
234+
sha256sum -b $@.tmp > $@.sha256
235+
mv $@.tmp $@
236+
237+
.PRECIOUS: download/occo.owl
238+
239+
db/occo.owl: download/occo.owl
240+
cp $< $@
241+
242+
243+
download/iof.owl: STAMP
244+
curl -L -s https://spec.industrialontologies.org/ontology/AboutIOFProd/ > $@.tmp
245+
sha256sum -b $@.tmp > $@.sha256
246+
mv $@.tmp $@
247+
248+
.PRECIOUS: download/iof.owl
249+
250+
db/iof.owl: download/iof.owl
251+
robot relax -i $< merge -o $@
252+
253+
188254
download/go.owl: STAMP
189255
curl -L -s http://purl.obolibrary.org/obo/go/extensions/go-plus.owl > $@.tmp
190256
sha256sum -b $@.tmp > $@.sha256
@@ -438,6 +504,17 @@ db/dbpendiaont.owl: download/dbpendiaont.owl
438504
cp $< $@
439505

440506

507+
download/uberoncm.owl: STAMP
508+
curl -L -s https://github.com/obophenotype/uberon/releases/latest/download/composite-metazoan.owl > $@.tmp
509+
sha256sum -b $@.tmp > $@.sha256
510+
mv $@.tmp $@
511+
512+
.PRECIOUS: download/uberoncm.owl
513+
514+
db/uberoncm.owl: download/uberoncm.owl
515+
cp $< $@
516+
517+
441518
download/co_324.owl: STAMP
442519
curl -L -s https://cropontology.org/ontology/CO_324/rdf > $@.tmp
443520
sha256sum -b $@.tmp > $@.sha256
@@ -449,15 +526,26 @@ db/co_324.owl: download/co_324.owl
449526
cp $< $@
450527

451528

529+
download/ppeo.owl: STAMP
530+
curl -L -s http://purl.org/ppeo/PPEO.owl > $@.tmp
531+
sha256sum -b $@.tmp > $@.sha256
532+
mv $@.tmp $@
533+
534+
.PRECIOUS: download/ppeo.owl
535+
536+
db/ppeo.owl: download/ppeo.owl
537+
cp $< $@
538+
539+
452540
download/interpro.owl: STAMP
453-
curl -L -s https://w3id.org/biopragmatics/resources/interpro/92.0/interpro.obo > $@.tmp
541+
curl -L -s https://w3id.org/biopragmatics/resources/interpro/interpro.obo > $@.tmp
454542
sha256sum -b $@.tmp > $@.sha256
455543
mv $@.tmp $@
456544

457545
.PRECIOUS: download/interpro.owl
458546

459547
db/interpro.owl: download/interpro.owl
460-
robot merge -i $< -o $@
548+
perl -npe 's@go:@GO:@g;s@ro:@RO:@g;s@interpro:@InterPro:@g' $< > $@.tmp && robot convert -i $@.tmp -o $@
461549

462550

463551
download/hgnc.genegroup.owl: STAMP
@@ -603,6 +691,61 @@ db/rxnorm.owl: download/rxnorm.owl
603691
cp $< $@
604692

605693

694+
download/vccf.owl: STAMP
695+
curl -L -s https://raw.githubusercontent.com/obophenotype/vccf-ontology/main/vccf.owl > $@.tmp
696+
sha256sum -b $@.tmp > $@.sha256
697+
mv $@.tmp $@
698+
699+
.PRECIOUS: download/vccf.owl
700+
701+
db/vccf.owl: download/vccf.owl
702+
cp $< $@
703+
704+
705+
download/ontobiotope.owl: STAMP
706+
curl -L -s 'https://data.agroportal.lirmm.fr/ontologies/ONTOBIOTOPE/download?apikey=1de0a270-29c5-4dda-b043-7c3580628cd5&download_format=rdf' > $@.tmp
707+
sha256sum -b $@.tmp > $@.sha256
708+
mv $@.tmp $@
709+
710+
.PRECIOUS: download/ontobiotope.owl
711+
712+
db/ontobiotope.owl: download/ontobiotope.owl
713+
cp $< $@
714+
715+
716+
download/ecosim.owl: STAMP
717+
curl -L -s None > $@.tmp
718+
sha256sum -b $@.tmp > $@.sha256
719+
mv $@.tmp $@
720+
721+
.PRECIOUS: download/ecosim.owl
722+
723+
db/ecosim.owl: download/ecosim.owl
724+
cp $< $@
725+
726+
727+
download/nmdc_schema.owl: STAMP
728+
curl -L -s https://raw.githubusercontent.com/microbiomedata/nmdc-schema/main/project/owl/nmdc.owl.ttl > $@.tmp
729+
sha256sum -b $@.tmp > $@.sha256
730+
mv $@.tmp $@
731+
732+
.PRECIOUS: download/nmdc_schema.owl
733+
734+
db/nmdc_schema.owl: download/nmdc_schema.owl
735+
robot merge -i $< -o $@
736+
737+
738+
download/mixs.owl: STAMP
739+
curl -L -s https://raw.githubusercontent.com/microbiomedata/mixs-6-2-release-candidate/main/schema-derivatives/mixs_6_2_rc.owl.ttl > $@.tmp
740+
sha256sum -b $@.tmp > $@.sha256
741+
mv $@.tmp $@
742+
743+
.PRECIOUS: download/mixs.owl
744+
745+
db/mixs.owl: download/mixs.owl
746+
robot merge -i $< reason -o $@.tmp.owl && perl -npe 's@_6_2_rc@@g;s@-6-2-rc@@g' $@.tmp.owl > $@
747+
748+
606749
download/%.owl: STAMP
607750
curl -L -s http://purl.obolibrary.org/obo/$*.owl > $@.tmp
608751
sha256sum -b $@.tmp > $@.sha256
@@ -613,4 +756,4 @@ download/%.owl: STAMP
613756
db/%.owl: download/%.owl
614757
robot merge -i $< -o $@
615758

616-
EXTRA_ONTOLOGIES = chiro ncit fma maxo foodon chebiplus msio modl phenio comploinc bero aio reacto bcio icd10who oeo omop go go-lego bao orcid cpont biolink biopax enanomapper mlo ito reactome-Homo-sapiens efo hcao hpinternational edam sweetAll lov schema-dot-org prov cellosaurus cosmo fhkb dbpendiaont co_324 interpro hgnc.genegroup hgnc sgd dictybase eccode uniprot rhea swisslipid drugbank drugcentral complexportal drugmechdb rxnorm
759+
EXTRA_ONTOLOGIES = chiro ncit fma maxo foodon chebiplus msio modl phenio comploinc bero aio reacto bcio icd10who ordo gard mondo-ingest oeo biovoices omop occo iof go go-lego bao orcid cpont biolink biopax enanomapper mlo ito reactome-Homo-sapiens efo hcao hpinternational edam sweetAll lov schema-dot-org prov cellosaurus cosmo fhkb dbpendiaont uberoncm co_324 ppeo interpro hgnc.genegroup hgnc sgd dictybase eccode uniprot rhea swisslipid drugbank drugcentral complexportal drugmechdb rxnorm vccf ontobiotope ecosim nmdc_schema mixs

src/semsql/builder/builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ def compile_registry(registry_path: str, local_prefix_file: TextIO = None) -> st
163163
# main build target
164164
target = f"db/{ont.id}.owl"
165165
dependencies = [f"download/{ont.id}.owl"]
166-
if ont.has_imports or (ont.format and ont.format != "rdfxml"):
167-
command = "robot merge -i $< -o $@"
168-
elif ont.build_command:
166+
if ont.build_command:
169167
command = ont.build_command.format(ont=ont)
168+
elif ont.has_imports or (ont.format and ont.format != "rdfxml"):
169+
command = "robot merge -i $< -o $@"
170170
else:
171171
command = "cp $< $@"
172172
rule = MakefileRule(

src/semsql/builder/prefixes/prefixes.csv

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ doap,http://usefulinc.com/ns/doap#
4848
wikidata,http://www.wikidata.org/entity/
4949
schema,https://schema.org/
5050
ICD10CM,http://purl.bioontology.org/ontology/ICD10CM/
51-
ICD10WHO,https://icd.who.int/browse10/2019/en#/
5251
snomedct,http://snomed.info/id/
5352
prefix,base
5453
FMA,http://purl.org/sig/ont/fma/fma
@@ -58,7 +57,17 @@ modl,https://archive.org/services/purl/purl/modular_ontology_design_library#
5857
biolink,https://w3id.org/biolink/vocab/
5958
loinc,https://loinc.org/
6059
BCIO,http://humanbehaviourchange.org/ontology/BCIO_
60+
BCIOR,http://humanbehaviourchange.org/ontology/BCIOR_
61+
icd10who,https://icd.who.int/browse10/2019/en#/
62+
GARD,http://purl.obolibrary.org/obo/GARD_
63+
OMIM,https://omim.org/entry/
64+
OMIMPS,https://www.omim.org/phenotypicSeries/PS
65+
CHR,http://purl.obolibrary.org/obo/CHR_
6166
OEO,http://openenergy-platform.org/ontology/oeo/OEO_
67+
ontorion,http://ontorion.com/namespace#
68+
omop,https://athena.ohdsi.org/search-terms/terms/
69+
OccO,http://purl.obolibrary.org/obo/OccO_
70+
IOFcore,https://spec.industrialontologies.org/ontology/
6271
orcid,https://orcid.org/
6372
evs.ncit,http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#
6473
old.fix,http://purl.org/obo/owl/FIX#
@@ -69,22 +78,30 @@ fhkb,http://owl.cs.manchester.ac.uk/tutorials/fhkb#
6978
dbpediaont,http://dbpedia.org/ontology/
7079
dbpedia,http://dbpedia.org/
7180
co_324,https://cropontology.org/rdf/CO_324:
72-
interpro,http://purl.obolibrary.org/obo/interpro_
81+
PPEO,http://purl.org/ppeo/PPEO.owl#
82+
InterPro,http://purl.obolibrary.org/obo/InterPro_
7383
hgnc.genegroup,http://purl.obolibrary.org/obo/hgnc.genegroup_
7484
hgnc,http://purl.obolibrary.org/obo/hgnc_
7585
SGD,http://purl.obolibrary.org/obo/sgd_
7686
hgnc.genegroup,http://purl.obolibrary.org/obo/dictybase_
7787
EC,http://purl.obolibrary.org/obo/eccode_
7888
uniprot.obo,http://purl.obolibrary.org/obo/uniprot_
7989
uniprot.obo,http://purl.obolibrary.org/obo/uniprot_
80-
rhea,http://purl.obolibrary.org/obo/rhea_
90+
RHEA,http://purl.obolibrary.org/obo/rhea_
8191
uniprot.obo,http://purl.obolibrary.org/obo/uniprot_
8292
swisslipid,http://purl.obolibrary.org/obo/swisslipid_
8393
drugbank,http://purl.obolibrary.org/obo/drugbank_
8494
drugbank,http://purl.obolibrary.org/obo/drugcentral_
8595
complexportal,http://purl.obolibrary.org/obo/complexportal_
8696
MESH,http://id.nlm.nih.gov/mesh/
8797
RXNORM,http://purl.bioontology.org/ontology/RXNORM/
98+
OBT,http://purl.obolibrary.org/obo/OBT_
99+
ECOSIM,http://purl.obolibrary.org/obo/ECOSIM_
100+
ECOSIMCONCEPT,http://purl.obolibrary.org/obo/ECOSIMCONCEPT_
101+
nmdc,https://w3id.org/nmdc/
102+
linkml,https://w3id.org/linkml/
103+
mixs,https://w3id.org/mixs/
104+
mixs,https://w3id.org/mixs/
88105
RBO,http://purl.obolibrary.org/obo/RBO_
89106
RBO,http://purl.obolibrary.org/obo/RBO_
90107
CLYH,http://purl.obolibrary.org/obo/CLYH_

src/semsql/builder/prefixes/prefixes_local.csv

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@ loinc,https://loinc.org/
88
BCIO,http://humanbehaviourchange.org/ontology/BCIO_
99
BCIOR,http://humanbehaviourchange.org/ontology/BCIOR_
1010
icd10who,https://icd.who.int/browse10/2019/en#/
11+
GARD,http://purl.obolibrary.org/obo/GARD_
12+
OMIM,https://omim.org/entry/
13+
OMIMPS,https://www.omim.org/phenotypicSeries/PS
14+
CHR,http://purl.obolibrary.org/obo/CHR_
1115
OEO,http://openenergy-platform.org/ontology/oeo/OEO_
16+
ontorion,http://ontorion.com/namespace#
1217
omop,https://athena.ohdsi.org/search-terms/terms/
18+
OccO,http://purl.obolibrary.org/obo/OccO_
19+
IOFcore,https://spec.industrialontologies.org/ontology/
1320
orcid,https://orcid.org/
1421
evs.ncit,http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#
1522
old.fix,http://purl.org/obo/owl/FIX#
@@ -20,19 +27,27 @@ fhkb,http://owl.cs.manchester.ac.uk/tutorials/fhkb#
2027
dbpediaont,http://dbpedia.org/ontology/
2128
dbpedia,http://dbpedia.org/
2229
co_324,https://cropontology.org/rdf/CO_324:
23-
interpro,http://purl.obolibrary.org/obo/interpro_
30+
PPEO,http://purl.org/ppeo/PPEO.owl#
31+
InterPro,http://purl.obolibrary.org/obo/InterPro_
2432
hgnc.genegroup,http://purl.obolibrary.org/obo/hgnc.genegroup_
2533
hgnc,http://purl.obolibrary.org/obo/hgnc_
2634
SGD,http://purl.obolibrary.org/obo/sgd_
2735
hgnc.genegroup,http://purl.obolibrary.org/obo/dictybase_
2836
EC,http://purl.obolibrary.org/obo/eccode_
2937
uniprot.obo,http://purl.obolibrary.org/obo/uniprot_
3038
uniprot.obo,http://purl.obolibrary.org/obo/uniprot_
31-
rhea,http://purl.obolibrary.org/obo/rhea_
39+
RHEA,http://purl.obolibrary.org/obo/rhea_
3240
uniprot.obo,http://purl.obolibrary.org/obo/uniprot_
3341
swisslipid,http://purl.obolibrary.org/obo/swisslipid_
3442
drugbank,http://purl.obolibrary.org/obo/drugbank_
3543
drugbank,http://purl.obolibrary.org/obo/drugcentral_
3644
complexportal,http://purl.obolibrary.org/obo/complexportal_
3745
MESH,http://id.nlm.nih.gov/mesh/
3846
RXNORM,http://purl.bioontology.org/ontology/RXNORM/
47+
OBT,http://purl.obolibrary.org/obo/OBT_
48+
ECOSIM,http://purl.obolibrary.org/obo/ECOSIM_
49+
ECOSIMCONCEPT,http://purl.obolibrary.org/obo/ECOSIMCONCEPT_
50+
nmdc,https://w3id.org/nmdc/
51+
linkml,https://w3id.org/linkml/
52+
mixs,https://w3id.org/mixs/
53+
mixs,https://w3id.org/mixs/

0 commit comments

Comments
 (0)