OSID Logo
OSID Specifications
ontology package
Version 3.0.0
Release Candidate Preview
Interfaceosid.ontology.OntologyHierarchySession
Implementsosid.OsidSession
Description

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.

  • comparative view: ontology elements may be silently omitted or re-ordered
  • plenary view: provides a complete set or is an error condition
MethodgetOntologyHierarchyId
Description

Gets the hierarchy Id associated with this session.

Returnosid.id.Idthe hierarchy Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetOntologyHierarchy
Description

Gets the hierarchy associated with this session.

Returnosid.hierarchy.Hierarchythe hierarchy associated with this session
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanAccessOntologyHierarchy
Description

Tests if this user can perform hierarchy queries. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PERMISSION_DENIED. This is intended as a hint to an an application that may wish not to offer traversal operations to unauthorized users.

Returnboolean false if hierarchy traversal methods are not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoduseComparativeOntologyView
Description

The returns from the ontology methods may omit or translate elements based on this session, such as authorization, and not result in an error. This view is used when greater interoperability is desired at the expense of precision.

CompliancemandatoryThis method is must be implemented.
MethodusePlenaryOntologyView
Description

A complete view of the 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.

CompliancemandatoryThis method is must be implemented.
MethodgetRootOntologyIds
Description

Gets the root ontology Ids in this hierarchy.

Returnosid.id.IdListthe root ontology Ids
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetRootOntologies
Description

Gets the root ontologies in this ontology hierarchy.

Returnosid.ontology.OntologyListthe root ontologies
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method is must be implemented.
MethodhasParentOntologies
Description

Tests if the Ontology has any parents.

Parametersosid.id.IdontologyIdthe Id of an ontology
Returnboolean true if the ontology has parents, false otherwise
ErrorsNOT_FOUND ontologyId is not found
NULL_ARGUMENT ontologyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodisParentOfOntology
Description

Tests if an Id is a direct parent of an ontology.

Parametersosid.id.Ididan Id
osid.id.IdontologyIdthe Id of an ontology
Returnboolean true if this id is a parent of ontologyId, false otherwise
ErrorsNOT_FOUND ontologyId is not found
NULL_ARGUMENT id or ontologyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
Provider Notes

If id not found return false.

MethodgetParentOntologyIds
Description

Gets the parent Ids of the given ontology.

Parametersosid.id.IdontologyIdthe Id of an ontology
Returnosid.id.IdListthe parent Ids of the ontology
ErrorsNOT_FOUND ontologyId is not found
NULL_ARGUMENT ontologyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetParentOntologies
Description

Gets the parents of the given ontology.

Parametersosid.id.IdontologyIdthe Id of an ontology
Returnosid.ontology.OntologyListthe parents of the ontology
ErrorsNOT_FOUND ontologyId is not found
NULL_ARGUMENT ontologyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodisAncestorOfOntology
Description

Tests if an Id is an ancestor of an ontology.

Parametersosid.id.Ididan Id
osid.id.IdontologyIdthe Id of an ontology
Returnboolean true if this id is an ancestor of ontologyId, false otherwise
ErrorsNOT_FOUND ontologyId is not found
NULL_ARGUMENT id or ontologyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
Provider Notes

If id not found return false.

MethodhasChildOntologies
Description

Tests if an ontology has any children.

Parametersosid.id.IdontologyIdthe Id of an ontology
Returnboolean true if the ontologyId has children, false otherwise
ErrorsNOT_FOUND ontologyId is not found
NULL_ARGUMENT ontologyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodisChildOfOntology
Description

Tests if an ontology is a direct child of another.

Parametersosid.id.Ididan Id
osid.id.IdontologyIdthe Id of an ontology
Returnboolean true if the id is a child of ontologyId, false otherwise
ErrorsNOT_FOUND ontologyId is not found
NULL_ARGUMENT id or ontologyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
Provider Notes

If id not found return false.

MethodgetChildOntologyIds
Description

Gets the child Ids of the given ontology.

Parametersosid.id.IdontologyIdthe Id to query
Returnosid.id.IdListthe children of the ontology
ErrorsNOT_FOUND ontologyId is not found
NULL_ARGUMENT ontologyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetChildOntologies
Description

Gets the children of the given ontology.

Parametersosid.id.IdontologyIdthe Id to query
Returnosid.ontology.OntologyListthe children of the ontology
ErrorsNOT_FOUND ontologyId is not found
NULL_ARGUMENT ontologyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodisDescendantOfOntology
Description

Tests if an Id is a descendant of an ontology.

Parametersosid.id.Ididan Id
osid.id.IdontologyIdthe Id of an ontology
Returnboolean true if the id is a descendant of the ontologyId, false otherwise
ErrorsNOT_FOUND ontologyId is not found
NULL_ARGUMENT id or ontologyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
Provider Notes

If id is not found return false.

MethodgetOntologyNodeIds
Description

Gets a portion of the hierarchy for the given ontology.

Parametersosid.id.IdontologyIdthe Id to query
cardinalancestorLevelsthe maximum number of ancestor levels to include. A value of 0 returns no parents in the node.
cardinaldescendantLevelsthe maximum number of descendant levels to include. A value of 0 returns no children in the node.
booleanincludeSiblings true to include the siblings of the given node, false to omit the siblings
Returnosid.hierarchy.Nodean ontology node
ErrorsNOT_FOUND ontologyId is not found
NULL_ARGUMENT ontologyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetOntologyNodes
Description

Gets a portion of the hierarchy for the given ontology.

Parametersosid.id.IdontologyIdthe Id to query
cardinalancestorLevelsthe maximum number of ancestor levels to include. A value of 0 returns no parents in the node.
cardinaldescendantLevelsthe maximum number of descendant levels to include. A value of 0 returns no children in the node.
booleanincludeSiblings true to include the siblings of the given node, false to omit the siblings
Returnosid.ontology.OntologyNodean ontology node
ErrorsNOT_FOUND ontologyId is not found
NULL_ARGUMENT ontologyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.