diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index bf860bc..cdda9b0 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -29,6 +29,8 @@ jobs: python-version: 3.x steps: - uses: actions/checkout@v2 + with: + submodules: true - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7264e4c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "tyto/ontologies/sbol-owl3"] + path = tyto/ontologies/sbol-owl3 + url = https://github.com/SynBioDex/sbol-owl3.git +[submodule "tyto/ontologies/sbol-owl"] + path = tyto/ontologies/sbol-owl + url = https://github.com/dissys/sbol-owl.git diff --git a/README.md b/README.md index 648a36a..dfa03fb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ![gh-action badge](https://github.com/SynBioDex/tyto/workflows/CI/badge.svg) ![readthedocs badge](https://readthedocs.org/projects/tyto/badge/) -![Tyto deroepstorffi](./tyto.png "Andaman masked owl") + # Tyto **Take Your Terms from Ontologies (Tyto)** is a lightweight Python tool that makes the semantic web more user-friendly and accessible. @@ -33,9 +33,13 @@ Since these ontology lookup services host hundreds of ontologies, Tyto does not 'http://www.biomodels.net/kisao/KISAO#KISAO_0000029' ``` +### Documentation + +[Documentation on Readthedocs](https://tyto.readthedocs.io/en/latest/index.html) + ### Inference and reasoning -Additionally Tyto supports reasoning and inference over ontology terms. For example, the following evaluates to `True` because the Sequence Ontolgoy categorizes an `inducible_promoter` as a specialized type of `promoter`. +Additionally Tyto supports reasoning and inference over ontology terms. For example, the following evaluates to `True` because the Sequence Ontology categorizes an `inducible_promoter` as a specialized type of `promoter`. ``` >>> tyto.SO.inducible_promoter.is_a(tyto.SO.promoter) True @@ -51,7 +55,7 @@ term1.get_children() ## About our mascot -_Tyto_ is the genus of birds to which owls belong, alluding to the Web Ontology Language (OWL) in which most ontologies are encoded. Tyto's logo is derived from the ``Owl of Minerva''~\cite{owlofminerva} which is licensed under CC BY-SA 4.0. +_Tyto_ is the genus of birds to which owls belong, alluding to the Web Ontology Language (OWL) in which most ontologies are encoded. Tyto's logo is derived from the "Owl of Minerva" which is licensed under CC BY-SA 4.0. ## Acknowledgments diff --git a/setup.py b/setup.py index 5396982..833aa62 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,9 @@ packages=find_packages(), package_data={'tyto': ['ontologies/*.owl', 'ontologies/*.rdf', - 'ontologies/*.ttl']}, + 'ontologies/*.ttl', + 'ontologies/sbol-owl3/sbolowl3.rdf', + 'ontologies/sbol-owl/sbol.rdf']}, include_package_data=True, install_requires=[ 'rdflib>=5.0', diff --git a/test/test_ontology.py b/test/test_ontology.py index de14f7c..45c2aea 100644 --- a/test/test_ontology.py +++ b/test/test_ontology.py @@ -160,6 +160,18 @@ def test_SBO(self): uri = 'https://identifiers.org/SBO:0000241' self.assertEqual(SBO.get_term_by_uri(uri), 'functional entity') +class TestSBOL(unittest.TestCase): + + def test_sbol2(self): + self.assertEqual(SBOL2.inline, 'http://sbols.org/v2#inline') + self.assertEqual(SBOL2.reverseComplement, 'http://sbols.org/v2#reverseComplement') + self.assertEqual(SBOL2.ComponentDefinition, 'http://sbols.org/v2#ComponentDefinition') + + def test_sbol3(self): + self.assertEqual(SBOL3.inline, 'http://sbols.org/v3#inline') + self.assertEqual(SBOL3.reverseComplement, 'http://sbols.org/v3#reverseComplement') + self.assertEqual(SBOL3.Component, 'http://sbols.org/v3#Component') + if __name__ == '__main__': unittest.main() diff --git a/tyto.png b/tyto.png new file mode 100644 index 0000000..b7f80a5 Binary files /dev/null and b/tyto.png differ diff --git a/tyto/__init__.py b/tyto/__init__.py index b4924a5..d56c40b 100644 --- a/tyto/__init__.py +++ b/tyto/__init__.py @@ -5,3 +5,6 @@ from .ncit import NCIT from .om import OM from .ncbi_taxon import NCBITaxon +from .sbol2 import SBOL2 +from .sbol3 import SBOL3 +from .edam import EDAM diff --git a/tyto/edam.py b/tyto/edam.py new file mode 100644 index 0000000..a41d6b1 --- /dev/null +++ b/tyto/edam.py @@ -0,0 +1,7 @@ +from .tyto import Ontology, Ontobee, installation_path, multi_replace + + +EDAM = Ontology(endpoints=[Ontobee], + uri='http://edamontology.org/EDAM.owl') +"""EDAM (EMBRACE Data and Methods) is an ontology of common bioinformatics operations, topics, types of data including identifiers, and formats. EDAM comprises common concepts (shared within the bioinformatics community) that apply to semantic annotation of resources.""" + diff --git a/tyto/ontologies/sbol-owl b/tyto/ontologies/sbol-owl new file mode 160000 index 0000000..d25247a --- /dev/null +++ b/tyto/ontologies/sbol-owl @@ -0,0 +1 @@ +Subproject commit d25247ab99df195642a43f0bbb8c232154b4325d diff --git a/tyto/ontologies/sbol-owl3 b/tyto/ontologies/sbol-owl3 new file mode 160000 index 0000000..1f827fa --- /dev/null +++ b/tyto/ontologies/sbol-owl3 @@ -0,0 +1 @@ +Subproject commit 1f827fa3c08f6df04b27d5e4d215ae5dc8f155d0 diff --git a/tyto/sbol2.py b/tyto/sbol2.py new file mode 100644 index 0000000..4b68c3f --- /dev/null +++ b/tyto/sbol2.py @@ -0,0 +1,7 @@ +from .tyto import Ontology, installation_path + + +SBOL2 = Ontology(path=installation_path('ontologies/sbol-owl/sbol.rdf'), + uri='http://sbols.org/v2') + + diff --git a/tyto/sbol3.py b/tyto/sbol3.py new file mode 100644 index 0000000..c43c8ee --- /dev/null +++ b/tyto/sbol3.py @@ -0,0 +1,6 @@ +from .tyto import Ontology, installation_path + + +SBOL3 = Ontology(path=installation_path('ontologies/sbol-owl3/sbolowl3.rdf'), + uri='http://sbols.org/v3') +