-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from INCATools/additional-sources2
additional sources
- Loading branch information
Showing
11 changed files
with
292 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,7 @@ PREFIX_YAML_PATH = $(PREFIX_DIR)/prefixes.yaml | |
gzip -f $*-$(RGSUFFIX).tsv && \ | ||
cat $(THIS_DIR)/indexes/*.sql | sqlite3 $@.tmp && \ | ||
echo "ALTER TABLE statements ADD COLUMN graph TEXT;" | sqlite3 $@.tmp && \ | ||
(test -d views && find views -maxdepth 1 -name '$(notdir $*)*.sql' -type f -print0 | xargs -0 -I{} sh -c 'sqlite3 [email protected]< "$$1"' sh {} || echo no views ) && \ | ||
mv $@.tmp $@ | ||
.PRECIOUS: %.db | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,14 +4,14 @@ | |
import shutil | ||
import subprocess | ||
from pathlib import Path | ||
from typing import Optional, TextIO | ||
from typing import List, Optional, TextIO | ||
|
||
import requests | ||
from linkml_runtime.loaders import yaml_loader | ||
from sqlalchemy import create_engine | ||
from sqlalchemy.orm import sessionmaker | ||
|
||
from semsql.builder.registry import registry_schema | ||
from semsql.builder.registry import path_to_ontology_registry, registry_schema | ||
from semsql.builder.registry.registry_schema import (CompressionEnum, Makefile, | ||
MakefileRule, Ontology) | ||
from semsql.utils.makefile_utils import makefile_to_string | ||
|
@@ -117,6 +117,27 @@ def connect(owl_file: str): | |
return session | ||
|
||
|
||
def get_postprocessing_steps( | ||
ontology: str, db: str, registry_path: str = None | ||
) -> List[str]: | ||
""" | ||
Get postprocessing steps for an ontology | ||
:param registry_path: | ||
:param ontology: | ||
:return: | ||
""" | ||
if registry_path is None: | ||
registry_path = path_to_ontology_registry() | ||
registry: registry_schema.Registry | ||
registry = yaml_loader.load( | ||
str(registry_path), target_class=registry_schema.Registry | ||
) | ||
# steps = [step.format(ont=ontology, db=db) for step in registry.ontologies.get(ontology, []).post_processing_steps] | ||
steps = registry.ontologies.get(ontology, []) | ||
return steps | ||
|
||
|
||
def compile_registry(registry_path: str, local_prefix_file: TextIO = None) -> str: | ||
""" | ||
Generate makefile content from registry | ||
|
@@ -139,7 +160,7 @@ def compile_registry(registry_path: str, local_prefix_file: TextIO = None) -> st | |
elif ont.zip_extract_file: | ||
command = ( | ||
f"curl -L -s {ont.url} > [email protected] && " | ||
"unzip -p [email protected] {ont.zip_extract_file} " | ||
f"unzip -p [email protected] {ont.zip_extract_file} " | ||
"> [email protected] && rm [email protected]" | ||
) | ||
elif ont.compression: | ||
|
@@ -169,9 +190,8 @@ def compile_registry(registry_path: str, local_prefix_file: TextIO = None) -> st | |
command = "robot merge -i $< -o $@" | ||
else: | ||
command = "cp $< $@" | ||
rule = MakefileRule( | ||
target=target, dependencies=dependencies, commands=[command] | ||
) | ||
commands = [command] | ||
rule = MakefileRule(target=target, dependencies=dependencies, commands=commands) | ||
makefile.rules.append(rule) | ||
if not ont.suppress: | ||
onts.append(ont.id) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,10 +98,24 @@ ontologies: | |
url: https://openenergyplatform.org/ontology/oeo/releases/oeo-full.owl | ||
prefixmap: | ||
OEO: http://openenergy-platform.org/ontology/oeo/OEO_ | ||
taxslim: | ||
url: http://purl.obolibrary.org/obo/ncbitaxon/subsets/taxslim.obo | ||
build_command: "robot convert -i $< -o $@" | ||
goldterms: | ||
url: https://raw.githubusercontent.com/cmungall/gold-ontology/main/gold.owl | ||
build_command: "robot relax -i $< reason -o $@" | ||
prefixmap: | ||
GOLDTERMS: https://w3id.org/gold.path/ | ||
GOLDVOCAB: https://w3id.org/gold.vocab/ | ||
sdgio: | ||
url: https://raw.githubusercontent.com/SDG-InterfaceOntology/sdgio/master/sdgio.owl | ||
prefixmap: | ||
SDGIO: http://purl.unep.org/sdg/SDGIO_ | ||
kin: | ||
url: http://purl.org/ga4gh/kin.owl | ||
build_command: "robot reason -i $< -o $@" | ||
prefixmap: | ||
KIN: "http://purl.org/ga4gh/kin.owl#KIN_" | ||
biovoices: | ||
url: https://zenodo.org/record/5589773/files/ontology.owl?download=1 | ||
build_command: "robot relax -i $< merge -o $@" | ||
|
@@ -110,6 +124,11 @@ ontologies: | |
omop: | ||
prefixmap: | ||
omop: https://athena.ohdsi.org/search-terms/terms/ | ||
comet: | ||
url: https://raw.githubusercontent.com/linkml/linkml-common/main/project/owl/linkml_common.owl.ttl | ||
build_command: "robot relax -i $< merge -o $@" | ||
prefixmap: | ||
comet: https://w3id.org/linkml-common/ | ||
cco: | ||
url: http://www.ontologyrepository.com/CommonCoreOntologies/Mid/AllCoreOntology | ||
build_command: "robot merge -i $< relax -o $@" | ||
|
@@ -166,9 +185,16 @@ ontologies: | |
ito: | ||
url: https://github.com/OpenBioLink/ITO/raw/master/ITO.owl.zip | ||
zip_extract_file: ITO.owl | ||
reactome-Homo-sapiens: | ||
reactome-hs: | ||
url: https://reactome.org/download/current/biopax.zip | ||
zip_extract_file: Homo_sapiens.owl | ||
#post_processing_steps: | ||
# - "sqlite3 {db} < views/reactome.sql" | ||
reactome-mm: | ||
url: https://reactome.org/download/current/biopax.zip | ||
zip_extract_file: Mus_musculus.owl | ||
post_processing_steps: | ||
- "sqlite3 {db} < views/reactome.sql" | ||
efo: | ||
url: http://www.ebi.ac.uk/efo/efo.owl | ||
has_imports: true | ||
|
@@ -327,6 +353,17 @@ ontologies: | |
url: "'https://data.bioontology.org/ontologies/NANDO/submissions/15/download?apikey=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb'" | ||
prefixmap: | ||
NANDO: http://nanbyodata.jp/ontology/NANDO_ | ||
ecso: | ||
url: "'https://data.bioontology.org/ontologies/ECSO/submissions/64/download?apikey=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb'" | ||
prefixmap: | ||
ECSO: http://purl.dataone.org/odo/ECSO_ | ||
enigma_context: | ||
url: https://raw.githubusercontent.com/jmchandonia/CORAL/main/example/enigma/ontologies/context_measurement_ontology.obo | ||
build_command: "robot merge -i $< -o $@" | ||
#meo: | ||
# url: "'https://data.bioontology.org/ontologies/MEO/submissions/9/download?apikey=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb'" | ||
# prefixmap: | ||
# MEO: http://purl.jp/bio/11/meo/MEO_ | ||
ontie: | ||
url: https://ontology.iedb.org/file/ontie.owl | ||
prefixmap: | ||
|
@@ -349,8 +386,8 @@ ontologies: | |
linkml: https://w3id.org/linkml/ | ||
mixs: https://w3id.org/mixs/ | ||
mixs: | ||
url: https://raw.githubusercontent.com/microbiomedata/mixs-6-2-release-candidate/main/schema-derivatives/mixs_6_2_rc.owl.ttl | ||
build_command: "robot merge -i $< reason -o $@.tmp.owl && perl -npe 's@_6_2_rc@@g;s@-6-2-rc@@g' [email protected] > $@" | ||
url: https://raw.githubusercontent.com/GenomicsStandardsConsortium/mixs/main/project/owl/mixs.owl.ttl | ||
build_command: "robot merge -i $< reason -o $@" | ||
prefixmap: | ||
mixs: https://w3id.org/mixs/ | ||
fibo: | ||
|
@@ -363,6 +400,9 @@ ontologies: | |
# BFO variant products | ||
bfo2020: | ||
url: http://purl.obolibrary.org/obo/bfo/2020/bfo.owl | ||
#post_processing_steps: | ||
# - "echo hello {db}" | ||
# - "echo goodbye {db}" | ||
bfo2020_core: | ||
url: http://purl.obolibrary.org/obo/bfo/2020/bfo-core.owl | ||
bfo2020_notime: | ||
|
Oops, something went wrong.