Skip to content

Commit babe37e

Browse files
authored
✨ Add new MDS-Onto and 🐛 bug fixings (PR #303 from sciknoworg/dev)
2 parents ec7b851 + 4207a55 commit babe37e

11 files changed

Lines changed: 237 additions & 93 deletions

File tree

docs/source/benchmarking/benchmark.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ Ontologies related to materials, their structure, properties, processing, and en
250250
materials_science_and_engineering/vimmp.rst
251251
materials_science_and_engineering/oiecharacterisation.rst
252252
materials_science_and_engineering/prima.rst
253+
materials_science_and_engineering/mdsonto.rst
253254

254255
Medicine
255256
==========
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
The Modular Ontology for Materials and Data Science (MDS-Onto)
2+
==============================================================================
3+
4+
.. sidebar::
5+
6+
.. list-table:: **Ontology Card**
7+
:header-rows: 0
8+
9+
* - **Domain**
10+
- Materials Science and Engineering
11+
* - **Category**
12+
- Materials Data Science
13+
* - **Current Version**
14+
- 0.3.1.16
15+
* - **Last Updated**
16+
- 2026-02-03
17+
* - **Creator**
18+
- SDLE Research Center
19+
* - **License**
20+
- CC BY-SA 4.0
21+
* - **Format**
22+
- owl
23+
* - **Download**
24+
- `Download The Modular Ontology for Materials and Data Science (MDS-Onto) <https://cwrusdle.bitbucket.io/files/MDS_Onto/index-en.html>`_
25+
26+
MDS-Onto is a domain (low) level ontology that describes terms in Materials Data Science. It is divided into six large modules: BuiltEnv, Exposure, Chemistry, Manufacture, Characterization, and Geospatial. Under each module, there are multiple sub-modules such as FTIR, AFM, Chem-Rxn, PV-Module, Accelerated Exposure, etc.
27+
28+
Metrics & Statistics
29+
--------------------------
30+
31+
.. tab:: Graph
32+
33+
34+
.. list-table:: Graph Statistics
35+
:widths: 50 50
36+
:header-rows: 0
37+
38+
* - **Total Nodes**
39+
- 4362
40+
* - **Total Edges**
41+
- 13095
42+
* - **Root Nodes**
43+
- 92
44+
* - **Leaf Nodes**
45+
- 2226
46+
::
47+
48+
49+
.. tab:: Coverage
50+
51+
52+
.. list-table:: Knowledge Coverage Statistics
53+
:widths: 50 50
54+
:header-rows: 0
55+
56+
* - **Classes**
57+
- 1710
58+
* - **Individuals**
59+
- 1
60+
* - **Properties**
61+
- 169
62+
63+
::
64+
65+
.. tab:: Hierarchy
66+
67+
68+
.. list-table:: Hierarchical Metrics
69+
:widths: 50 50
70+
:header-rows: 0
71+
72+
* - **Maximum Depth**
73+
- 7
74+
* - **Minimum Depth**
75+
- 0
76+
* - **Average Depth**
77+
- 1.03
78+
* - **Depth Variance**
79+
- 2.01
80+
::
81+
82+
83+
.. tab:: Breadth
84+
85+
86+
.. list-table:: Breadth Metrics
87+
:widths: 50 50
88+
:header-rows: 0
89+
90+
* - **Maximum Breadth**
91+
- 92
92+
* - **Minimum Breadth**
93+
- 1
94+
* - **Average Breadth**
95+
- 25.75
96+
* - **Breadth Variance**
97+
- 1093.94
98+
::
99+
100+
.. tab:: LLMs4OL
101+
102+
103+
.. list-table:: LLMs4OL Dataset Statistics
104+
:widths: 50 50
105+
:header-rows: 0
106+
107+
* - **Term Types**
108+
- 1
109+
* - **Taxonomic Relations**
110+
- 1648
111+
* - **Non-taxonomic Relations**
112+
- 259
113+
* - **Average Terms per Type**
114+
- 1.00
115+
::
116+
117+
Usage Example
118+
-------------
119+
Use the following code to import this ontology programmatically:
120+
121+
.. code-block:: python
122+
123+
from ontolearner.ontology import MDSOnto
124+
125+
ontology = MDSOnto()
126+
ontology.load("path/to/MDSOnto-ontology.owl")
127+
128+
# Extract datasets
129+
data = ontology.extract()
130+
131+
# Access specific relations
132+
term_types = data.term_typings
133+
taxonomic_relations = data.type_taxonomies
134+
non_taxonomic_relations = data.type_non_taxonomic_relations

docs/source/ontologizer/new_ontologies.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ Each ontology class inherits from ``BaseOntology`` and defines:
7171

7272
.. code-block:: python
7373
74-
def _is_anonymous_id(label: str) -> bool:
74+
def _is_anonymous_id(self, label: str) -> bool:
7575
"""Override to handle ontology-specific blank nodes."""
7676
# Check the general patterns from the parent class
77-
if BaseOntology._is_anonymous_id(label):
77+
if supper()._is_anonymous_id(label):
7878
return True
7979
8080
# Add ontology-specific patterns
@@ -141,7 +141,7 @@ You can also access the processed ontology via:
141141
# "ontology_data": ...,
142142
# "documentation": ...
143143
144-
Once this process is done, you might use the `.save_resource` function to check the constructed files and documentations:
144+
Once this process is done, you might use the ``.save_resource`` function to check the constructed files and documentations:
145145

146146
.. code-block:: python
147147

ontolearner/ontology/biology.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,14 @@ class GO(BaseOntology):
7070
format = "OWL"
7171
download_url = "https://geneontology.org/docs/download-ontology/"
7272

73-
@staticmethod
74-
def _is_anonymous_id(label: str) -> bool:
73+
def _is_anonymous_id(self, label: str) -> bool:
7574
"""Override to handle GO-specific blank nodes."""
7675
# Check the general patterns from the parent class
7776
# GO-specific patterns
7877
if label.startswith('GO_'):
7978
return True
8079

81-
if BaseOntology._is_anonymous_id(label):
80+
if super()._is_anonymous_id(label):
8281
return True
8382

8483
return False

ontolearner/ontology/chemistry.py

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ class ChEBI(BaseOntology):
5757
format = "OWL"
5858
download_url = "https://www.ebi.ac.uk/chebi/"
5959

60-
@staticmethod
61-
def _is_anonymous_id(label: str) -> bool:
60+
61+
def _is_anonymous_id(self, label: str) -> bool:
6262
"""Override to handle ChEBI-specific blank nodes."""
6363
# ChEBI-specific patterns
6464
if re.match(r'^CHEBI_[0-9]+$', label):
6565
return True
6666

6767
# Check the general patterns from the parent class
68-
if BaseOntology._is_anonymous_id(label):
68+
if super()._is_anonymous_id(label):
6969
return True
7070

7171
return False
@@ -89,15 +89,15 @@ class CHEMINF(BaseOntology):
8989
format = "OWL"
9090
download_url = "https://terminology.tib.eu/ts/ontologies/CHEMINF"
9191

92-
@staticmethod
93-
def _is_anonymous_id(label: str) -> bool:
92+
93+
def _is_anonymous_id(self, label: str) -> bool:
9494
"""Override to handle CHEMINF-specific blank nodes."""
9595
# ChEBI-specific patterns
9696
if re.match(r'^CHEMINF_[0-9]+$', label):
9797
return True
9898

9999
# Check the general patterns from the parent class
100-
if BaseOntology._is_anonymous_id(label):
100+
if super()._is_anonymous_id(label):
101101
return True
102102

103103
return False
@@ -145,15 +145,15 @@ class ChMO(BaseOntology):
145145
format = "OWL"
146146
download_url = "https://github.com/rsc-ontologies/rsc-cmo"
147147

148-
@staticmethod
149-
def _is_anonymous_id(label: str) -> bool:
148+
149+
def _is_anonymous_id(self, label: str) -> bool:
150150
"""Override to handle ChMO-specific blank nodes."""
151151
# ChEBI-specific patterns
152152
if re.match(r'^CHMO_[0-9]+$', label):
153153
return True
154154

155155
# Check the general patterns from the parent class
156-
if BaseOntology._is_anonymous_id(label):
156+
if super()._is_anonymous_id(label):
157157
return True
158158

159159
return False
@@ -190,15 +190,15 @@ class MassSpectrometry(BaseOntology):
190190
format = "OWL"
191191
download_url = "https://terminology.tib.eu/ts/ontologies/MS"
192192

193-
@staticmethod
194-
def _is_anonymous_id(label: str) -> bool:
193+
194+
def _is_anonymous_id(self, label: str) -> bool:
195195
"""Override to handle MassSpectrometry-specific blank nodes."""
196196
# MassSpectrometry-specific patterns
197197
if re.match(r'^PEFF_[0-9]+$', label):
198198
return True
199199

200200
# Check the general patterns from the parent class
201-
if BaseOntology._is_anonymous_id(label):
201+
if super()._is_anonymous_id(label):
202202
return True
203203

204204
return False
@@ -220,8 +220,7 @@ class MOP(BaseOntology):
220220
format = "OWL"
221221
download_url = "https://terminology.tib.eu/ts/ontologies/MOP"
222222

223-
@staticmethod
224-
def _is_anonymous_id(label: str) -> bool:
223+
def _is_anonymous_id(self, label: str) -> bool:
225224
"""Override to handle MOP-specific blank nodes."""
226225
# MOP-specific patterns
227226
if re.match(r'^MOP_[0-9]+$', label):
@@ -234,7 +233,7 @@ def _is_anonymous_id(label: str) -> bool:
234233
return True
235234

236235
# Check the general patterns from the parent class
237-
if BaseOntology._is_anonymous_id(label):
236+
if super()._is_anonymous_id(label):
238237
return True
239238

240239
return False
@@ -357,8 +356,7 @@ class RXNO(BaseOntology):
357356
format = "OWL"
358357
download_url = "https://github.com/rsc-ontologies/rxno"
359358

360-
@staticmethod
361-
def _is_anonymous_id(label: str) -> bool:
359+
def _is_anonymous_id(self, label: str) -> bool:
362360
"""Override to handle RXNO-specific blank nodes."""
363361
# RXNO-specific patterns
364362
if re.match(r'^RXNO_[0-9]+$', label):
@@ -368,7 +366,7 @@ def _is_anonymous_id(label: str) -> bool:
368366
return True
369367

370368
# Check the general patterns from the parent class
371-
if BaseOntology._is_anonymous_id(label):
369+
if super()._is_anonymous_id(label):
372370
return True
373371

374372
return False

ontolearner/ontology/ecology_environment.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,14 @@ class ENVO(BaseOntology):
3535
format = "OWL"
3636
download_url = "https://obofoundry.org/ontology/envo.html"
3737

38-
@staticmethod
39-
def _is_anonymous_id(label: str) -> bool:
38+
def _is_anonymous_id(self, label: str) -> bool:
4039
"""Override to handle ENVO-specific blank nodes."""
4140
# ENVO-specific patterns
4241
if re.match(r'^PATO_[0-9]+$', label):
4342
return True
4443

4544
# Check the general patterns from the parent class
46-
if BaseOntology._is_anonymous_id(label):
45+
if super()._is_anonymous_id(label):
4746
return True
4847

4948
return False

ontolearner/ontology/general.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,14 @@ class DBpedia(BaseOntology):
5353
format = "OWL"
5454
download_url = "https://wiki.dbpedia.org/"
5555

56-
@staticmethod
57-
def _is_anonymous_id(label: str) -> bool:
56+
def _is_anonymous_id(self, label: str) -> bool:
5857
"""Override to handle DBpedia/Wikidata-specific blank nodes."""
5958
# DBpedia/Wikidata-specific patterns
6059
if re.match(r'^Q[0-9]+$', label):
6160
return True
6261

6362
# Check the general patterns from the parent class
64-
if BaseOntology._is_anonymous_id(label):
63+
if super()._is_anonymous_id(label):
6564
return True
6665

6766
return False
@@ -226,15 +225,14 @@ class UMBEL(BaseOntology):
226225
format = "n3"
227226
download_url = "https://github.com/structureddynamics/UMBEL/tree/master/Ontology"
228227

229-
@staticmethod
230-
def _is_anonymous_id(label: str) -> bool:
228+
def _is_anonymous_id(self, label: str) -> bool:
231229
"""Override to handle UMBEL-specific blank nodes."""
232230
# UMBEL-specific patterns
233231
if re.match(r'^f5295f96ac3e649dcb1740b0d93d3e6c2b[0-9a-f]+$', label): # Long hexadecimal identifiers
234232
return True
235233

236234
# Check the general patterns from the parent class
237-
if BaseOntology._is_anonymous_id(label):
235+
if super()._is_anonymous_id(label):
238236
return True
239237

240238
return False

0 commit comments

Comments
 (0)