Skip to content

Commit 3bdded9

Browse files
committed
ito
1 parent 5905e18 commit 3bdded9

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

ontologies.Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ db/enanomapper.owl: STAMP
3131
db/mlo.owl: STAMP
3232
robot merge -I https://raw.githubusercontent.com/berkeleybop/artificial-intelligence-ontology/main/external/ml-ontology-202010021305.owl -o $@
3333

34+
db/ito.owl: STAMP
35+
curl -L -s https://github.com/OpenBioLink/ITO/raw/master/ITO.owl.zip > $@.tmp && unzip -p $@.tmp ITO.owl > $@.tmp2 && mv $@.tmp2 $@ && rm $@.tmp
36+
3437
db/efo.owl: STAMP
3538
robot merge -I http://www.ebi.ac.uk/efo/efo.owl -o $@
3639

@@ -52,4 +55,4 @@ db/cosmo.owl: STAMP
5255
db/co_324.owl: STAMP
5356
curl -L -s https://cropontology.org/ontology/CO_324/rdf > $@.tmp && mv $@.tmp $@
5457

55-
EXTRA_ONTOLOGIES = msio phenio bero aio reacto go-lego bao biolink biopax enanomapper mlo efo edam sweetAll lov schema-dot-org cosmo co_324
58+
EXTRA_ONTOLOGIES = msio phenio bero aio reacto go-lego bao biolink biopax enanomapper mlo ito efo edam sweetAll lov schema-dot-org cosmo co_324

src/semsql/builder/builder.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ def compile_registry(registry_path: str, local_prefix_file: TextIO = None) -> st
125125
for ont in registry.ontologies.values():
126126
target = f"db/{ont.id}.owl"
127127
dependencies = ["STAMP"]
128-
if ont.has_imports or (ont.format and ont.format != 'rdfxml'):
128+
if ont.zip_extract_file:
129+
command = f"curl -L -s {ont.url} > [email protected] && unzip -p [email protected] {ont.zip_extract_file} > [email protected] && mv [email protected] $@ && rm [email protected]"
130+
elif ont.has_imports or (ont.format and ont.format != 'rdfxml'):
129131
command = f"robot merge -I {ont.url} -o $@"
130132
else:
131133
command = f"curl -L -s {ont.url} > [email protected] && mv [email protected] $@"

src/semsql/builder/registry/ontologies.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ ontologies:
4646
has_imports: true
4747
prefixmap:
4848
mlo: http://www.a2rd.net.br/mlo#
49+
ito:
50+
url: https://github.com/OpenBioLink/ITO/raw/master/ITO.owl.zip
51+
zip_extract_file: ITO.owl
4952
efo:
5053
url: http://www.ebi.ac.uk/efo/efo.owl
5154
has_imports: true

src/semsql/builder/registry/registry_schema.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Auto generated from registry_schema.yaml by pythongen.py version: 0.9.0
2-
# Generation date: 2022-10-15T14:23:31
2+
# Generation date: 2022-10-18T18:20:11
33
# Schema: ontology_registry
44
#
55
# id: https://w3id.org/semsql/registry
@@ -93,6 +93,7 @@ class Ontology(YAMLRoot):
9393
compression: Optional[Union[str, "CompressionEnum"]] = None
9494
suppress: Optional[Union[bool, Bool]] = None
9595
relation_graph_settings: Optional[Union[dict, "RelationGraphConfiguration"]] = None
96+
zip_extract_file: Optional[str] = None
9697

9798
def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
9899
if self._is_empty(self.id):
@@ -130,6 +131,9 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
130131
if self.relation_graph_settings is not None and not isinstance(self.relation_graph_settings, RelationGraphConfiguration):
131132
self.relation_graph_settings = RelationGraphConfiguration(**as_dict(self.relation_graph_settings))
132133

134+
if self.zip_extract_file is not None and not isinstance(self.zip_extract_file, str):
135+
self.zip_extract_file = str(self.zip_extract_file)
136+
133137
super().__post_init__(**kwargs)
134138

135139

@@ -251,6 +255,9 @@ class slots:
251255
slots.prefixmap = Slot(uri=SEMSQL_REGISTRY.prefixmap, name="prefixmap", curie=SEMSQL_REGISTRY.curie('prefixmap'),
252256
model_uri=SEMSQL_REGISTRY.prefixmap, domain=None, range=Optional[Union[Dict[Union[str, PrefixMapPrefix], Union[dict, PrefixMap]], List[Union[dict, PrefixMap]]]])
253257

258+
slots.zip_extract_file = Slot(uri=SEMSQL_REGISTRY.zip_extract_file, name="zip_extract_file", curie=SEMSQL_REGISTRY.curie('zip_extract_file'),
259+
model_uri=SEMSQL_REGISTRY.zip_extract_file, domain=None, range=Optional[str])
260+
254261
slots.named_prefixmaps = Slot(uri=SEMSQL_REGISTRY.named_prefixmaps, name="named_prefixmaps", curie=SEMSQL_REGISTRY.curie('named_prefixmaps'),
255262
model_uri=SEMSQL_REGISTRY.named_prefixmaps, domain=None, range=Optional[Union[str, List[str]]])
256263

src/semsql/builder/registry/registry_schema.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ slots:
5353
multivalued: true
5454
range: PrefixMap
5555
inlined: true
56+
zip_extract_file:
57+
description: file to extract in a zip download
5658
named_prefixmaps:
5759
examples:
5860
- value: '[''sweet'', ''prefixcc'']'
@@ -105,6 +107,7 @@ classes:
105107
- compression
106108
- suppress
107109
- relation_graph_settings
110+
- zip_extract_file
108111
PrefixMap:
109112
slots:
110113
- prefix

0 commit comments

Comments
 (0)