Skip to main content

Python reference API for the Europeean Materials & Modelling Ontology

Project description

EMMO - Python API for the Euroean Materials & Modelling Ontology (EMMO)

CI tests

This package is based on Owlready2 and provides an intuitive representation of EMMO in Python.

It is available on [GitHub][EMMP-python] and on PYPI under the open source BSD license.

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).
  • Generation of graphs
  • Generation of documentation
  • Test suite for EMMO-based ontologies
  • Command-line tools (ontograph, ontodoc and emmocheck)

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:

    >>> from emmo import get_ontology
    
    >>> emmo = get_ontology()
    >>> emmo.load()
    
    >>> emmo.Matter
    emmo-material.Matter
    
    >>> emmo.Matter.is_a
    [emmo-material.Type,
     emmo-mereotopology.hasPart.some(emmo-material.Massive),
     emmo-mereotopology.hasTemporalPart.only(emmo-material.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.

  • XeLaTeX or pdfLaTeX and the upgreek latex package (included in texlive-was on RetHat-based distributions and texlive-latex-extra on Ubuntu) for generation of pdf documentation. If your ontology contains unicode characters, we recommend XeLaTeX.

  • Java. Needed for reasoning.

  • Python packages

    • graphviz: Generation of documentation and graphs.
    • PyYAML: Required for generating documentation with pandoc.
    • blessings: Coloured output for emmocheck
    • Pygments: Highlighted verbose output for emmocheck
    • pydot: Required for generating graphs. Will be deprecated.

See docs/docker-dockerinstructions.md for how to build a docker image.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

EMMO-1.0.0a8.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

EMMO-1.0.0a8-py3-none-any.whl (2.2 MB view details)

Uploaded Python 3

File details

Details for the file EMMO-1.0.0a8.tar.gz.

File metadata

  • Download URL: EMMO-1.0.0a8.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.20.0 setuptools/42.0.2 requests-toolbelt/0.8.0 tqdm/4.37.0 CPython/3.7.5

File hashes

Hashes for EMMO-1.0.0a8.tar.gz
Algorithm Hash digest
SHA256 95a51ee0418e118494bd3172a375155e40905e75d3da831a2219c1e500661749
MD5 29f911bfeac21dfb1689bef96284f383
BLAKE2b-256 abfb3f52e506abb956cffdc9cb6676e2c3312795bb36e30d19fa929386fe084d

See more details on using hashes here.

File details

Details for the file EMMO-1.0.0a8-py3-none-any.whl.

File metadata

  • Download URL: EMMO-1.0.0a8-py3-none-any.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.20.0 setuptools/42.0.2 requests-toolbelt/0.8.0 tqdm/4.37.0 CPython/3.7.5

File hashes

Hashes for EMMO-1.0.0a8-py3-none-any.whl
Algorithm Hash digest
SHA256 9f2296d2bf74cb87d7d685b65a3ce74fee6ca6fbb0168da540b802fe02634277
MD5 1cc1384c2136827de3118c0636b6f5b8
BLAKE2b-256 6da0c48313406af1284fb6ac740109ffd311a858d55d9858a2508f11058e3d9c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page