Python reference API for the Europeean Materials & Modelling Ontology
Project description
EMMO - Python API for the European Materials & Modelling Ontology
This package is based on Owlready2 and provides an intuitive representation of EMMO in Python. It is available on GitHub and on PyPI under the open source BSD 3-Clause license.
The European Materials & Modelling 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. EMMO-python is a Python API for using EMMO to solving real problems. By using the excellent Python package Owlready2, EMMO-python provides a natural representation of EMMO in Python. On top of that EMMO-python 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: checks an ontology against EMMO conventions
- ontoversion: prints ontology version number
- ontograph: vertasile tool for visualising (parts of) an ontology
- ontodoc: documents an ontology
Some examples of what you can do with EMMO-python includes:
-
Access and query EMMO-based ontologies from your application.
-
Extend EMMO with new domain or application ontologies. This can be done both statically with easy readable Python code or dynamically within your application.
-
Generate graphs and documentation of your ontologies. EMMO-python includes
ontodoc
, which is a dedicated command line tool for this. You find it in the tools/ sub directory. -
Check that a EMMO-based domain or application ontology ahead to the conventions of EMMO.
-
Interactively explore an ontology in e.g. IPython. Tab completion makes exploration easy and fast. Below is an example of an IPython session where we check the relations of
Matter
:In [1]: from emmo import get_ontology In [2]: emmo = get_ontology() In [3]: emmo.load() Out[3]: get_ontology("http://emmo.info/emmo/emmo-inferred#") In [4]: emmo.Matter Out[4]: physicalistic.Matter In [5]: emmo.Matter.is_a Out[5]: [physicalistic.Physicalistic, physical.Physical, mereotopology.hasPart.some(physicalistic.Massive), physical.hasTemporalPart.only(physicalistic.Matter)]
Documentation and examples
The Owlready2 documentation is a good starting point.
In addition EMMO-python includes a few examples and demos:
-
demo/vertical shows an example of how EMMO may be used to achieve vertical interoperability. The file define-ontology.py provides a good example for how an EMMO-based application ontology can be defined in Python.
-
demo/horizontal shows an example of shows an example of how EMMO may be used to achieve horizontal interoperability. This demo also shows how you can use EMMO-python to represent your ontology with the low-level metadata framework DLite. In addition to achieve interoperability, as shown in the demo, DLite also allow you to automatically generate C or Fortran code base on your ontology.
-
examples/emmodoc shows how the documentation of EMMO is generated using the
ontodoc
tool.
Installation
Install with
pip install EMMO
Required Dependencies
Optional Dependencies
-
Graphviz: Needed for graph generation. With support for generation pdf, png and svg figures for tests and generation of documentation automatically (ontodoc).
-
pandoc: Only used for generated documentation from markdown to nicely formatted html or pdf. Tested with v2.1.2.
-
pdfLaTeX or XeLaTeX and the
upgreek
latex package (included intexlive-was
on RetHat-based distributions andtexlive-latex-extra
on Ubuntu) for generation of pdf documentation. If your ontology contain exotic unicode characters, we recommend XeLaTeX. -
Java. Needed for reasoning.
-
Optional Python packages
- graphviz: Generation of documentation and graphs.
- PyYAML: Required for generating documentation with pandoc.
- blessings: Clean output for emmocheck
- Pygments: Coloured output for emmocheck
- rdflib: Required for ontoversion-tool
- semver: Required for ontoversion-tool
- pydot: Used for generating graphs. Will be deprecated.
See docs/docker-dockerinstructions.md for how to build a docker image.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file EMMO-1.0.0a20.tar.gz
.
File metadata
- Download URL: EMMO-1.0.0a20.tar.gz
- Upload date:
- Size: 2.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e2bda2a9c43c66fe40ae86df7e6ee852c822dcbdb274660fc1f99e5c4da3a0b |
|
MD5 | 2826ed1b8a1aa700a28168cafad35678 |
|
BLAKE2b-256 | b3bd242150f31311cefec0db6e3229a2d9fdf007ff72a158d447f2157e081b23 |
File details
Details for the file EMMO-1.0.0a20-py3-none-any.whl
.
File metadata
- Download URL: EMMO-1.0.0a20-py3-none-any.whl
- Upload date:
- Size: 2.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1deb6dae885f4a857d840f032dae1b2c39da7be9460df8f995e53f60cb36e52 |
|
MD5 | 176d4148e28c19aac36a1daafa47b334 |
|
BLAKE2b-256 | 00731babf9b6713de9631d01da5514687d55d8254a2dfa5791e897b05eaf394d |