From c928a2d30232591f775635d2d0013f5b0368b560 Mon Sep 17 00:00:00 2001 From: Jesper Friis Date: Fri, 29 Sep 2023 20:49:46 +0200 Subject: [PATCH 1/7] Update README.md --- README.md | 81 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index c28466901..cc0ebedf4 100644 --- a/README.md +++ b/README.md @@ -3,45 +3,68 @@ # EMMOntoPy -*Python API for the Elemental Multiperspective Material Ontology ([EMMO]).* +*Library for representing and working with ontologies in Python.* ![CI tests](https://github.com/emmo-repo/EMMOntoPy/workflows/CI%20Tests/badge.svg) [![PyPI version](https://badge.fury.io/py/EMMOntoPy.svg)](https://badge.fury.io/py/EMMOntoPy) [![DOI](https://zenodo.org/badge/190286064.svg)](https://zenodo.org/badge/latestdoi/190286064) -> ***Note**: EMMOntoPy is a continuation of the EMMO-python project and the associated `emmo` Python package. -> To see the legacy versions go to [PyPI](https://pypi.org/project/EMMO/).* - -This package is based on [Owlready2] and provides an intuitive representation of [EMMO] in Python. -It is available on [GitHub][EMMOntoPy] and on [PyPI][PyPI:EMMOntoPy] under the open source [BSD 3-Clause license](LICENSE.txt). - -The Elemental Multiperspective Material Ontology (EMMO) is an ongoing effort to create an ontology that takes into account fundamental concepts of physics, chemistry and materials science and is designed to pave the road for semantic interoperability. -The aim of EMMO is to be generic and provide a common ground for describing materials, models and data that can be adapted by all domains. - -EMMO is formulated using OWL. -EMMOntoPy is a Python API for using EMMO to solving real problems. -By using the excellent Python package [Owlready2], EMMOntoPy provides a natural representation of EMMO in Python. -On top of that EMMOntoPy provides: - -- Access by label (as well as by names, important since class and property names in EMMO are based on UUIDs). -- Test suite for EMMO-based ontologies. -- Generation of graphs. -- Generation of documentation. -- Command-line tools: - - [`emmocheck`](docs/tools-instructions.md#emmocheck): - Checks an ontology against EMMO conventions. - - [`ontoversion`](docs/tools-instructions.md#ontoversion): - Prints ontology version number. +EMMOntoPy is a Python package based on the excellent [Owlready2], which provides a natural and intuitive representation of ontologies in Python. +EMMOntoPy extends Owlready2 and adds additional functionality, like accessing entities by label, reasoning with FaCT++ and parsing logical expressions in Manchester syntax. +It also includes a set of tools, like creating an ontology from an Excel sheet, generation of reference documentation of ontologies and visualisation of ontologies graphically. +EMMOntoPy is freely available for on GitHub and on PyPI under the permissive open source [BSD 3-Clause license](LICENSE.txt). + +EMMOntoPy was originally developed to work effectively with Elemental Multiperspective Material Ontology ([EMMO]) and EMMO-based domain ontologies. +It has now two sub-packages, `ontopy` and `emmopy`, where `ontopy` is a general package to work with any OWL ontology, while `emmopy` provides extra features that are specific to [EMMO]. + +Owlready2, and thereby also EMMOntoPy, represents OWL classes and individuals in Python as classes and instances. +OWL properties are represented as Python attributes. +Hence, it provides a new *dot* notation for representing ontologies as valid Python code. +The notation is simple and easy to understand and write for people with some knowledge of OWL and Python. +Since Python is a versatile programming language, Owlready2 does not only allow for representation of OWL ontologies, but also to work with them programmatically, including interpretation, modification and generation. +Some of the additional features provided by EMMOntoPy are are listed below: + +## Access by label +In Owlready2 ontological entities, like classes, properties and individuals are accessed by the name-part of their IRI (i.e. everything that follows after the final slash or hash in the IRI). +This is very inconvenient for ontologies like EMMO or Wikidata, that identify ontological entities by long numerical names. +For instance, the name-part of the IRI of the Atom class in EMMO is ‘EMMO_eb77076b_a104_42ac_a065_798b2d2809ad’, which is neither human readable nor easy to write. +EMMOntoPy allows to access the entity via its label (or rather skos:prefLabel) ‘Atom’, which is much more user friendly. + +## Turtle serialisation/deserialisation +The Terse RDF Triple Language (Turtle) is a common syntax and file format for representing ontologies. +EMMOntoPy adds support for reading and writing ontologies in turtle format. + +## FaCT++ reasoning +Owlready2 has only support for reasoning with HermiT and Pellet. +EMMOntoPy adds additional support for the fast tableaux-based [FaCT++ reasoner] for description logics. + +## Manchester syntax +Even though the Owlready2 dot notation is clear and easy to read and understand for people who know Python, it is a new syntax that may look foreign for people that are used to working with Protégé. +EMMOntoPy provides support to parse and serialise logical expressions in [Manchester syntax], making it possible to create tools that will be much more familiar to work with for people used to working with Protégé. + +## Visualisation +EMMOntoPy provides a Python module for graphical visualisation of ontologies. +This module allows to graphically represent not only the taxonomy, but also restrictions and logical constructs. +The classes to include in the graph, can either be specified manually or inferred from the taxonomy (like all subclasses of a give class that are not a subclass of any class in a set of other classes). + +## Tools +EMMOntoPy includes a small set of command-line tools implemented as Python scripts: + - [`ontoconvert`](docs/tools-instructions.md#ontoconvert): + Converts ontologies between different file formats. + It also supports some additional transformation during conversion, like running a reasoner, merging several ontological modules together (squashing), rename IRIs, generate catalogue file and automatic annotation of entities with their source IRI. - [`ontograph`](docs/tools-instructions.md#ontograph): - Vertasile tool for visualising (parts of) an ontology. + Vertasile tool for visualising (parts of) an ontology, utilising the visualisation features mention above. - [`ontodoc`](docs/tools-instructions.md#ontodoc): Documents an ontology. - - [`ontoconvert`](docs/tools-instructions.md#ontoconvert): - Converts between ontology formats. - [`excel2onto`](docs/tools-instructions.md#excel2onto): Generate an EMMO-based ontology from an excel file. + It is useful for domain experts with limited knowledge of ontologies and that are not used to tools like Protégé. + - [`ontoversion`](docs/tools-instructions.md#ontoversion): + Prints ontology version number. + - [`emmocheck`](docs/tools-instructions.md#emmocheck): + A small test framework for checking the consistency of EMMO and EMMO-based domain ontologies and whether they confirm to the EMMO conventions. -Some examples of what you can do with EMMOntoPy includes: +## Some examples of what you can do with EMMOntoPy includes: - Access and query RDF-based ontologies from your application. This includes several different flavors of RDF (OWL, **Turtle (`ttl`)**, and more). @@ -181,3 +204,5 @@ It has mainly been developed by [SINTEF](https://www.sintef.no/), specifically: [Pygments]: https://pypi.org/project/Pygments/ [semver]: https://pypi.org/project/semver/ [rdflib]: https://pypi.org/project/rdflib/ +[FaCT++]: http://owl.cs.manchester.ac.uk/tools/fact/ +[Manchester syntax]: https://www.w3.org/TR/owl2-manchester-syntax/ From be13287ea2bb98ca560e30ee525446fa6d0df106 Mon Sep 17 00:00:00 2001 From: Jesper Friis Date: Sun, 1 Oct 2023 23:08:13 +0200 Subject: [PATCH 2/7] Updated emmocheck to new EMMO quantities and units. --- emmopy/emmocheck.py | 112 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 1 deletion(-) diff --git a/emmopy/emmocheck.py b/emmopy/emmocheck.py index b90325667..f81dcab20 100644 --- a/emmopy/emmocheck.py +++ b/emmopy/emmocheck.py @@ -119,6 +119,7 @@ def test_class_label(self): "2-manifold", "3-manifold", "C++", + "3DPrinting", ) ) exceptions.update(self.get_config("test_class_label.exceptions", ())) @@ -236,7 +237,7 @@ def test_unit_dimension(self): msg=cls, ) - def test_quantity_dimension(self): + def test_quantity_dimension_beta3(self): """Check that all quantities have a physicalDimension annotation. Note: this test will be deprecated when isq is moved to emmo/domain. @@ -310,6 +311,113 @@ def test_quantity_dimension(self): physdim = anno["physicalDimension"].first() self.assertRegex(physdim, regex, msg=cls) + def test_quantity_dimension(self): + """Check that all quantities have a physicalDimension. + + Note: this test will be deprecated when isq is moved to emmo/domain. + + Configurations: + exceptions - full class names of classes to ignore. + """ + # pylint: disable=invalid-name + exceptions = set( + ( + "properties.ModelledQuantitativeProperty", + "properties.MeasuredQuantitativeProperty", + "properties.ConventionalQuantitativeProperty", + "metrology.QuantitativeProperty", + "metrology.Quantity", + "metrology.OrdinalQuantity", + "metrology.BaseQuantity", + "metrology.PhysicalConstant", + "metrology.PhysicalQuantity", + "metrology.ExactConstant", + "metrology.MeasuredConstant", + "metrology.DerivedQuantity", + "isq.ISQBaseQuantity", + "isq.InternationalSystemOfQuantity", + "isq.ISQDerivedQuantity", + "isq.SIExactConstant", + "emmo.ModelledQuantitativeProperty", + "emmo.MeasuredQuantitativeProperty", + "emmo.ConventionalQuantitativeProperty", + "emmo.QuantitativeProperty", + "emmo.Quantity", + "emmo.OrdinalQuantity", + "emmo.BaseQuantity", + "emmo.PhysicalConstant", + "emmo.PhysicalQuantity", + "emmo.ExactConstant", + "emmo.MeasuredConstant", + "emmo.DerivedQuantity", + "emmo.ISQBaseQuantity", + "emmo.InternationalSystemOfQuantity", + "emmo.ISQDerivedQuantity", + "emmo.SIExactConstant", + "emmo.NonSIUnits", + "emmo.StandardizedPhysicalQuantity", + "emmo.CategorizedPhysicalQuantity", + "emmo.ISO80000Categorised", + "emmo.AtomicAndNuclear", + "emmo.Defined", + "emmo.Electromagnetic", + "emmo.FrequentlyUsed", + "emmo.ChemicalCompositionQuantity", + "emmo.EquilibriumConstant", # physical dimension may change + "emmo.Solubility", + "emmo.Universal", + "emmo.Intensive", + "emmo.Extensive", + "emmo.Concentration", + ) + ) + if not hasattr(self.onto, "PhysicalQuantity"): + return + exceptions.update( + self.get_config("test_quantity_dimension.exceptions", ()) + ) + classes = set(self.onto.classes(self.check_imported)) + for cls in self.onto.PhysicalQuantity.descendants(): + if not self.check_imported and cls not in classes: + continue + if issubclass(cls, self.onto.ISO80000Categorised): + continue + if repr(cls) not in exceptions: + with self.subTest(cls=cls, label=get_label(cls)): + for r in cls.get_indirect_is_a(): + if isinstance(r, owlready2.Restriction) and repr( + r + ).startswith("emmo.hasMeasurementUnit.some"): + self.assertTrue( + issubclass( + r.value, + ( + self.onto.DimensionalUnit, + self.onto.DimensionlessUnit, + ), + ) + ) + break + else: + self.assertTrue( + issubclass(cls, self.onto.ISQDimensionlessQuantity) + ) + + def test_dimensional_unit(self): + """Check correct syntax of dimension string of dimensional units.""" + # pylint: disable=invalid-name + regex = re.compile( + "^T([+-][1-9][0-9]*|0) L([+-][1-9]|0) M([+-][1-9]|0) " + "I([+-][1-9]|0) (H|Θ)([+-][1-9]|0) N([+-][1-9]|0) " + "J([+-][1-9]|0)$" + ) + for cls in self.onto.SIDimensionalUnit.__subclasses__(): + with self.subTest(cls=cls, label=get_label(cls)): + self.assertEqual(len(cls.equivalent_to), 1) + r = cls.equivalent_to[0] + self.assertIsInstance(r, owlready2.Restriction) + self.assertRegex(r.value, regex) + def test_physical_quantity_dimension(self): """Check that all physical quantities have `hasPhysicalDimension`. @@ -660,6 +768,8 @@ def main( skipped = set( # skipped by default [ "test_namespace", + "test_physical_quantity_dimension_annotation", + "test_quantity_dimension_beta3", "test_physical_quantity_dimension", ] ) From dcdda05880bfb0da3ef4f2723769f0c2fc907f5c Mon Sep 17 00:00:00 2001 From: Jesper Friis Date: Sun, 8 Oct 2023 22:05:40 +0200 Subject: [PATCH 3/7] Update README.md Co-authored-by: Francesca L. Bleken <48128015+francescalb@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cc0ebedf4..e4715a918 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ EMMOntoPy extends Owlready2 and adds additional functionality, like accessing en It also includes a set of tools, like creating an ontology from an Excel sheet, generation of reference documentation of ontologies and visualisation of ontologies graphically. EMMOntoPy is freely available for on GitHub and on PyPI under the permissive open source [BSD 3-Clause license](LICENSE.txt). -EMMOntoPy was originally developed to work effectively with Elemental Multiperspective Material Ontology ([EMMO]) and EMMO-based domain ontologies. +EMMOntoPy was originally developed to work effectively with the Elemental Multiperspective Material Ontology ([EMMO]) and EMMO-based domain ontologies. It has now two sub-packages, `ontopy` and `emmopy`, where `ontopy` is a general package to work with any OWL ontology, while `emmopy` provides extra features that are specific to [EMMO]. Owlready2, and thereby also EMMOntoPy, represents OWL classes and individuals in Python as classes and instances. From 3c7ca7e3fa97933b7b2528d4feb296e14770d902 Mon Sep 17 00:00:00 2001 From: Jesper Friis Date: Mon, 9 Oct 2023 08:53:41 +0200 Subject: [PATCH 4/7] update --- README.md | 32 ++++++++++---------- docs/index.md | 81 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 69 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index e4715a918..9fea7366f 100644 --- a/README.md +++ b/README.md @@ -9,42 +9,42 @@ [![PyPI version](https://badge.fury.io/py/EMMOntoPy.svg)](https://badge.fury.io/py/EMMOntoPy) [![DOI](https://zenodo.org/badge/190286064.svg)](https://zenodo.org/badge/latestdoi/190286064) -EMMOntoPy is a Python package based on the excellent [Owlready2], which provides a natural and intuitive representation of ontologies in Python. -EMMOntoPy extends Owlready2 and adds additional functionality, like accessing entities by label, reasoning with FaCT++ and parsing logical expressions in Manchester syntax. -It also includes a set of tools, like creating an ontology from an Excel sheet, generation of reference documentation of ontologies and visualisation of ontologies graphically. +EMMOntoPy is a Python package based on the excellent [Owlready2], which provides a natural and intuitive representation of ontologies in Python. +EMMOntoPy extends Owlready2 and adds additional functionality, like accessing entities by label, reasoning with FaCT++ and parsing logical expressions in Manchester syntax. +It also includes a set of tools, like creating an ontology from an Excel sheet, generation of reference documentation of ontologies and visualisation of ontologies graphically. EMMOntoPy is freely available for on GitHub and on PyPI under the permissive open source [BSD 3-Clause license](LICENSE.txt). EMMOntoPy was originally developed to work effectively with the Elemental Multiperspective Material Ontology ([EMMO]) and EMMO-based domain ontologies. It has now two sub-packages, `ontopy` and `emmopy`, where `ontopy` is a general package to work with any OWL ontology, while `emmopy` provides extra features that are specific to [EMMO]. Owlready2, and thereby also EMMOntoPy, represents OWL classes and individuals in Python as classes and instances. -OWL properties are represented as Python attributes. -Hence, it provides a new *dot* notation for representing ontologies as valid Python code. -The notation is simple and easy to understand and write for people with some knowledge of OWL and Python. -Since Python is a versatile programming language, Owlready2 does not only allow for representation of OWL ontologies, but also to work with them programmatically, including interpretation, modification and generation. +OWL properties are represented as Python attributes. +Hence, it provides a new *dot* notation for representing ontologies as valid Python code. +The notation is simple and easy to understand and write for people with some knowledge of OWL and Python. +Since Python is a versatile programming language, Owlready2 does not only allow for representation of OWL ontologies, but also to work with them programmatically, including interpretation, modification and generation. Some of the additional features provided by EMMOntoPy are are listed below: ## Access by label -In Owlready2 ontological entities, like classes, properties and individuals are accessed by the name-part of their IRI (i.e. everything that follows after the final slash or hash in the IRI). -This is very inconvenient for ontologies like EMMO or Wikidata, that identify ontological entities by long numerical names. -For instance, the name-part of the IRI of the Atom class in EMMO is ‘EMMO_eb77076b_a104_42ac_a065_798b2d2809ad’, which is neither human readable nor easy to write. +In Owlready2 ontological entities, like classes, properties and individuals are accessed by the name-part of their IRI (i.e. everything that follows after the final slash or hash in the IRI). +This is very inconvenient for ontologies like EMMO or Wikidata, that identify ontological entities by long numerical names. +For instance, the name-part of the IRI of the Atom class in EMMO is ‘EMMO_eb77076b_a104_42ac_a065_798b2d2809ad’, which is neither human readable nor easy to write. EMMOntoPy allows to access the entity via its label (or rather skos:prefLabel) ‘Atom’, which is much more user friendly. ## Turtle serialisation/deserialisation -The Terse RDF Triple Language (Turtle) is a common syntax and file format for representing ontologies. +The Terse RDF Triple Language (Turtle) is a common syntax and file format for representing ontologies. EMMOntoPy adds support for reading and writing ontologies in turtle format. ## FaCT++ reasoning -Owlready2 has only support for reasoning with HermiT and Pellet. +Owlready2 has only support for reasoning with HermiT and Pellet. EMMOntoPy adds additional support for the fast tableaux-based [FaCT++ reasoner] for description logics. ## Manchester syntax -Even though the Owlready2 dot notation is clear and easy to read and understand for people who know Python, it is a new syntax that may look foreign for people that are used to working with Protégé. -EMMOntoPy provides support to parse and serialise logical expressions in [Manchester syntax], making it possible to create tools that will be much more familiar to work with for people used to working with Protégé. +Even though the Owlready2 dot notation is clear and easy to read and understand for people who know Python, it is a new syntax that may look foreign for people that are used to working with Protégé. +EMMOntoPy provides support to parse and serialise logical expressions in [Manchester syntax], making it possible to create tools that will be much more familiar to work with for people used to working with Protégé. ## Visualisation -EMMOntoPy provides a Python module for graphical visualisation of ontologies. -This module allows to graphically represent not only the taxonomy, but also restrictions and logical constructs. +EMMOntoPy provides a Python module for graphical visualisation of ontologies. +This module allows to graphically represent not only the taxonomy, but also restrictions and logical constructs. The classes to include in the graph, can either be specified manually or inferred from the taxonomy (like all subclasses of a give class that are not a subclass of any class in a set of other classes). ## Tools diff --git a/docs/index.md b/docs/index.md index 2107265f1..1312a062e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,45 +3,68 @@ # EMMOntoPy -*Python API for the Elemental Multiperspective Material Ontology ([EMMO]).* +*Library for representing and working with ontologies in Python.* ![CI tests](https://github.com/emmo-repo/EMMOntoPy/workflows/CI%20Tests/badge.svg) [![PyPI version](https://badge.fury.io/py/EMMOntoPy.svg)](https://badge.fury.io/py/EMMOntoPy) [![DOI](https://zenodo.org/badge/190286064.svg)](https://zenodo.org/badge/latestdoi/190286064) -> ***Note**: EMMOntoPy is a continuation of the EMMO-python project and the associated `emmo` Python package. -> To see the legacy versions go to [PyPI](https://pypi.org/project/EMMO/).* - -This package is based on [Owlready2] and provides an intuitive representation of [EMMO] in Python. -It is available on [GitHub][EMMOntoPy] and on [PyPI][PyPI:EMMOntoPy] under the open source [BSD 3-Clause license](LICENSE.md). - -The Elemental Multiperspective Material Ontology (EMMO) is an ongoing effort to create an ontology that takes into account fundamental concepts of physics, chemistry and materials science and is designed to pave the road for semantic interoperability. -The aim of EMMO is to be generic and provide a common ground for describing materials, models and data that can be adapted by all domains. - -EMMO is formulated using OWL. -EMMOntoPy is a Python API for using EMMO to solving real problems. -By using the excellent Python package [Owlready2], EMMOntoPy provides a natural representation of EMMO in Python. -On top of that EMMOntoPy provides: - -- Access by label (as well as by names, important since class and property names in EMMO are based on UUIDs). -- Test suite for EMMO-based ontologies. -- Generation of graphs. -- Generation of documentation. -- Command-line tools: - - [`emmocheck`](tools-instructions.md#emmocheck): - Checks an ontology against EMMO conventions. - - [`ontoversion`](tools-instructions.md#ontoversion): - Prints ontology version number. +EMMOntoPy is a Python package based on the excellent [Owlready2], which provides a natural and intuitive representation of ontologies in Python. +EMMOntoPy extends Owlready2 and adds additional functionality, like accessing entities by label, reasoning with FaCT++ and parsing logical expressions in Manchester syntax. +It also includes a set of tools, like creating an ontology from an Excel sheet, generation of reference documentation of ontologies and visualisation of ontologies graphically. +EMMOntoPy is freely available for on GitHub and on PyPI under the permissive open source [BSD 3-Clause license](LICENSE.md). + +EMMOntoPy was originally developed to work effectively with the Elemental Multiperspective Material Ontology ([EMMO]) and EMMO-based domain ontologies. +It has now two sub-packages, `ontopy` and `emmopy`, where `ontopy` is a general package to work with any OWL ontology, while `emmopy` provides extra features that are specific to [EMMO]. + +Owlready2, and thereby also EMMOntoPy, represents OWL classes and individuals in Python as classes and instances. +OWL properties are represented as Python attributes. +Hence, it provides a new *dot* notation for representing ontologies as valid Python code. +The notation is simple and easy to understand and write for people with some knowledge of OWL and Python. +Since Python is a versatile programming language, Owlready2 does not only allow for representation of OWL ontologies, but also to work with them programmatically, including interpretation, modification and generation. +Some of the additional features provided by EMMOntoPy are are listed below: + +## Access by label +In Owlready2 ontological entities, like classes, properties and individuals are accessed by the name-part of their IRI (i.e. everything that follows after the final slash or hash in the IRI). +This is very inconvenient for ontologies like EMMO or Wikidata, that identify ontological entities by long numerical names. +For instance, the name-part of the IRI of the Atom class in EMMO is ‘EMMO_eb77076b_a104_42ac_a065_798b2d2809ad’, which is neither human readable nor easy to write. +EMMOntoPy allows to access the entity via its label (or rather skos:prefLabel) ‘Atom’, which is much more user friendly. + +## Turtle serialisation/deserialisation +The Terse RDF Triple Language (Turtle) is a common syntax and file format for representing ontologies. +EMMOntoPy adds support for reading and writing ontologies in turtle format. + +## FaCT++ reasoning +Owlready2 has only support for reasoning with HermiT and Pellet. +EMMOntoPy adds additional support for the fast tableaux-based [FaCT++ reasoner] for description logics. + +## Manchester syntax +Even though the Owlready2 dot notation is clear and easy to read and understand for people who know Python, it is a new syntax that may look foreign for people that are used to working with Protégé. +EMMOntoPy provides support to parse and serialise logical expressions in [Manchester syntax], making it possible to create tools that will be much more familiar to work with for people used to working with Protégé. + +## Visualisation +EMMOntoPy provides a Python module for graphical visualisation of ontologies. +This module allows to graphically represent not only the taxonomy, but also restrictions and logical constructs. +The classes to include in the graph, can either be specified manually or inferred from the taxonomy (like all subclasses of a give class that are not a subclass of any class in a set of other classes). + +## Tools +EMMOntoPy includes a small set of command-line tools implemented as Python scripts: + - [`ontoconvert`](tools-instructions.md#ontoconvert): + Converts ontologies between different file formats. + It also supports some additional transformation during conversion, like running a reasoner, merging several ontological modules together (squashing), rename IRIs, generate catalogue file and automatic annotation of entities with their source IRI. - [`ontograph`](tools-instructions.md#ontograph): - Vertasile tool for visualising (parts of) an ontology. + Vertasile tool for visualising (parts of) an ontology, utilising the visualisation features mention above. - [`ontodoc`](tools-instructions.md#ontodoc): Documents an ontology. - - [`ontoconvert`](tools-instructions.md#ontoconvert): - Converts between ontology formats. - [`excel2onto`](tools-instructions.md#excel2onto): Generate an EMMO-based ontology from an excel file. + It is useful for domain experts with limited knowledge of ontologies and that are not used to tools like Protégé. + - [`ontoversion`](tools-instructions.md#ontoversion): + Prints ontology version number. + - [`emmocheck`](tools-instructions.md#emmocheck): + A small test framework for checking the consistency of EMMO and EMMO-based domain ontologies and whether they confirm to the EMMO conventions. -Some examples of what you can do with EMMOntoPy includes: +## Some examples of what you can do with EMMOntoPy includes: - Access and query RDF-based ontologies from your application. This includes several different flavors of RDF (OWL, **Turtle (`ttl`)**, and more). @@ -181,3 +204,5 @@ It has mainly been developed by [SINTEF](https://www.sintef.no/), specifically: [Pygments]: https://pypi.org/project/Pygments/ [semver]: https://pypi.org/project/semver/ [rdflib]: https://pypi.org/project/rdflib/ +[FaCT++]: http://owl.cs.manchester.ac.uk/tools/fact/ +[Manchester syntax]: https://www.w3.org/TR/owl2-manchester-syntax/ From 354f539c5c9d48410de69d4a7feacfa171377da7 Mon Sep 17 00:00:00 2001 From: Jesper Friis Date: Mon, 9 Oct 2023 09:56:02 +0200 Subject: [PATCH 5/7] Added test_emmocheck --- tests/test_emmocheck.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/test_emmocheck.py diff --git a/tests/test_emmocheck.py b/tests/test_emmocheck.py new file mode 100644 index 000000000..94dfcf325 --- /dev/null +++ b/tests/test_emmocheck.py @@ -0,0 +1,9 @@ +from emmopy.emmocheck import main + + +main( + argv=[ + "--url-from-catalog", + "https://raw.githubusercontent.com/emmo-repo/EMMO/1.0.0-beta5/emmo.ttl", + ] +) From 6b54003717b0e73ee9b2d55604b4983dd1ff8024 Mon Sep 17 00:00:00 2001 From: Jesper Friis Date: Mon, 9 Oct 2023 11:06:59 +0200 Subject: [PATCH 6/7] Renamed test_emmocheck.py to avoid name confusion in pytest --- tests/{test_emmocheck.py => test_emmocheck_module.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/{test_emmocheck.py => test_emmocheck_module.py} (100%) diff --git a/tests/test_emmocheck.py b/tests/test_emmocheck_module.py similarity index 100% rename from tests/test_emmocheck.py rename to tests/test_emmocheck_module.py From a60fc28d0b45ba49188ac4fe482b3d9ad4af2880 Mon Sep 17 00:00:00 2001 From: Jesper Friis Date: Mon, 9 Oct 2023 11:19:09 +0200 Subject: [PATCH 7/7] Test a specific commit of EMMO --- tests/test_emmocheck_module.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_emmocheck_module.py b/tests/test_emmocheck_module.py index 94dfcf325..16e95b2aa 100644 --- a/tests/test_emmocheck_module.py +++ b/tests/test_emmocheck_module.py @@ -4,6 +4,7 @@ main( argv=[ "--url-from-catalog", - "https://raw.githubusercontent.com/emmo-repo/EMMO/1.0.0-beta5/emmo.ttl", + # Test against a specific commit of EMMO 1.0.0-beta5 + "https://raw.githubusercontent.com/emmo-repo/EMMO/3b93e2c9c45ab8d9882d2d6385276ff905095798/emmo.ttl", ] )