Welcome to Owlready’s documentation! — Owlready 0.3 documentation

# Welcome to Owlready’s documentation!

Owlready is a module for ontology-oriented programming in Python: load OWL 2.0 ontologies as Python objects, modify them, save to OWL XML, and perform reasoning via HermiT (included). Owlready allows a transparent access to OWL ontologies (contrary to usual Java-based API).

Owlready has been created at the LIMICS reseach lab, University Paris 13, Sorbonne Paris Cité, INSERM UMRS 1142, Paris 6 University, by Jean-Baptiste Lamy. It was developed during the VIIIP research project funded by ANSM, the French Drug Agency; this is why most examples in this documentation relate to drug ;).

Owlready is available under the GNU LGPL licence v3.

## Table of content

- Introduction
  - Short example: What can I do with Owlready?
  - Contact and links
- Managing ontologies
  - Creating an ontology
  - Loading an ontology from OWL
  - Accessing to the content of an ontology
  - Importing other ontologies
  - Saving an ontology to an OWL file
- Classes and Instances (Individuals)
  - Creating a Class
  - Creating subclasses
  - Creating classes dynamically
  - Creating equivalent classes
  - Creating Instances
  - Mutli-Class Instances
- Properties
  - Creating a new class of property
  - Creating a relation
  - Data Property
  - Inverse properties
  - Functional and Inverse Functional properties
  - Creating a subproperty
  - Associating Python alias name to Properties
- Restrictions
  - Restrictions on a Property
  - Class operators
  - One-Of constructs
- Disjointness and open world assumption
  - Disjoint Classes
  - Disjoint Properties
  - Distinct Instances
  - Closing Instances
- Mixing Python and OWL
  - Adding Python methods to an OWL Class
  - Generating Instance names
  - Forward declarations
  - Associating a Python module to an OWL ontology
- Reasoning
  - Setting up everything
  - Running the reasoner
  - Results of the automatic classification
- Annotations
  - Adding an annotation
  - Querying annotations
  - Iterating through annotations
  - Deleting annotations
  - Creating a new class of annotation
- Keys and indexes
  - Creating an index
  - Using the index
- Editing Instances with EditObj3 dialog box generator
  - Generating a dialog box
  - Ordering the Instance’s Properties
  - HTML output
- Limitations
  - Current limits