public class SimpleComparableOntology extends AbstractChangeable implements ComparableOntology
Ontology.ImplDESCRIPTION, TERM, TRIPLE| Modifier | Constructor and Description | 
|---|---|
protected  | 
SimpleComparableOntology()  | 
  | 
SimpleComparableOntology(String name)
Creates a new instance of SimpleComparableOntology with the given,
 immutable, non-nullable name. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
int | 
compareTo(Object o)
 Ontologies are compared only by name. 
 | 
boolean | 
containsTerm(String name)
Determines if this ontology currently contains a term named  
name | 
boolean | 
containsTriple(Term subject,
                            Term object,
                            Term predicate)
See if a triple exists in this ontology 
 | 
Term | 
createTerm(String name)
Create a new term in this ontology. 
 | 
Term | 
createTerm(String name,
                    String description)
Create a new term in this ontology. 
 | 
Term | 
createTerm(String name,
                    String description,
                    Object[] synonyms)
Create a new term in this ontology. 
 | 
Triple | 
createTriple(Term subject,
                        Term object,
                        Term predicate,
                        String name,
                        String description)
Creates a new Triple. 
 | 
Variable | 
createVariable(String name,
                            String description)
Create a new term in this ontology that is used as a variable. 
 | 
void | 
deleteTerm(Term t)
Remove a term from an ontology, together with all triples which refer to it. 
 | 
boolean | 
equals(Object obj)
 Ontologies are equal if their names are equal. 
 | 
String | 
getDescription()
Return a human-readable description of this ontology. 
 | 
Integer | 
getId()
Gets the Hibernate ID. 
 | 
String | 
getName()
Return the name of this ontology 
 | 
OntologyOps | 
getOps()
Return the associated OntologyOps. 
 | 
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. 
 | 
Term | 
getTerm(String s)
Fetch the term with the specified name. 
 | 
Set | 
getTerms()
Return all the terms in this ontology 
 | 
Set | 
getTermSet()
Returns the set of terms in this ontology. 
 | 
Set | 
getTriples(Term subject,
                    Term object,
                    Term predicate)
Return all triples from this ontology which match the supplied
 pattern. 
 | 
Set | 
getTripleSet()
Returns the set of triples in this ontology. 
 | 
int | 
hashCode() | 
Term | 
importTerm(Term t,
                    String localName)
Create a view of a term from another ontology. 
 | 
void | 
setDescription(String description)
Sets a human-readable description of this ontology. 
 | 
void | 
setId(Integer id)
Sets the Hibernate ID. 
 | 
void | 
setName(String name)
Set the name for 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. 
 | 
String | 
toString()
 Form: "name" 
 | 
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerpublic SimpleComparableOntology(String name)
name - the name of the ontology.protected SimpleComparableOntology()
public int compareTo(Object o)
compareTo in interface Comparablepublic boolean containsTerm(String name)
namecontainsTerm in interface Ontologypublic Term getTerm(String s) throws NoSuchElementException
getTerm in interface Ontologys - the name of the termnameNoSuchElementException - if no term exists with that namepublic ComparableTerm getOrCreateTerm(String name)
getOrCreateTerm in interface ComparableOntologyname - the name of the term to look for.public ComparableTriple getOrCreateTriple(Term subject, Term object, Term predicate)
getOrCreateTriple in interface ComparableOntologysubject - the subject of the triple eg appleobject - the object of the triple eg fruitpredicate - the relationship of the triple eg is_apublic ComparableTerm getOrImportTerm(Term term)
getOrImportTerm in interface ComparableOntologyterm - the term to look for.public Term createTerm(String name, String description, Object[] synonyms) throws AlreadyExistsException, ChangeVetoException, IllegalArgumentException
createTerm in interface Ontologyname - The name of the term (must be unique)description - A human-readable description (may be empty)synonyms - Some synonyms for this term.AlreadyExistsException - if a term of this name already existsChangeVetoExceptionIllegalArgumentException - if either name or
         description is null, or violates
         some other constraint of this implementation.public Term importTerm(Term t, String localName) throws ChangeVetoException, IllegalArgumentException
importTerm in interface Ontologyt - the Term to importlocalName - the local name to import it under, optionally nullChangeVetoExceptionIllegalArgumentExceptionComparableTermpublic Triple createTriple(Term subject, Term object, Term predicate, String name, String description) throws AlreadyExistsException, ChangeVetoException
createTriple in interface Ontologysubject - the subject Termobject - the object Termpredicate - the predicate Termname - the name of the triple, or nulldescription - the description of the triple, or nullAlreadyExistsException - if a triple already exists with the same
      subject, object and predicate, regardless of the name and descriptionChangeVetoExceptionComparableTermpublic void deleteTerm(Term t) throws ChangeVetoException
deleteTerm in interface OntologyChangeVetoExceptionComparableTermpublic Set getTriples(Term subject, Term object, Term predicate)
null,
 they are treated as wildcards.
 If you call this method with plain Terms instead of ComparableTerms, it may
 not match any of the triples in the ontology as they are all stored as 
 ComparableTerms. So, use ComparableTerm objects! The set returned is a set
 of ComparableTriple objects.getTriples in interface Ontologysubject - The subject to search for, or nullobject - The object to search for, or nullpredicate - The relationship to search for, or null.ComparableTerm, 
ComparableTriplepublic void setTripleSet(Set triples) throws ChangeVetoException
setTripleSet in interface ComparableOntologytriples - the set of ComparableTriple objects this ontology should have.ChangeVetoException - if any of them are unacceptable.ComparableTriplepublic Set getTripleSet()
getTripleSet in interface ComparableOntologypublic Set getTerms()
getTerms in interface OntologyComparableTermpublic void setTermSet(Set terms) throws ChangeVetoException
setTermSet in interface ComparableOntologyterms - a set of Term objects this ontology should have.ChangeVetoException - if any of them are unacceptable.ComparableTermpublic Set getTermSet()
getTermSet in interface ComparableOntologyComparableTermpublic boolean containsTriple(Term subject, Term object, Term predicate)
containsTriple in interface OntologyComparableTerm, 
ComparableTriplepublic Term createTerm(String name) throws AlreadyExistsException, ChangeVetoException, IllegalArgumentException
createTerm in interface Ontologyname - The name of the term (must be unique))AlreadyExistsException - if a term of this name already existsChangeVetoExceptionIllegalArgumentException - if either name or
         description is null, or violates
         some other constraint of this implementation.public Term createTerm(String name, String description) throws AlreadyExistsException, ChangeVetoException, IllegalArgumentException
createTerm in interface Ontologyname - The name of the term (must be unique)description - A human-readable description (may be empty)AlreadyExistsException - if a term of this name already existsChangeVetoExceptionIllegalArgumentException - if either name or
         description is null, or violates
         some other constraint of this implementation.public Variable createVariable(String name, String description) throws AlreadyExistsException, ChangeVetoException, IllegalArgumentException
createVariable in interface Ontologyname - The name of the term (must be unique)description - A human-readable description (may be empty)AlreadyExistsException - if a term of this name already existsChangeVetoExceptionIllegalArgumentException - if either name or
         description is null, or violates
         some other constraint of this implementation.public String getDescription()
getDescription in interface OntologygetDescription in interface ComparableOntologypublic void setDescription(String description) throws ChangeVetoException
setDescription in interface OntologysetDescription in interface ComparableOntologydescription - the description.ChangeVetoException - in case of problems.public void setName(String name)
Ontologypublic OntologyOps getOps()
public Integer getId()
Copyright © 2014 BioJava. All rights reserved.