|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Ontology
An ontology.
This is just a set of Term objects, and a set of Triple objects describing relationships between these terms. This class does not itself contain any reasoning functionality. Ontology is a collection of facts, or axioms.
ComparableOntology
Nested Class Summary | |
---|---|
static class |
Ontology.Impl
A basic in-memory implementation of an ontology |
Field Summary | |
---|---|
static ChangeType |
TERM
|
static ChangeType |
TRIPLE
|
Method Summary | |
---|---|
boolean |
containsTerm(java.lang.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(java.lang.String name)
Create a new term in this ontology. |
Term |
createTerm(java.lang.String name,
java.lang.String description)
Create a new term in this ontology. |
Term |
createTerm(java.lang.String name,
java.lang.String description,
java.lang.Object[] synonyms)
Create a new term in this ontology. |
Triple |
createTriple(Term subject,
Term object,
Term predicate,
java.lang.String name,
java.lang.String description)
Creates a new Triple. |
Variable |
createVariable(java.lang.String name,
java.lang.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. |
java.lang.String |
getDescription()
Return a human-readable description of this ontology, or the empty string if none is available |
java.lang.String |
getName()
Return the name of this ontology |
OntologyOps |
getOps()
Return the associated OntologyOps. |
Term |
getTerm(java.lang.String name)
Fetch the term with the specified name. |
java.util.Set<Term> |
getTerms()
Return all the terms in this ontology |
java.util.Set<Triple> |
getTriples(Term subject,
Term object,
Term predicate)
Return all triples from this ontology which match the supplied pattern. |
Term |
importTerm(Term t,
java.lang.String localName)
Create a view of a term from another ontology. |
void |
setDescription(java.lang.String description)
set the description of this ontology |
void |
setName(java.lang.String name)
Set the name for this ontology |
Methods inherited from interface org.biojava.utils.Changeable |
---|
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener |
Field Detail |
---|
static final ChangeType TERM
static final ChangeType TRIPLE
Method Detail |
---|
java.lang.String getName()
void setName(java.lang.String name)
name
- - the namejava.lang.String getDescription()
void setDescription(java.lang.String description)
description
- java.util.Set<Term> getTerms()
Term getTerm(java.lang.String name) throws java.util.NoSuchElementException
name
- the name of the term
name
java.util.NoSuchElementException
- if no term exists with that namejava.util.Set<Triple> getTriples(Term subject, Term object, Term predicate)
null
,
they are treated as wildcards.
subject
- The subject to search for, or null
object
- The object to search for, or null
predicate
- The relationship to search for, or null
.
OntologyOps getOps()
Term createTerm(java.lang.String name) throws AlreadyExistsException, ChangeVetoException, java.lang.IllegalArgumentException
name
- The name of the term (must be unique))
java.lang.IllegalArgumentException
- if either name
or
description
is null
, or violates
some other constraint of this implementation.
AlreadyExistsException
- if a term of this name already exists
ChangeVetoException
Term createTerm(java.lang.String name, java.lang.String description) throws AlreadyExistsException, ChangeVetoException, java.lang.IllegalArgumentException
name
- The name of the term (must be unique)description
- A human-readable description (may be empty)
java.lang.IllegalArgumentException
- if either name
or
description
is null
, or violates
some other constraint of this implementation.
AlreadyExistsException
- if a term of this name already exists
ChangeVetoException
Term createTerm(java.lang.String name, java.lang.String description, java.lang.Object[] synonyms) throws AlreadyExistsException, ChangeVetoException, java.lang.IllegalArgumentException
name
- The name of the term (must be unique)description
- A human-readable description (may be empty)synonyms
- Some synonyms for this term.
java.lang.IllegalArgumentException
- if either name
or
description
is null
, or violates
some other constraint of this implementation.
AlreadyExistsException
- if a term of this name already exists
ChangeVetoException
Variable createVariable(java.lang.String name, java.lang.String description) throws AlreadyExistsException, ChangeVetoException, java.lang.IllegalArgumentException
name
- The name of the term (must be unique)description
- A human-readable description (may be empty)
java.lang.IllegalArgumentException
- if either name
or
description
is null
, or violates
some other constraint of this implementation.
AlreadyExistsException
- if a term of this name already exists
ChangeVetoException
Term importTerm(Term t, java.lang.String localName) throws ChangeVetoException, java.lang.IllegalArgumentException
t
- the Term to importlocalName
- the local name to import it under, optionally null
ChangeVetoException
java.lang.IllegalArgumentException
Triple createTriple(Term subject, Term object, Term predicate, java.lang.String name, java.lang.String description) throws AlreadyExistsException, ChangeVetoException
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
ChangeVetoException
java.lang.NullPointerException
- if subject, object or predicate are null
java.lang.IllegalArgumentException
- if subject, object or predicate are not all
from the same ontologyboolean containsTriple(Term subject, Term object, Term predicate)
subject
- object
- predicate
-
void deleteTerm(Term t) throws ChangeVetoException
t
-
ChangeVetoException
boolean containsTerm(java.lang.String name)
name
name
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |