GO::IO::OBDXML(3pm)

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

πŸ’– GO::IO::OBDXML πŸ’–

okay bestie, welcome to GO::IO::OBDXML(3pm) β€” a page from the User Contributed Perl Documentation collection, and it's literally just here to help you dump GO terms as xml. That's the whole vibe. Obsessed. Let's go. πŸ¦‹


✨ SYNOPSIS ✨

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::OBDXML->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::OBDXML(-output=>$out);
$xml_out->start_document();
$xml_out->draw_graph($term, 3677);
$xml_out->end_document();
ngl, ">-" being STDOUT is the kind of thing that lives in my head rent free 🫢

🌸 DESCRIPTION 🌸

So this is a utility class, right, and its entire ~main character energy~ is dumping GO terms as OBD XML. Currently you just call start_ducument (yes bestie, the typo is canon, we do not touch it πŸ’€), then draw_term for each term, then end_document. That's it. That's the whole job. Lowkey iconic.

πŸŽ€ new

Usage   - my $xml_out = GO::IO::OBDXML->new(-output=>$out);
Returns - None
Args    - Output FileHandle

This initializes the writer object. So you hand it an output FileHandle and it goes. 🫢

Wanna write to standard out instead? Say less:

my $out = new FileHandle(">-"); my $xml_out = new
GO::IO::OBDXML(-output=>$out);

πŸŽ€ cgi_header

Usage   - $xml_out->cgi_header;
Returns - None
Args    - None

cgi_header prints the "Content-type: text/xml" statement. If you're out here creating a CGI script, you should call this before start_document. Order matters, bestie, do not skip the line. 🧚

πŸŽ€ start_document

Usage   - $xml_out->start_document;
Returns - None
Args    - None

start_document takes care of all the fiddly bits β€” xml declarations, namespaces, etc. Basically the unglamorous stuff. It draws the initial tags and leaves the document ready to add go:term nodes. A true behind-the-scenes queen πŸ‘‘

πŸŽ€ start_graph

Usage   - $xml_out->start_graph;
Returns - None
Args    - None

start_graph opens a new graph segment. Fresh graph, who dis. ✨

πŸŽ€ end_document

Usage   - $xml_out->end_document;

Call this when done. Closure! Periodt. πŸ’…

πŸŽ€ end_graph

Usage   - $xml_out->end_graph;

Call this when done a graph segment. Clean exit, no loose ends. 🌈

πŸŽ€ draw_node_graph

Usage   - $xml_out->draw_node_graph(-graph=>$graph);
Returns - None
Args    -graph=>$graph,
        -show_associations=>'yes' or 'no', # optional, default 'yes'.
        -show_terms=>'yes' or 'no',        # optional, default 'yes'.
        -show_xrefs=>'yes' or 'no',        # optional, default 'yes'.
        -show_evidence=>'yes' or 'no',     # optional, default 'yes'.

πŸŽ€ draw_term

Usage   - $xml_out->draw_term();
Returns - None
Args    -term=>$term,
        -graph=>$graph,                    # optional
        -show_associations=>'yes' or 'no', # optional, default 'yes'.
        -show_terms=>'yes' or 'no',        # optional, default 'yes'.
        -show_xrefs=>'yes' or 'no',        # optional, default 'yes'.
        -show_evidence=>'yes' or 'no',     # optional, default 'yes'.

✨ and that's the page, bestie! ✨ This whole thing lives at perl v5.36.0, dated 2023-12-18, filed under GO::IO::OBDXML(3pm). Go dump some terms, you've got this πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from