Skip to content

Commit

Permalink
Update semsimian dependency version (#717)
Browse files Browse the repository at this point in the history
* Update semsimian dependency version

* updated toml file

* updated toml file

* Added mock test to address absense of `classes` in  bioportal implementation
  • Loading branch information
hrshdhgd authored Mar 18, 2024
1 parent a519291 commit 5dcedf5
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 41 deletions.
74 changes: 37 additions & 37 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ kgcl-schema = "^0.6.5"

funowl = ">=0.2.0"
gilda = {version = ">=1.0.0", optional = true}
semsimian = {version = ">=0.1.0", optional = true}
semsimian = {version = ">=0.2.15", optional = true}
kgcl-rdflib = "0.5.0"
llm = {version = "*", optional = true}
aiohttp = {version = "*", optional = true}
Expand Down
31 changes: 28 additions & 3 deletions tests/test_implementations/test_bioportal.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import itertools
import logging
import unittest
from unittest import mock

from linkml_runtime.dumpers import yaml_dumper
from oaklib.implementations.ontoportal.bioportal_implementation import (
Expand Down Expand Up @@ -75,11 +76,35 @@ def test_ontology_versions(self):
self.assertIn("5.0.0", versions)
self.assertIn("v3.2.1", versions)

def test_ontology_metadata(self):
@mock.patch("oaklib.implementations.ontoportal.bioportal_implementation.BioPortalImplementation")
def test_ontology_metadata(self, mock_impl):
mock_impl.return_value = {
"id": "OBI",
"title": "Ontology for Biomedical Investigations",
"hasOntologyLanguage": "OWL",
"released": "2024-01-22T18:11:12-08:00",
"creationDate": "2024-01-22T18:11:18-08:00",
"homepage": "http://purl.obolibrary.org/obo/obi",
"publication": "http://purl.obolibrary.org/obo/obi/Technical_Reports",
"documentation": "http://purl.obolibrary.org/obo/obi/wiki",
"version": "2024-01-09",
"description": 'OBI is an ontology of investigations, the protocols and instrumentation used,\
the material used, the data generated and the types of analysis performed on it.\
<br><br>\r\nTo import,<br>\r\nLatest version:\
<a href="http://purl.obolibrary.org/obo/obi.owl">http://purl.obolibrary.org/obo/obi.owl</a><br>\
\r\n<br>\r\nLatest release notes at <a href="http://purl.obolibrary.org/obo/obi/release-notes.html">\
http://purl.obolibrary.org/obo/obi/release-notes.html</a><br>\r\n<br>\r\nNote: BFO 2.0 pre-Graz\
release (not official release version) was used in this release.',
"status": "production",
"submissionId": 53,
"submission_uri": "https://data.bioontology.org/ontologies/OBI/submissions/53",
"type": "http://data.bioontology.org/metadata/OntologySubmission",
}
metadata = self.impl.ontology_metadata_map("OBI")
self.assertIn("title", metadata)
self.assertEqual(metadata["title"], "Ontology for Biomedical Investigations")
self.assertIn("homepage", metadata)
self.assertEqual(metadata["homepage"], "http://purl.obolibrary.org/obo/obi")
self.assertIn("classes", metadata)
self.assertIsInstance(metadata["classes"], int)
# ! The following test is commented out because the metadata does not have the "classes" fields any more.
# self.assertIn("classes", metadata)
# self.assertIsInstance(metadata["classes"], int)

0 comments on commit 5dcedf5

Please sign in to comment.