public static final class Ontology.Impl extends Object implements Ontology, Serializable
Ontology.Impl| Modifier and Type | Method and Description |
|---|---|
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)
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.
|
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<Term> |
getTerms()
Return all the terms in this ontology
|
Set<Triple> |
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.
|
void |
setDescription(String description)
set the description of this ontology
|
void |
setName(String name)
Set the name for this ontology
|
String |
toString() |
public String getName()
Ontologypublic String getDescription()
OntologygetDescription in interface Ontologypublic void setDescription(String description)
OntologysetDescription in interface Ontologypublic Set<Term> getTerms()
Ontologypublic Term getTerm(String name) throws NoSuchElementException
OntologygetTerm in interface Ontologyname - the name of the termnameNoSuchElementException - if no term exists with that namepublic Set<Triple> getTriples(Term subject, Term object, Term predicate)
Ontologynull,
they are treated as wildcards.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.public Term createTerm(String name) throws AlreadyExistsException, IllegalArgumentException
OntologycreateTerm in interface Ontologyname - The name of the term (must be unique))AlreadyExistsException - if a term of this name already existsIllegalArgumentException - if either name or
description is null, or violates
some other constraint of this implementation.public Term createTerm(String name, String description) throws AlreadyExistsException, IllegalArgumentException
OntologycreateTerm 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 existsIllegalArgumentException - if either name or
description is null, or violates
some other constraint of this implementation.public Term createTerm(String name, String description, Object[] synonyms) throws AlreadyExistsException, IllegalArgumentException
OntologycreateTerm 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 existsIllegalArgumentException - if either name or
description is null, or violates
some other constraint of this implementation.public Variable createVariable(String name, String description) throws AlreadyExistsException, IllegalArgumentException
OntologycreateVariable 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 existsIllegalArgumentException - if either name or
description is null, or violates
some other constraint of this implementation.public OntologyTerm createOntologyTerm(Ontology o) throws AlreadyExistsException
AlreadyExistsExceptionpublic Term importTerm(Term t, String name) throws IllegalArgumentException
OntologyimportTerm in interface Ontologyt - the Term to importname - the local name to import it under, optionally nullIllegalArgumentExceptionpublic void deleteTerm(Term t)
OntologydeleteTerm in interface Ontologypublic boolean containsTerm(String name)
OntologynamecontainsTerm in interface Ontologypublic boolean containsTriple(Term subject, Term object, Term predicate)
OntologycontainsTriple in interface Ontologypublic Triple createTriple(Term subject, Term object, Term predicate, String name, String description) throws AlreadyExistsException, IllegalArgumentException, NullPointerException, IllegalArgumentException
OntologycreateTriple 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 descriptionIllegalArgumentException - if subject, object or predicate are not all
from the same ontologyNullPointerException - if subject, object or predicate are nullpublic OntologyOps getOps()
OntologyCopyright © 2000–2016 BioJava. All rights reserved.