GO::IO::RDFXML(3pm)
β¨ GO::IO::RDFXML β¨
okay bestie, so this is GO::IO::RDFXML β it's a Perl module (you'll see it hanging out in section 3pm of the manual, iykyk π
) and its whole entire job is: dump GO terms as xml. that's it. that's the gig. π
πΈ SYNOPSIS πΈ
like, here's the vibe when you just wanna draw one single term:
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, if you're feeling a little extra and you want a whole node graph:
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();
β¨ yes the two blocks really are different. read them again. slay. β¨
π DESCRIPTION π
so basically this is a utility class whose entire purpose in life is to dump GO terms as xml. π¦
right now the flow is like, extremely simple: you call start_ducument, then you call draw_term for each term you've got, then you call end_document. that's the whole routine, no cap.
and if there's ever a need for it, the author says they'll add draw_node_graph, draw_node_list, etc. so like, watch this space bestie π
π«Ά new
Usage - my $xml_out = GO::IO::XML->new(-output=>$out);
Returns - None
Args - Output FileHandle
this is the one that initializes the writer object for you. β¨
and if you wanna write straight to standard out, do it like 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
okay so start_document prints the "Content-type: text/xml" statement. and if you're building a cgi script, you should call this one before start_document. do not skip it. that's the whole tip. π
π start_document
Usage - $xml_out->start_document(-timestamp=>$time);
Returns - None
Args - optional: timestamp string, pre-formatted
start_ducument handles all the fiddly bits for you β like xml declarations, namespaces, all that stuff nobody wants to hand-write. it draws the initial tags and then leaves the document ready and waiting for you to start adding go:term nodes. π¦
β end_document
Usage - $xml_out->end_document();
call this when you're done. periodt. π
π 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 around XML::Writer->characters, and what it does is strip out any non-ascii characters. that's it. little guy, important job. πΈ
π sub dataElement
and this one is simply a wrapper around XML::Writer->dataElement, which also strips out any non-ascii characters. same energy, different function. β¨
π heads up bestie: those-show_associations=>"yes" or "no"and-show_terms=>"yes" or "no"args are literally the strings"yes"or"no". not booleans. i know. i know. π
that's the whole page, bestie!! π«Ά written up by perl itself, perl v5.36.0, dated 2023-12-18, and it lives at GO::IO::RDFXML(3pm) β go forth and dump some GO terms as xml, you absolute icon ππ
π¦ 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