GO::IO::go_assoc(3pm)
π GO::IO::go_assoc β it's in the 3pm perl manual bestie π
okay so you found the GO::IO::go_assoc page in your perl docs and you're like "what is this" β don't worry, I got you. User Contributed Perl Documentation, and honestly? iconic of them.
β¨ NAME β¨
GO::IO::go_assoc β dump GO terms as OBD XML π«Ά
πΈ SYNOPSIS πΈ
my $apph = GO::AppHandle->connect(-d=>$go, -dbhost=>$dbhost);
my $term = $apph->get_term({acc=>00003677});
#### ">-" is STDOUT
my $out = new FileHandle(">-");
my $ga_out = GO::IO::go_assoc->new(-output=>$out);
$ga_out->write_term($term);
OR, if you're feeling a lil extra π :
my $apph = GO::AppHandle->connect(-d=>$go, -dbhost=>$dbhost);
my $graph = $apph->get_node_graph(-acc=>00003677, -depth=>2);
my $out = new FileHandle(">-");
my $ga_out = GO::IO::go_assoc->new(-output=>$out);
$ga_out->write_graph($graph);
π¦ DESCRIPTION π¦
It's a utility class, bestie. Its whole job is dumping GO terms as OBD XML. Currently, the whole flow is literally: you call start_document, then write_term for each term, then end_document. That's the vibe. That's the whole routine. periodt. β¨
π new π
Usage - my $ga_out = new GO::IO::go_assoc(-output=>$out);
Returns - Output emitter.
Args - Output FileHandle
Bestie this initializes the writer object. And listen β if you wanna write to standard out, do exactly this:
my $out = new FileHandle(">-"); my $ga_out = new GO::IO::go_assoc($out);
π cgi_header π
Usage - $ga_out->cgi_header;
Returns - None
Args - None
cgi_header prints the "Content-type: text/plain" statement. no cap. If you're creating a CGI script, you should call this before further action β like, before you do literally anything else. respect the order. π
π write_graph π
Usage - $ga_out->write_graph(-graph=>$graph);
Returns - None
Args -graph=>$graph,
-deep=>1 or 0, # optional, default 0.
-qualifier=>1 or 0, # optional, default 1.
-with=>1 or 0, # optional, default 1.
-object_name=>1 or 0, # optional, default 1.
-object_synonym=>1 or 0, # optional, default 1.
gives nothing back (None), takes all the flags above. note the defaults, they're sneaky: -deep defaults to 0, and -qualifier, -with, -object_name, and -object_synonym all default to 1. π
π write_term_list π
Usage - $ga_out->write_term_list();
Returns - None
Args -term_listref=>$term_listref,
-deep=>1 or 0, # optional, default 0.
-qualifier=>1 or 0, # optional, default 1.
-with=>1 or 0, # optional, default 1.
-object_name=>1 or 0, # optional, default 1.
-object_synonym=>1 or 0, # optional, default 1.
same deal, but you're handing it a -term_listref instead. Returns - None, args are the same lil family of flags with the exact same defaults. π
π write_term π
Usage - $ga_out->write_term();
Returns - None
Args -term=>$term,
-deep=>1 or 0, # optional, default 0.
-qualifier=>1 or 0, # optional, default 1.
-with=>1 or 0, # optional, default 1.
-object_name=>1 or 0, # optional, default 1.
-object_synonym=>1 or 0, # optional, default 1.
and finally the one you'll probably use every single time: -term=>$term, plus that same iconic squad of optional flags. -deep = 0, everything else = 1. returns None. that's it, that's the whole function. slay. π
π«Ά quick reminder bestie:--no wait. just remember-deepdefaults to0and the other four default to1. iykyk. don't come for me if you flip one and your XML looks different.
π that's the whole page!! π this gem came to you via perl v5.36.0, dated 2023-12-18, and it lives under GO::IO::go_assoc(3pm). go forth and dump those GO terms, main character. β¨π·π§
π¦ 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