|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.utils.AbstractChangeable
org.biojava.ontology.Ontology.Impl
public static final class Ontology.Impl
A basic in-memory implementation of an ontology
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.biojava.ontology.Ontology |
---|
Ontology.Impl |
Field Summary |
---|
Fields inherited from interface org.biojava.ontology.Ontology |
---|
TERM, TRIPLE |
Constructor Summary | |
---|---|
Ontology.Impl(String name,
String description)
|
Method Summary | |
---|---|
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 |
OntologyTerm |
createOntologyTerm(Ontology o)
|
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. |
String |
getDescription()
Return a human-readable description of this ontology, or the empty string if none is available |
String |
getName()
Return the name of this ontology |
OntologyOps |
getOps()
Return the associated OntologyOps. |
Term |
getTerm(String name)
Fetch the term with the specified name. |
Set |
getTerms()
Return all the terms in this ontology |
Set |
getTriples(Term subject,
Term object,
Term predicate)
Return all triples from this ontology which match the supplied pattern. |
Term |
importTerm(Term t,
String name)
Create a view of a term from another ontology. |
String |
toString()
|
Methods inherited from class org.biojava.utils.AbstractChangeable |
---|
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.biojava.utils.Changeable |
---|
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener |
Constructor Detail |
---|
public Ontology.Impl(String name, String description)
Method Detail |
---|
public String getName()
Ontology
getName
in interface Ontology
public String getDescription()
Ontology
getDescription
in interface Ontology
public Set getTerms()
Ontology
getTerms
in interface Ontology
public Term getTerm(String name) throws NoSuchElementException
Ontology
getTerm
in interface Ontology
name
NoSuchElementException
- if no term exists with that namepublic Set getTriples(Term subject, Term object, Term predicate)
Ontology
null
,
they are treated as wildcards.
getTriples
in interface Ontology
subject
- The subject to search for, or null
object
- The object to search for, or null
predicate
- The relationship to search for, or null
.public Term createTerm(String name, String description) throws AlreadyExistsException, IllegalArgumentException, ChangeVetoException
Ontology
createTerm
in interface Ontology
name
- The name of the term (must be unique)description
- A human-readable description (may be empty)
AlreadyExistsException
- if a term of this name already exists
IllegalArgumentException
- if either name
or
description
is null
, or violates
some other constraint of this implementation.
ChangeVetoException
public Term createTerm(String name, String description, Object[] synonyms) throws AlreadyExistsException, IllegalArgumentException, ChangeVetoException
Ontology
createTerm
in interface Ontology
name
- 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 exists
IllegalArgumentException
- if either name
or
description
is null
, or violates
some other constraint of this implementation.
ChangeVetoException
public Variable createVariable(String name, String description) throws AlreadyExistsException, ChangeVetoException, IllegalArgumentException
Ontology
createVariable
in interface Ontology
name
- The name of the term (must be unique)description
- A human-readable description (may be empty)
AlreadyExistsException
- if a term of this name already exists
IllegalArgumentException
- if either name
or
description
is null
, or violates
some other constraint of this implementation.
ChangeVetoException
public OntologyTerm createOntologyTerm(Ontology o) throws AlreadyExistsException, ChangeVetoException
AlreadyExistsException
ChangeVetoException
public Term importTerm(Term t, String name) throws IllegalArgumentException, ChangeVetoException
Ontology
importTerm
in interface Ontology
t
- the Term to importname
- the local name to import it under, optionally null
IllegalArgumentException
ChangeVetoException
public void deleteTerm(Term t) throws ChangeVetoException
Ontology
deleteTerm
in interface Ontology
ChangeVetoException
public boolean containsTerm(String name)
Ontology
name
containsTerm
in interface Ontology
public boolean containsTriple(Term subject, Term object, Term predicate)
Ontology
containsTriple
in interface Ontology
public Triple createTriple(Term subject, Term object, Term predicate, String name, String description) throws AlreadyExistsException, IllegalArgumentException, ChangeVetoException, NullPointerException, IllegalArgumentException
Ontology
createTriple
in interface Ontology
subject
- the subject Termobject
- the object Termpredicate
- the predicate Termname
- the name of the triple, or nulldescription
- the description of the triple, or null
AlreadyExistsException
- if a triple already exists with the same
subject, object and predicate, regardless of the name and description
IllegalArgumentException
- if subject, object or predicate are not all
from the same ontology
ChangeVetoException
NullPointerException
- if subject, object or predicate are nullpublic OntologyOps getOps()
Ontology
getOps
in interface Ontology
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |