Brain

Biomedical knowledge manipulation

Documentation Brain-1.5.1.jar View on GitHub

Summary

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.

Features

Manchester syntax support

The interaction with Brain is done with the user friendly Manchester syntax. Brain exposes a series of method to help you validate and transform strings of characters into OWL expressions.


Web Application development

Brain has been created for Semantic Web application developers. The library is thread-safe which allows you to handle ontologies in a web server setting.


Scalability

OWL is a very demanding in terms of computing, but thanks to the OWL 2 EL profile, it is possible to thread reasoning some tasks in parallel (Elk reasoner). Brain therefore supports the OWL 2 EL to help you build scalable solutions.


Query

OWL knowledge bases can be easily queried with Brain. Powerful questions can be quickly answered with the help of the Elk reasoner. Brain accepts the formulation of queries from labels as well as from class expressions.


Example of axiom

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

public static void main(String[] args) throws BrainException {
  //You will always need a Brain object
  Brain brain = new Brain();
  //Add the OWL classes
  brain.addClass("Nucleus");
  brain.addClass("Cell");
  //Add the OWL object property
  brain.addObjectProperty("part-of");
  //Declare the axiom
  brain.subClassOf("Nucleus", "part-of some Cell");
  //Query the knowledge-base for indirect subclasses of an expression
  List<String> subClasses = brain.getSubClasses("part-of some Cell", false);
  //Free the resources used by the reasoner
  brain.sleep();
  //Save the ontology
  brain.save("your/path/to/ontology.owl");
}

Serialised OWL file (Manchester syntax)

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

    SubClassOf: 
        part-of some Cell

Serialised RDF file (Turtle)

@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 dc: <http://purl.org/dc/elements/1.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@base <brain.owl> .

<brain.owl> rdf:type owl:Ontology .

:part-of rdf:type owl:ObjectProperty .

:Cell rdf:type owl:Class .

:Nucleus rdf:type owl:Class ;
         
         rdfs:subClassOf [ rdf:type owl:Restriction ;
                           owl:onProperty :part-of ;
                           owl:someValuesFrom :Cell
                         ] .

owl:Thing rdf:type owl:Class .

Translation between Description Logic and OWL

Description Logic (DL) Syntax OWL Functional-Style Syntax OWL Manchester Syntax Example of Brain Implementation
Individuals
individual name a Declaration(NamedIndividual(a)) Individual: a Not supported (To be implemented in a future version)
Roles
atomic role R Declaration(ObjectProperty(P)) ObjectProperty: P brain.addObjectProperty("P");
Concepts
atomic concept A Declaration(Class(A)) Class: A brain.addClass("A");
intersection C⊓D ObjectIntersectionOf(C D) C and D brain.equivalentClasses("A", "C and D");
top concept owl:Thing owl:Thing brain.getOWLClass("Thing");
top concept owl:Nothing owl:Nothing brain.getUnsatisfiableClasses();
existential restriction ∃R.C ObjectSomeValuesFrom(P C) P some C brain.subClassOf("X", "P some C");
union C⊔D ObjectUnionOf(C D) C or D Not supported (Not in EL profile)
complement ¬C ObjectComplementOf(C) not C Not supported (Not in EL profile)
universal restriction ∀R.C ObjectAllValuesFrom(P C) P only C Not supported (Not in EL profile)
Axioms
ABox (assertional axioms)
concept assertion C(a) ClassAssertion(C a) Individual: a
Types: C
Not supported (To be implemented in a future version)
role assertion R(a, b) ObjectPropertyAssertion(P a b) Individual: a
Facts: R b
Not supported (To be implemented in a future version)
individual equality a≈b SameIndividual(a b) Individual: a
SameAs: b
Not supported (To be implemented in a future version)
individual inequality a≠b DifferentIndividuals(a b) Individual: a
DifferentFrom: b
Not supported (To be implemented in a future version)
TBox (terminological axioms)
concept inclusion C⊑D SubClassOf(C D) Class: C
SubClassOf: D
brain.subClassOf("C", "D");
concept equivalence C≡D EquivalentClasses(C D) Class: C
EquivalentTo: D
brain.equivalentClasses("C", "D");
concept disjointness C⊓D⊑⊥ DisjointClasses(C D) Class: C
DisjointWith: D
brain.disjointClasses("C", "D");
RBox (relational axioms)
role inclusion R⊑S SubObjectPropertyOf(R S) ObjectProperty: R
SubPropertyOf: S
brain.subPropertyOf("R", "S");
role equivalence R≡S EquivalentObjectProperties(C D) ObjectProperty: R
EquivalentTo: S
brain.equivalentProperties("R", "S");
complex role inclusion R1◦R2⊑S EquivalentObjectProperties(C D) ObjectProperty: S
SubPropertyChain: R1 o R2
brain.chain("R1 o R2", "S");
role transitivity R◦R⊑R TransitiveObjectProperty(R) ObjectProperty: R
Characteristics: Transitive
brain.transitive("R");