public interface OntologyHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of
Ontology objects. Each node in the hierarchy is a unique
Ontology. The hierarchy may be traversed recursively to establish
the tree structure through getParentOntologies() and
getChildOntologies(). To relate these Ids to
another OSID, getOntologyNodes() can be used for retrievals
that can be used for bulk lookups in other OSIDs. Any Ontology
available in the Ontology OSID is known to this hierarchy but does
not appear in the hierarchy traversal until added as a root node or a
child of another node.
A user may not be authorized to traverse the entire hierarchy. Parts
of the hierarchy may be made invisible through omission from the returns
of getParentOntologies() or getChildOntologies()
in lieu of a PERMISSION_DENIED error that may
disrupt the traversal through authorized pathways.
This session defines views that offer differing behaviors when retrieving multiple objects.
| Modifier and Type | Method and Description |
|---|---|
boolean |
canAccessOntologyHierarchy()
Tests if this user can perform hierarchy queries.
|
OntologyList |
getChildOntologies(Id ontologyId)
Gets the children of the given ontology.
|
IdList |
getChildOntologyIds(Id ontologyId)
Gets the child
Ids of the given ontology. |
Hierarchy |
getOntologyHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getOntologyHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getOntologyNodeIds(Id ontologyId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given ontology.
|
OntologyNode |
getOntologyNodes(Id ontologyId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given ontology.
|
OntologyList |
getParentOntologies(Id ontologyId)
Gets the parents of the given ontology.
|
IdList |
getParentOntologyIds(Id ontologyId)
Gets the parent
Ids of the given ontology. |
OntologyList |
getRootOntologies()
Gets the root ontologies in this ontology hierarchy.
|
IdList |
getRootOntologyIds()
Gets the root ontology
Ids in this hierarchy. |
boolean |
hasChildOntologies(Id ontologyId)
Tests if an ontology has any children.
|
boolean |
hasParentOntologies(Id ontologyId)
Tests if the
Ontology has any parents. |
boolean |
isAncestorOfOntology(Id id,
Id ontologyId)
Tests if an
Id is an ancestor of an ontology. |
boolean |
isChildOfOntology(Id id,
Id ontologyId)
Tests if an ontology is a direct child of another.
|
boolean |
isDescendantOfOntology(Id id,
Id ontologyId)
Tests if an
Id is a descendant of an ontology. |
boolean |
isParentOfOntology(Id id,
Id ontologyId)
Tests if an
Id is a direct parent of an ontology. |
void |
useComparativeOntologyView()
The returns from the ontology methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenaryOntologyView()
A complete view of the
Hierarchy returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getOntologyHierarchyId()
Id associated with this session. Id associated with this sessionmandatory - This method must be implemented. Hierarchy getOntologyHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canAccessOntologyHierarchy()
PERMISSION_DENIED. This is intended as a hint to an
an application that may wish not to offer traversal operations to
unauthorized users. false if hierarchy traversal methods are not
authorized, true otherwisemandatory - This method must be implemented. void useComparativeOntologyView()
mandatory - This method is must be implemented. void usePlenaryOntologyView()
Hierarchy returns is desired.
Methods will return what is requested or result in an error. This view
is used when greater precision is desired at the expense of
interoperability.mandatory - This method is must be implemented. IdList getRootOntologyIds() throws OperationFailedException, PermissionDeniedException
Ids in this hierarchy. Ids OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. OntologyList getRootOntologies() throws OperationFailedException, PermissionDeniedException
OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method is must be implemented. boolean hasParentOntologies(Id ontologyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ontology has any parents.ontologyId - the Id of an ontology true if the ontology has parents, false
otherwiseNotFoundException - ontologyId is not
foundNullArgumentException - ontologyId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isParentOfOntology(Id id, Id ontologyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is a direct parent of an ontology.id - an Id ontologyId - the Id of an ontology true if this id is a parent of
ontologyId, false otherwiseNotFoundException - ontologyId is not
foundNullArgumentException - id or
ontologyId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id not found return false. IdList getParentOntologyIds(Id ontologyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids of the given ontology.ontologyId - the Id of an ontology Ids of the ontologyNotFoundException - ontologyId is not
foundNullArgumentException - ontologyId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. OntologyList getParentOntologies(Id ontologyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
ontologyId - the Id of an ontologyNotFoundException - ontologyId is not
foundNullArgumentException - ontologyId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isAncestorOfOntology(Id id, Id ontologyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is an ancestor of an ontology.id - an Id ontologyId - the Id of an ontology true if this id is an ancestor
of ontologyId, false otherwiseNotFoundException - ontologyId is not
foundNullArgumentException - id or
ontologyId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id not found return false. boolean hasChildOntologies(Id ontologyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
ontologyId - the Id of an ontology true if the ontologyId has
children, false otherwiseNotFoundException - ontologyId is not
foundNullArgumentException - ontologyId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isChildOfOntology(Id id, Id ontologyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id - an Id ontologyId - the Id of an ontology true if the id is a child of
ontologyId, false otherwiseNotFoundException - ontologyId is not
foundNullArgumentException - id or
ontologyId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id not found return false. IdList getChildOntologyIds(Id ontologyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids of the given ontology.ontologyId - the Id to queryNotFoundException - ontologyId is not
foundNullArgumentException - ontologyId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. OntologyList getChildOntologies(Id ontologyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
ontologyId - the Id to queryNotFoundException - ontologyId is not
foundNullArgumentException - ontologyId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isDescendantOfOntology(Id id, Id ontologyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is a descendant of an ontology.id - an Id ontologyId - the Id of an ontology true if the id is a descendant
of the ontologyId, false
otherwiseNotFoundException - ontologyId is not
foundNullArgumentException - id or
ontologyId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id is not found return false. Node getOntologyNodeIds(Id ontologyId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
ontologyId - the Id to queryancestorLevels - the maximum number of ancestor levels to
include. A value of 0 returns no parents in the node.descendantLevels - the maximum number of descendant levels to
include. A value of 0 returns no children in the node.includeSiblings - true to include the siblings of
the given node, false to omit the siblingsNotFoundException - ontologyId is not
foundNullArgumentException - ontologyId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. OntologyNode getOntologyNodes(Id ontologyId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
ontologyId - the Id to queryancestorLevels - the maximum number of ancestor levels to
include. A value of 0 returns no parents in the node.descendantLevels - the maximum number of descendant levels to
include. A value of 0 returns no children in the node.includeSiblings - true to include the siblings of
the given node, false to omit the siblingsNotFoundException - ontologyId is not
foundNullArgumentException - ontologyId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.