GOBO::Graph
A collection of inter-related GOBO::Node objects. With a simple ontology these are typically GOBO::TermNode objects, although other graphs e.g. instance graphs are possible.
This module deliberately omits any kind of graph traversal functionality. This is done by an GOBO::InferenceEngine.
A GOBO::Graph consists of two collections: a node collection and a link collection. Both types of collection are handled behind the scenes using indexes (in future these can be transparently mapped to databases).
A graph keeps a reference of all nodes declared or referenced. We draw a distinction here: a graph can reference a node that is not declared in that graph. For example, consider an obo file with two stanzas:
id: x is_a: y id: y is_a: z
Here there are only two nodes declared (x and y) but there are a total of three references.
The noderef method can be used to access the full list of nodes that are either declared or referenced. This is useful to avoid instantiating multiple copies of the same object.
Methods such as terms, relations and instances return only those nodes declared to be in the graph
GOBO::Node
GOBO::LinkStatement
- returns ArrayRef[GOBO::Subset]
returns the subsets declared in this graph.
See also: GOBO::TermNode->subsets() - this returns the subsets a term belongs to
- Returns: ArrayRef[GOBO::TermNode], where each member is a term belonging to this graph
- Argument: id Str - Returns: GOBO::TermNode, if term is declared in this graph
- Argument: id Str - Returns: GOBO::RelationNode, if relation is declared in this graph
- Argument: id Str - Returns: GOBO::InstanceNode, if instance is declared in this graph
- Returns: ArrayRef[GOBO::RelationNode], where each member is a relation belonging to this graph
- Returns: ArrayRef[GOBO::InstanceNode], where each member is an instance belonging to this graph
- Arguments: Str or GOBO::Node - Returns: GOBO::TermNode - Side effects: adds the object to the list of terms referenced in this graph. Forces the class to be GOBO::TermNode
- Arguments: Str or GOBO::Node - Returns: GOBO::RelationNode - Side effects: adds the object to the list of relations referenced in this graph. Forces the class to be GOBO::RelationNode
- Arguments: Str or GOBO::Node - Returns: GOBO::InstanceNode
adds the object to the list of instances referenced in this graph. Forces the class to be GOBO::InstanceNode
- Arguments: node GOBO::Node, cascade Bool[OPT]
unlinks the node from this graph
If cascade is 0 or undef, any links to or from this node will remain as dangling links.
If cascade is set, then links to and from this node will also be deleted
given a subject (child), get target (parent) links
if relation is specified, also filters results on relation
- Argument: none - Returns: ArrayRef[GOBO::TermNode]
returns terms that lack an is_a parent
- Argument: relation Str or OBO::RelationNode [OPTIONAL] - Returns: ArrayRef[GOBO::TermNode]
returns terms that lack a parent by the given relation. If no relation specified, then returns terms that lack a parent by any relation
To install GOBO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GOBO
CPAN shell
perl -MCPAN -e shell install GOBO
For more information on module installation, please visit the detailed CPAN module installation guide.