loopasam edited this page Mar 7, 2014 · 49 revisions

Brain helps you to quickly and easily buid OWL ontologies and knowledge bases. It aims at bridging the gap between graphical user interfaces (GUI) such as Protege and the OWL-API.

The library is useful to develop Semantic Web applications and particularly suited for the biomedical domain. Brain wraps the interaction with the OWL-API an relies on Elk for reasoning tasks.

Documentation | Website | Issues | Feedback | Reference | Examples | OWL 2 EL | Presentation | Javadoc

Author: Samuel Croset

Version: 1.5.1 (release notes)

Release date version: March 2014

Licence: Apache License 2.0. The OWL-API and ELK are available under the same licensing.

Questions and problems: Stack Overflow with tag owl.

Publication and citation: Brain: biomedical knowledge manipulation.



Download the .jar file from the website and add it to your classpath.


The library is available from the Central Repository. Add the following to your pom.xml:


Core concepts

Brain is a facade for the OWL-API, wrapping the Elk reasoner for reasoning task, such as query or consistency checking. Brain has been designed with biomedical knowledge in mind, which can expressed as an OWL ontology or knowledge-base. In this domain, knowledge bases are usually very large and mostly focused on the TBox (lots of classes, few instances). Biomedical ontologies are therefore very often following an OWL 2 EL profile, suitable for fast reasoning (decidable in polynomial time). The initial goal of Brain is to provide a simplified interaction with the OWL-API. Classes and expressions are entered using the intuitive Manchester syntax. In order to understand how to program using Brain, you should understand the following core concepts:

Unique ontology

Basically, a instance of a Brain object hold a reference to only one ontology (also called knowledge-base). You can of course import some external ontologies, refer to external terms, but at the end it will resolve to only one ontology.

Unique names

The names of OWL entities handled by a Brain object have to be unique. This is motivated by the fact that Brain hides as much as possible the cumbersome interaction with prefixes, IRI and URIs. Everything resolves to names.


The interaction with the ontology is done via strings (type-less). Expressions and queries are formulated in Manchester syntax. It results in less and more explicit code.

Error-handling driven

Because the interaction with Brain is built around strings rather than Java objects, special care has to be put on exception handling, in order to preserve the consistency. Brain throws a lot of possible exceptions, depending the type of operation you want to carry. All exceptions are subclasses of BrainException.

Example of axiom implemented using Brain

Natural language: A nucleus is part of some cells.

Description Logic: Nucleus ⊆ ∃part-of.Cell

OWL (Manchester syntax): Nucleus subClassOf part-of some Cell

Brain implementation:

//Main method - All exceptions are thrown (BrainException)
public static void main(String[] args) throws BrainException {
  //You will always need a Brain object
  Brain brain = new Brain();
  //Add the OWL classes
  //Add the OWL object property
  //Assert the axiom
  brain.subClassOf("Nucleus", "part-of some Cell");

Serialised ontology:

Prefix: xsd: <http://www.w3.org/2001/XMLSchema#>
Prefix: owl: <http://www.w3.org/2002/07/owl#>
Prefix: : <brain#>
Prefix: xml: <http://www.w3.org/XML/1998/namespace>
Prefix: rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Prefix: rdfs: <http://www.w3.org/2000/01/rdf-schema#>

Ontology: <brain.owl>

ObjectProperty: part-of

Class: owl:Thing
Class: Cell

Class: Nucleus

        part-of some Cell

Documentation and examples

If you want to know more about Description Logic or OWL 2 EL, you can visit this page. The best way to learn Brain is via the examples provided. There is also a reference summarising the methods as well as a big table comparing OWL with Description Logic. If you think that a feature is missing or if you need some more help, feel free to contact me.


Thanks to pagekite for supporting the debug and development of the library by providing a free account.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.