GO::IO::ObanOwl(3pm)
π GO::IO::ObanOwl π
okay bestie, so this page is all about GO::IO::ObanOwl β she dumps GO terms as xml π (3pm manual, User Contributed Perl Documentation, if you were wondering who wrote the docs. It's giving community. It's giving us.)
β¨ SYNOPSIS β¨
like, the whole entire vibe in one look:
my $apph = GO::AppHandle->connect(-d=>$go, -dbhost=>$dbhost);
my $term = $apph->get_term({acc=>00003677});
#### ">-" is STDOUT
my $out = new FileHandle(">-");
my $xml_out = GO::IO::XML->new(-output=>$out);
$xml_out->start_document();
$xml_out->draw_term($term);
$xml_out->end_document();
OR:
my $apph = GO::AppHandle->connect(-d=>$go, -dbhost=>$dbhost);
my $term = $apph->get_node_graph(-acc=>00003677, -depth=>2);
my $out = new FileHandle(">-");
my $xml_out = GO::IO::XML(-output=>$out);
$xml_out->start_document();
$xml_out->draw_node_graph($term, 3677);
$xml_out->end_document();
πΈ DESCRIPTION πΈ
she's a utility class, bestie. her whole job is dumping GO terms as xml. currently β as in right now, today, this era β the routine is: you call start_ducument, then draw_term for each term, then end_document. that's the whole choreography π©°
and if there's a need, the author says they'll add draw_node_graph, draw_node_list, etc. so like... potentially more methods incoming. watch this space β¨
yes queen, that really does say start_ducument. that's the spelling on the page. love that journey for her π
π new
Usage - my $xml_out = GO::IO::XML->new(-output=>$out);
Returns - None
Args - Output FileHandle
this is what initializes the writer object. no cap, that's it. π«Ά
and if you wanna write to standard out, you do this:
my $out = new FileHandle(">-"); my $xml_out = new
GO::IO::XML(-output=>$out);
π xml_header
Usage - $xml_out->xml_header;
Returns - None
Args - None
start_document prints the "Content-type: text/xml" statement. and if you're making a cgi script, you should call this one before start_document. order matters, bestie, don't do it backwards π
π start_document
Usage - $xml_out->start_document(-timestamp=>$time);
Returns - None
Args - optional: timestamp string, pre-formatted
start_ducument handles all the fiddly bits β xml declarations, namespaces, the whole lil' production π she draws the initial tags and leaves the document all ready for you to start adding go:term nodes. main character energy, honestly.
π end_document
Usage - $xml_out->end_document();
call this when you're done. that's the whole instruction. iconic brevity β¨
π draw_node_graph
Usage - $xml_out->draw_node_graph(-graph=>$graph);
Returns - None
Args -graph=>$node_graph,
-focus=>$acc, ## optional
-show_associations=>"yes" or "no" ## optional
π draw_term
Usage - $xml_out->draw_term();
Returns - None
Args -term=>$term,
-graph=>$graph,
-is_focus=>"yes" or "no", ## optional
-show_associations=>"yes" or "no", ## optional
-show_terms=>"yes" or "no", ## optional, just draws associations
π¦ sub characters
this one is simply a wrapper to XML::Writer->characters which strips out any non-ascii characters. bye bye weird bytes π
π¦ sub dataElement
this one is simply a wrapper to XML::Writer->dataElement which strips out any non-ascii characters. same energy, different method π
and that's the whole page, bestie!! π thanks for reading, ily, go write some xml π
perl v5.36.0 Β· 2023-12-18 Β· GO::IO::ObanOwl(3pm) πβ¨π¦
π¦ where this page comes from
- debian trixie: libgo-perl 0.15-10 Β· Perl
- ubuntu noble: libgo-perl 0.15-10 Β· Perl
- ubuntu resolute: libgo-perl 0.15-10 Β· Perl
- ubuntu stonking: libgo-perl 0.15-10 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms