GO::IO::ObanOwl(3pm)

πŸ“¦
version 0.15 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸŽ€ 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