Skip to content

Commit 5f10da2

Browse files
authored
Merge pull request #75 from INCATools/additional-sources
Additional sources
2 parents 84fe170 + ea764b1 commit 5f10da2

9 files changed

Lines changed: 599 additions & 919 deletions

File tree

ontologies.Makefile

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,17 @@ db/bcio.owl: download/bcio.owl
152152
cp $< $@
153153

154154

155+
download/icd10who.owl: STAMP
156+
curl -L -s https://github.com/monarch-initiative/mondo-ingest/releases/download/v2023-04-05/icd10who.owl > $@.tmp
157+
sha256sum -b $@.tmp > $@.sha256
158+
mv $@.tmp $@
159+
160+
.PRECIOUS: download/icd10who.owl
161+
162+
db/icd10who.owl: download/icd10who.owl
163+
cp $< $@
164+
165+
155166
download/oeo.owl: STAMP
156167
curl -L -s http://openenergy-platform.org/ontology/oeo/ > $@.tmp
157168
sha256sum -b $@.tmp > $@.sha256
@@ -163,6 +174,17 @@ db/oeo.owl: download/oeo.owl
163174
cp $< $@
164175

165176

177+
download/omop.owl: STAMP
178+
curl -L -s None > $@.tmp
179+
sha256sum -b $@.tmp > $@.sha256
180+
mv $@.tmp $@
181+
182+
.PRECIOUS: download/omop.owl
183+
184+
db/omop.owl: download/omop.owl
185+
cp $< $@
186+
187+
166188
download/go.owl: STAMP
167189
curl -L -s http://purl.obolibrary.org/obo/go/extensions/go-plus.owl > $@.tmp
168190
sha256sum -b $@.tmp > $@.sha256
@@ -306,6 +328,17 @@ db/hcao.owl: download/hcao.owl
306328
cp $< $@
307329

308330

331+
download/hpinternational.owl: STAMP
332+
curl -L -s http://purl.obolibrary.org/obo/hp/hp-international.owl > $@.tmp
333+
sha256sum -b $@.tmp > $@.sha256
334+
mv $@.tmp $@
335+
336+
.PRECIOUS: download/hpinternational.owl
337+
338+
db/hpinternational.owl: download/hpinternational.owl
339+
cp $< $@
340+
341+
309342
download/edam.owl: STAMP
310343
curl -L -s http://edamontology.org/EDAM.owl > $@.tmp
311344
sha256sum -b $@.tmp > $@.sha256
@@ -350,6 +383,17 @@ db/schema-dot-org.owl: download/schema-dot-org.owl
350383
cp $< $@
351384

352385

386+
download/prov.owl: STAMP
387+
curl -L -s http://www.w3.org/ns/prov.owl > $@.tmp
388+
sha256sum -b $@.tmp > $@.sha256
389+
mv $@.tmp $@
390+
391+
.PRECIOUS: download/prov.owl
392+
393+
db/prov.owl: download/prov.owl
394+
cp $< $@
395+
396+
353397
download/cellosaurus.owl: STAMP
354398
curl -L -s https://raw.githubusercontent.com/calipho-sib/cellosaurus/master/cellosaurus.obo > $@.tmp
355399
sha256sum -b $@.tmp > $@.sha256
@@ -372,6 +416,17 @@ db/cosmo.owl: download/cosmo.owl
372416
robot merge -i $< -o $@
373417

374418

419+
download/fhkb.owl: STAMP
420+
curl -L -s None > $@.tmp
421+
sha256sum -b $@.tmp > $@.sha256
422+
mv $@.tmp $@
423+
424+
.PRECIOUS: download/fhkb.owl
425+
426+
db/fhkb.owl: download/fhkb.owl
427+
cp $< $@
428+
429+
375430
download/dbpendiaont.owl: STAMP
376431
curl -L -s https://databus.dbpedia.org/ontologies/dbpedia.org/ontology--DEV/2023.01.03-072003/ontology--DEV_type=parsed.owl > $@.tmp
377432
sha256sum -b $@.tmp > $@.sha256
@@ -427,6 +482,17 @@ db/hgnc.owl: download/hgnc.owl
427482
cp $< $@
428483

429484

485+
download/sgd.owl: STAMP
486+
curl -L -s https://w3id.org/biopragmatics/resources/sgd/sgd.obo > $@.tmp
487+
sha256sum -b $@.tmp > $@.sha256
488+
mv $@.tmp $@
489+
490+
.PRECIOUS: download/sgd.owl
491+
492+
db/sgd.owl: download/sgd.owl
493+
robot merge -i $< -o $@
494+
495+
430496
download/dictybase.owl: STAMP
431497
curl -L -s https://github.com/biopragmatics/obo-db-ingest/raw/main/export/dictybase/dictybase.owl.gz | gzip -dc > $@.tmp
432498
sha256sum -b $@.tmp > $@.sha256
@@ -547,4 +613,4 @@ download/%.owl: STAMP
547613
db/%.owl: download/%.owl
548614
robot merge -i $< -o $@
549615

550-
EXTRA_ONTOLOGIES = chiro ncit fma maxo foodon chebiplus msio modl phenio comploinc bero aio reacto bcio oeo go go-lego bao orcid cpont biolink biopax enanomapper mlo ito reactome-Homo-sapiens efo hcao edam sweetAll lov schema-dot-org cellosaurus cosmo dbpendiaont co_324 interpro hgnc.genegroup hgnc dictybase eccode uniprot rhea swisslipid drugbank drugcentral complexportal drugmechdb rxnorm
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

src/semsql/builder/build.Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ help:
4141

4242
%-min.owl: %.owl
4343
robot \
44-
remove -i $< --axioms "equivalent disjoint annotation" \
44+
remove -i $< --axioms "equivalent disjoint annotation abox type" \
4545
filter --exclude-terms $(THIS_DIR)/exclude-terms.txt \
4646
-o $@
4747

src/semsql/builder/cli.py

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
from itertools import chain, combinations
23

34
import click
45
from linkml_runtime import SchemaView
@@ -10,6 +11,18 @@
1011
from semsql.sqlutils.viewgen import get_viewdef
1112

1213

14+
def powerset(iterable):
15+
"""calculate powerset.
16+
17+
See: https://docs.python.org/3/library/itertools.html#itertools-recipes
18+
19+
>>> powerset([1,2,3])
20+
() (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)
21+
"""
22+
s = list(iterable)
23+
return chain.from_iterable(combinations(s, r) for r in range(len(s) + 1))
24+
25+
1326
@click.group()
1427
@click.option("-v", "--verbose", count=True)
1528
@click.option("-q", "--quiet")
@@ -100,19 +113,30 @@ def query(input, query):
100113

101114
@main.command()
102115
@click.argument("views", nargs=-1)
103-
@click.option("--index/--no-index", default=True, help="Create indexes on each column")
116+
@click.option(
117+
"--index/--no-index",
118+
default=True,
119+
show_default=True,
120+
help="Create indexes on each column",
121+
)
122+
@click.option(
123+
"--full-index/--no-full-index",
124+
default=False,
125+
show_default=True,
126+
help="Create indexes on all combos of columns (powerset)",
127+
)
104128
@click.option(
105129
"--schema",
106130
"-s",
107131
help="Path o schema (optional)",
108132
)
109-
def view2table(views, schema, index: bool):
133+
def view2table(views, schema, index: bool, full_index: bool):
110134
"""
111135
Generates a command that turns a view into a table
112136
113137
Example usage:
114138
115-
semsql view2table rdfs_label_statement | sqlite3 db/pato.db
139+
semsql view2table rdfs_label_statement --index | sqlite3 db/pato.db
116140
117141
"""
118142
if not schema:
@@ -125,12 +149,18 @@ def view2table(views, schema, index: bool):
125149
if view is not None:
126150
print(f"DROP VIEW {tn};")
127151
print(f"CREATE TABLE {tn} AS {view};")
128-
if index:
129-
for sn in sv.class_slots(cn):
130-
colname = underscore(sn)
152+
if index or full_index:
153+
colnames = [underscore(sn) for sn in sv.class_slots(cn)]
154+
for colname in colnames:
131155
print(f"CREATE INDEX {tn}_{colname} ON {tn}({colname});")
156+
if full_index:
157+
for combo in powerset(colnames):
158+
if len(combo) > 1:
159+
print(
160+
f"CREATE INDEX {tn}_{'_'.join(combo)} ON {tn}({','.join(combo)});"
161+
)
132162
else:
133-
logging.error(f"No view for {cn}")
163+
logging.info(f"No view for {cn}")
134164

135165

136166
if __name__ == "__main__":

src/semsql/builder/prefixes/prefixes.csv

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,16 @@ orcid,https://orcid.org/
6363
evs.ncit,http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#
6464
old.fix,http://purl.org/obo/owl/FIX#
6565
mlo,http://www.a2rd.net.br/mlo#
66+
prov,http://www.w3.org/ns/prov#
67+
cellosaurus,http://purl.obolibrary.org/obo/Cellosaurus#CVCL_
68+
fhkb,http://owl.cs.manchester.ac.uk/tutorials/fhkb#
6669
dbpediaont,http://dbpedia.org/ontology/
6770
dbpedia,http://dbpedia.org/
6871
co_324,https://cropontology.org/rdf/CO_324:
72+
interpro,http://purl.obolibrary.org/obo/interpro_
6973
hgnc.genegroup,http://purl.obolibrary.org/obo/hgnc.genegroup_
7074
hgnc,http://purl.obolibrary.org/obo/hgnc_
75+
SGD,http://purl.obolibrary.org/obo/sgd_
7176
hgnc.genegroup,http://purl.obolibrary.org/obo/dictybase_
7277
EC,http://purl.obolibrary.org/obo/eccode_
7378
uniprot.obo,http://purl.obolibrary.org/obo/uniprot_

src/semsql/builder/prefixes/prefixes_curated.csv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,4 @@ 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/

src/semsql/builder/prefixes/prefixes_local.csv

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,24 @@ modl,https://archive.org/services/purl/purl/modular_ontology_design_library#
66
biolink,https://w3id.org/biolink/vocab/
77
loinc,https://loinc.org/
88
BCIO,http://humanbehaviourchange.org/ontology/BCIO_
9+
BCIOR,http://humanbehaviourchange.org/ontology/BCIOR_
10+
icd10who,https://icd.who.int/browse10/2019/en#/
911
OEO,http://openenergy-platform.org/ontology/oeo/OEO_
12+
omop,https://athena.ohdsi.org/search-terms/terms/
1013
orcid,https://orcid.org/
1114
evs.ncit,http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#
1215
old.fix,http://purl.org/obo/owl/FIX#
1316
mlo,http://www.a2rd.net.br/mlo#
17+
prov,http://www.w3.org/ns/prov#
18+
cellosaurus,http://purl.obolibrary.org/obo/Cellosaurus#CVCL_
19+
fhkb,http://owl.cs.manchester.ac.uk/tutorials/fhkb#
1420
dbpediaont,http://dbpedia.org/ontology/
1521
dbpedia,http://dbpedia.org/
1622
co_324,https://cropontology.org/rdf/CO_324:
17-
InterPro,http://purl.obolibrary.org/obo/interpro_
23+
interpro,http://purl.obolibrary.org/obo/interpro_
1824
hgnc.genegroup,http://purl.obolibrary.org/obo/hgnc.genegroup_
1925
hgnc,http://purl.obolibrary.org/obo/hgnc_
26+
SGD,http://purl.obolibrary.org/obo/sgd_
2027
hgnc.genegroup,http://purl.obolibrary.org/obo/dictybase_
2128
EC,http://purl.obolibrary.org/obo/eccode_
2229
uniprot.obo,http://purl.obolibrary.org/obo/uniprot_

src/semsql/builder/registry/ontologies.yaml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,18 @@ ontologies:
5858
url: http://humanbehaviourchange.org/ontology/bcio.owl
5959
prefixmap:
6060
BCIO: http://humanbehaviourchange.org/ontology/BCIO_
61+
BCIOR: http://humanbehaviourchange.org/ontology/BCIOR_
62+
icd10who:
63+
url: https://github.com/monarch-initiative/mondo-ingest/releases/download/v2023-04-05/icd10who.owl
64+
prefixmap:
65+
icd10who: https://icd.who.int/browse10/2019/en#/
6166
oeo:
6267
url: http://openenergy-platform.org/ontology/oeo/
6368
prefixmap:
6469
OEO: http://openenergy-platform.org/ontology/oeo/OEO_
70+
omop:
71+
prefixmap:
72+
omop: https://athena.ohdsi.org/search-terms/terms/
6573
go:
6674
url: http://purl.obolibrary.org/obo/go/extensions/go-plus.owl
6775
go-lego:
@@ -104,6 +112,8 @@ ontologies:
104112
has_imports: true
105113
hcao:
106114
url: https://raw.githubusercontent.com/HumanCellAtlas/ontology/master/hcao.owl
115+
hpinternational:
116+
url: http://purl.obolibrary.org/obo/hp/hp-international.owl
107117
edam:
108118
url: http://edamontology.org/EDAM.owl
109119
sweetAll:
@@ -118,17 +128,32 @@ ontologies:
118128
compression: gzip
119129
schema-dot-org:
120130
url: https://schema.org/version/latest/schemaorg-current-https.rdf
131+
prov:
132+
url: http://www.w3.org/ns/prov.owl
133+
prefixmap:
134+
prov: "http://www.w3.org/ns/prov#"
135+
#qudtunit:
136+
# url: http://qudt.org/2.1/vocab/unit
137+
# prefixmap:
138+
# qudtunit: http://qudt.org/2.1/vocab/unit/
121139
cellosaurus:
122140
url: https://raw.githubusercontent.com/calipho-sib/cellosaurus/master/cellosaurus.obo
123141
format: obo
142+
prefixmap:
143+
cellosaurus: http://purl.obolibrary.org/obo/Cellosaurus#CVCL_
124144
cosmo:
125145
url: https://micra.com/COSMO/COSMO.owl
126146
has_imports: true
147+
fhkb:
148+
prefixmap:
149+
fhkb: http://owl.cs.manchester.ac.uk/tutorials/fhkb#
127150
dbpendiaont:
128151
url: "https://databus.dbpedia.org/ontologies/dbpedia.org/ontology--DEV/2023.01.03-072003/ontology--DEV_type=parsed.owl"
129152
prefixmap:
130153
dbpediaont: http://dbpedia.org/ontology/
131154
dbpedia: http://dbpedia.org/
155+
#sdtm:
156+
# url: https://evs.nci.nih.gov/ftp1/CDISC/SDTM/SDTM%20Terminology.OWL.zip
132157
#empathi:
133158
# url: https://raw.githubusercontent.com/shekarpour/empathi.io/master/empathi.owl
134159
# format: owlx
@@ -149,7 +174,7 @@ ontologies:
149174
url: https://w3id.org/biopragmatics/resources/interpro/92.0/interpro.obo
150175
format: obo
151176
prefixmap:
152-
InterPro: http://purl.obolibrary.org/obo/interpro_
177+
interpro: http://purl.obolibrary.org/obo/interpro_
153178
hgnc.genegroup:
154179
url: https://github.com/biopragmatics/obo-db-ingest/raw/main/export/hgnc.genegroup/hgnc.genegroup.owl.gz
155180
compression: gzip
@@ -160,6 +185,11 @@ ontologies:
160185
compression: gzip
161186
prefixmap:
162187
hgnc: http://purl.obolibrary.org/obo/hgnc_
188+
sgd:
189+
url: https://w3id.org/biopragmatics/resources/sgd/sgd.obo
190+
format: obo
191+
prefixmap:
192+
SGD: http://purl.obolibrary.org/obo/sgd_
163193
dictybase:
164194
url: https://github.com/biopragmatics/obo-db-ingest/raw/main/export/dictybase/dictybase.owl.gz
165195
compression: gzip

0 commit comments

Comments
 (0)