## org.biojavax.ontology
Interface ComparableOntology

All Superinterfaces:
  Changeable, Comparable, Ontology

All Known Implementing Classes:
  SimpleComparableOntology

    public interface ComparableOntology

extends Ontology, Comparable, Changeable

An Ontology that can be compared to another.

Since:
  1.5
Author:
  Richard Holland
See Also:
  `ComparableTerm`, `ComparableTriple`

Nested Class Summary

Nested classes/interfaces inherited from interface org.biojava.ontology.Ontology
`Ontology.Impl`

Field Summary
`static ChangeType` `DESCRIPTION`
`static ChangeType` `TERM`
`static ChangeType` `TRIPLE`

Method Summary
`String` `getDescription()` Return a human-readable description of this ontology.
`ComparableTerm` `getOrCreateTerm(String name)` Looks for a term with the given name and returns it.
`ComparableTriple` `getOrCreateTriple(Term subject, Term object, Term predicate)` Looks for a triple with the given subject object and predicate and returns it.
`ComparableTerm` `getOrImportTerm(Term term)` Looks for a term with the same name as the given term and returns it.
`Set` `getTermSet()` Returns the set of terms in this ontology.
`Set` `getTripleSet()` Returns the set of triples in this ontology.
`void` `setDescription(String description)` Sets a human-readable description of this ontology.
`void` `setTermSet(Set terms)` Clears out all the terms and populates the ontology with the contents of the set passed.
`void` `setTripleSet(Set triples)` Clears out all the triples and populates the ontology with the contents of the set passed.

Methods inherited from interface org.biojava.ontology.Ontology
`containsTerm, containsTriple, createTerm, createTerm, createTerm, createTriple, createVariable, deleteTerm, getName, getOps, getTerm, getTerms, getTriples, importTerm, setName`

Methods inherited from interface org.biojava.utils.Changeable
`addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener`

Methods inherited from interface java.lang.Comparable
`compareTo`

Field Detail

### TERM

    static final ChangeType TERM

### TRIPLE

    static final ChangeType TRIPLE

### DESCRIPTION

    static final ChangeType DESCRIPTION

Method Detail

### setDescription

    void setDescription(String description)
                        throws ChangeVetoException

  Sets a human-readable description of this ontology.

  Specified by:
    `setDescription` in interface `Ontology`
  Parameters:
    `description` - the description.
  Throws:
    `ChangeVetoException` - in case of problems.

### getDescription

    String getDescription()

  Return a human-readable description of this ontology.

  Specified by:
    `getDescription` in interface `Ontology`
  Returns:
    the description.

### setTermSet

    void setTermSet(Set terms)
                    throws ChangeVetoException

  Clears out all the terms and populates the ontology with the contents of the set passed. The terms should be ComparableTerms.

  Parameters:
    `terms` - a set of Term objects this ontology should have.
  Throws:
    `ChangeVetoException` - if any of them are unacceptable.
  See Also:
    `ComparableTerm`

### getTermSet

    Set getTermSet()

  Returns the set of terms in this ontology.

  Returns:
    a set of ComparableTerm objects.
  See Also:
    `ComparableTerm`

### setTripleSet

    void setTripleSet(Set triples)
                      throws ChangeVetoException

  Clears out all the triples and populates the ontology with the contents of the set passed.

  Parameters:
    `triples` - the set of ComparableTriple objects this ontology should have.
  Throws:
    `ChangeVetoException` - if any of them are unacceptable.
  See Also:
    `ComparableTriple`

### getTripleSet

    Set getTripleSet()

  Returns the set of triples in this ontology.

  Returns:
    the set of ComparableTriple objects.

### getOrCreateTerm

    ComparableTerm getOrCreateTerm(String name)

  Looks for a term with the given name and returns it. If it couldn't be found, then it creates it, adds it to the ontology, then returns it.

  Parameters:
    `name` - the name of the term to look for.
  Returns:
    the ComparableTerm representing that name.

### getOrCreateTriple

    ComparableTriple getOrCreateTriple(Term subject,
                                       Term object,
                                       Term predicate)

  Looks for a triple with the given subject object and predicate and returns it. If it couldn't be found, then it creates it, adds it to the ontology, then returns it.

  Parameters:
    `subject` - the subject of the triple eg apple
    `object` - the object of the triple eg fruit
    `predicate` - the relationship of the triple eg is_a
  Returns:
    the ComparableTriple representing the object subject and predicate.

### getOrImportTerm

    ComparableTerm getOrImportTerm(Term term)

  Looks for a term with the same name as the given term and returns it. If it couldn't be found, then it creates it, adds it to the ontology, then returns it.

  Parameters:
    `term` - the term to look for.
  Returns:
    the ComparableTerm representing that term in this ontology.