[MOBY-guts] biomoby commit
Eddie Kawas
kawas at dev.open-bio.org
Thu Feb 21 17:15:40 UTC 2008
kawas
Thu Feb 21 12:15:40 EST 2008
Update of /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY
In directory dev.open-bio.org:/tmp/cvs-serv26411/Perl/MOBY-Server/lib/MOBY
Modified Files:
Async.pm MOBYXSLT.pm CrossReference.pm Central.pm
CommonSubs.pm
Log Message:
update of pod - found warnings when i ran podchecker so i am correcting them
moby-live/Perl/MOBY-Server/lib/MOBY Async.pm,1.1,1.2 MOBYXSLT.pm,1.1,1.2 CrossReference.pm,1.1,1.2 Central.pm,1.1,1.2 CommonSubs.pm,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Async.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Async.pm 2008/02/21 00:21:27 1.1
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Async.pm 2008/02/21 17:15:40 1.2
@@ -57,7 +57,7 @@
use SOAP::Transport::HTTP;
use MOBY::Async::WSRF;
use HelloWorld;
-
+
my $server = new SOAP::Transport::HTTP::CGI;
$server->serializer(WSRF::Serializer->new);
$server->deserializer(WSRF::Deserializer->new);
@@ -70,35 +70,35 @@
$server->handle();
B<HelloWorld.pm>
-
+
package HelloWorld;
use strict;
use MOBY::CommonSubs qw(:all);
use MOBY::Async::SimpleServer;
use vars qw(@ISA);
@ISA = qw(MOBY::Async::SimpleServer);
-
+
# This environment variable is necessary - it is used internally
# by MOBY::Async::SimpleServer class
$ENV{AUTHURI} = 'your.auth.com';
-
+
# This variable is a subroutine which carry out the core of the service
my $sayHello = sub {
my ($caller, $data) = @_;
my $response = '';
-
+
my @queries = getInputs($data);
return responseHeader($ENV{AUTHURI}).responseFooter() unless (scalar(@queries));
-
+
foreach my $query (@queries) {
my $queryID = getInputID($query);
$response .= simpleResponse('Hello, Asynchronous BioMOBY world!!!', 'message', $queryID);
sleep 60;
}
-
+
return SOAP::Data->value(responseHeader($ENV{AUTHURI}).$response.responseFooter())->type('string');
};
-
+
# This is the method that answers to synchronous requests
sub sayHello {
my $self = shift @_;
@@ -106,13 +106,13 @@
return $self->sync($sayHello, 180, @_);
#return $self->error(@_);
}
-
+
# This is the method that answers to asynchronous requests
sub sayHello_submit {
my $self = shift @_;
return $self->async($sayHello, @_);
}
-
+
1;
A client that wishes to run an asynchronous service as HelloWorld must carry out
@@ -173,5 +173,5 @@
MOBY::Async::WSRF Perl module documentation.
Asynchronous BioMOBY Services Specification.
-
+
=cut
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/MOBYXSLT.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/MOBYXSLT.pm 2008/02/21 00:21:27 1.1
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/MOBYXSLT.pm 2008/02/21 17:15:40 1.2
@@ -21,7 +21,7 @@
=head1 TO BE EDITED
Globals variables are defined in this package:
-
+
my $TMP_DIR = '/tmp/'; #Where your temporary files will be written
my $XSLTPROC = '/usr/bin/xsltproc'; #Where your xsltproc binary is located
my $XSL_SHEET = './parseMobyMessage.xsl'; #Where your xsltproc style-sheet is located
@@ -40,12 +40,12 @@
#Message Parsing
my ($service_notes,$ra_queries) = MOBYXSLT::getInputs($message); #Message Parsing
-
+
foreach my $query (@{$ra_queries})
{
my $query_id = MOBYXSLT::getInputID($query);#Retrieve Query ID
my @a_input_articles = MOBYXSLT::getArticles($query);#Retrieve articles
-
+
my ($fasta_sequences, $fasta_namespace, $fasta_id) = ('','','');
foreach my $input_article (@a_input_articles)
@@ -55,7 +55,7 @@
if (MOBYXSLT::isSimpleArticle($article))
{
my $object_type = MOBYXSLT::getObjectType($article);
-
+
if (IsTheCorrectType($object_type))
{
$fasta_sequences = MOBYXSLT::getObjectContent($article);
@@ -76,23 +76,23 @@
######
#What you want to do with your data
######
-
-
+
+
my $cmd ="...";
system("$cmd");
-
-
-
+
+
+
#########
#Send result
#########
-
+
$moby_response .= MOBYXSLT::simpleResponse("<$output_object_type1>$out_data</$output_object_type1>", $output_article_name1, $query_id);
}
-
-
+
+
return SOAP::Data->type(
'base64' => (MOBYXSLT::responseHeader(-authority => $auth_uri, -note => "Documentation about $service_name at $url_doc"))
. $moby_response
@@ -106,7 +106,7 @@
my $XSLTPROC = '/usr/bin/xsltproc'; #Where your xsltproc binary is located
my $XSL_SHEET = './parseMobyMessage.xsl'; #Where your xsltproc style-sheet is located
-
+
=head1 DESCRIPTION
Note: many functions have same names as those from MOBY::CommonSubs
@@ -781,7 +781,7 @@
'object_crossreference' => ARRAYREF of crossreferences objects
(each one is structured in a hash with fields
'type', 'id', 'namespace')
-
+
Returns : $rh_simple: article HASHREF
Args : $simple_bloc: from parsing of a "simple" XSLT transformation
Globals : none
@@ -1105,7 +1105,7 @@
sub complexResponse
{
my ($ra_data, $qID) = @_;
-
+
$ra_data ||= [];
$qID ||= '';
unless ((ref($ra_data) =~ /array/i) && $ra_data->[0])
@@ -1117,7 +1117,7 @@
{
my $article_name = $rh_data_block->{article_name};
my $article_content = $rh_data_block->{article_content};
-
+
if ($rh_data_block->{article_type} =~ /collection/i)
{
my $collection_content = "<moby:Collection moby:articleName='$article_name'>\n";
@@ -1133,9 +1133,9 @@
$collection_content .= "\t<moby:Simple/>\n";
}
$collection_content .= "</moby:Collection>\n";
-
+
$moby_data_content .= $collection_content;
-
+
}
else
{
@@ -1143,7 +1143,7 @@
$moby_data_content .= $simple_content;
}
}
-
+
return "<moby:mobyData moby:queryID='$qID'>\n\t$moby_data_content\n</moby:mobyData>\n";
}
@@ -1169,7 +1169,7 @@
B< caveat :>
B<notes:> returns everything required up to the response articles themselves. i.e. something like:
-
+
<?xml version='1.0' encoding='UTF-8'?>
<moby:MOBY xmlns:moby='http://www.biomoby.org/moby'>
<moby:Response moby:authority='http://www.illuminae.com'>
@@ -1222,7 +1222,7 @@
B<notes:> returns everything required to use for the responseHeader:
-
+
<moby:mobyException moby:refElement='input1' moby:refQueryID='1' moby:severity =''>
<moby:exceptionCode>600</moby:exceptionCode>
<moby:exceptionMessage>Unable to execute the service</moby:exceptionMessage>
@@ -1252,7 +1252,7 @@
usage : return responseHeader('illuminae.com') . $DATA . responseFooter;
notes : returns everything required after the response articles themselves
i.e. something like:
-
+
</moby:Response>
</moby:MOBY>
@@ -1393,7 +1393,7 @@
'object_crossreference' => ARRAYREF of crossreferences objects
(each one is structured in a hash with fields
'type', 'id', 'namespace')
-
+
Returns : $services_notes: article HASHREF
$ra_exceptions: article HASHREF
Args : $service_notes_bloc: from parsing of a "serviceNotes" XSLT transformation
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/CrossReference.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/CrossReference.pm 2008/02/21 00:21:27 1.1
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/CrossReference.pm 2008/02/21 17:15:40 1.2
@@ -11,6 +11,12 @@
=head1 SYNOPSIS
+ use MOBY::CrossReference;
+ # do stuff with xref ... read below
+
+
+=cut
+
=head1 DESCRIPTION
This holds all of the relevant information for a MOBY cross reference
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Central.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Central.pm 2008/02/21 00:21:27 1.1
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Central.pm 2008/02/21 17:15:40 1.2
@@ -105,7 +105,7 @@
my $NAMES_XML = MOBY::Central->retrieveObjectNames;
print $NAMES_XML;
# ... do something with the XML
-
+
----------------------------------------
@@ -175,10 +175,10 @@
success is a boolean indicating a
successful or a failed registration
-
+
id is the deregistration ID of your registered
object or service to use in a deregister call.
-
+
message will contain any additional information
such as the reason for failure.
@@ -1192,7 +1192,7 @@
=item * Collection note that articleName of the contained Simple objects is not required, and is ignored.
-
+
<Collection articleName="NameOfArticle">
<Simple>......</Simple> <!-- Simple parameter type structure -->
<Simple>......</Simple> <!-- DIFFERENT Simple parameter type (used only when multiple Object Classes appear in a collection) -->
@@ -1200,7 +1200,7 @@
=item * Secondary
-
+
<Parameter articleName="NameOfArticle">
<datatype>Integer|Float|String|DateTime</datatype>
<description><![CDATA[freetext description of purpose]]></description>
@@ -1846,7 +1846,7 @@
</findService>
ServiceQueryObject XML:
-
+
To query MOBY Central, you fill out the relevant elements of a Query Ojbect. These include the input and/or output data Classes (by name from the Class ontology), the Service-type (by name from the Service-type ontology), the authority (service provider URI), or any number of keywords that must appear in the service description.
=over 3
@@ -2506,7 +2506,7 @@
<retrieveService>
<Service authURI="authority.uri.here" serviceName="myServ"/>
<retrieveService>
-
+
outputXML (by category):
moby: <Service lsid='urn:lsid:...'><![CDATA[WSDL document here]]</Service>
@@ -2735,7 +2735,7 @@
Function : get the list of all registered relationship types in the given ontology
Returns : XML (see below)
Args : input XML (ontologies are 'object', 'service', 'namespace', 'relationship')
-
+
Input XML : <Ontology>OntologyName</Ontology>
Output XML:
<relationshipTypes>
@@ -2918,12 +2918,12 @@
Function : get the object xsd
Returns : XML (see below)
Args : $name - object name (from ontology) or "all" to get all objects
-
+
inputXML :
<retrieveObject>
<objectType>ObjectType | all</objectType>
</retrieveObject>
-
+
outputXML :
<Objects>
<Object name="namespace">
@@ -3004,7 +3004,7 @@
....
</Relationship>
</Relationships>
-
+
OR
<Relationships>
@@ -3897,21 +3897,21 @@
args : (see _serviceListResponse code above for full details of XML)
$InputXML - the <Input>...</Input> block of a findService
response message
-
+
$SecondaryXML - the <secondaryArticles>...<sescondaryArticles>
fragment of a findService response message
-
+
returns : XSD fragment of XML (should not return an XML header!)
notes : the structure of an Input block is as follows:
<Input>
<!-- one or more Simple or Collection articles -->
</Input>
-
+
the structure of a secondaryArticle block is as follows:
<sescondaryArticles>
<!-- one or more Parameter blocks -->
</secondaryArticles>
-
+
=over
@@ -3925,7 +3925,7 @@
=item * Collection note that articleName of the contained Simple objects is not required, and is ignored.
-
+
<Collection articleName="NameOfArticle">
<Simple>......</Simple> <!-- Simple parameter type structure -->
<Simple>......</Simple> <!-- DIFFERENT Simple parameter type
@@ -3935,7 +3935,7 @@
=item * Secondary
-
+
<Parameter articleName="NameOfArticle">
<datatype>INT|FLOAT|STRING</datatype>
<default>...</default> <!-- any/all of these -->
@@ -3963,10 +3963,10 @@
args : (see _serviceListResponse code above for full details)
$InputXML - the <Input>...</Input> block of a findService
response message
-
+
$SecondaryXML - the <secondaryArticles>...<sescondaryArticles>
fragment of a findService response message
-
+
returns : XSD fragment of XML (should not return an XML header!)
notes : the structure of an Output block is as follows:
<Input>
@@ -3985,7 +3985,7 @@
=item * Collection note that articleName of the contained Simple objects is not required, and is ignored.
-
+
<Collection articleName="NameOfArticle">
<Simple>......</Simple> <!-- Simple parameter type structure -->
<Simple>......</Simple> <!-- DIFFERENT Simple parameter type
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/CommonSubs.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/CommonSubs.pm 2008/02/21 00:21:27 1.1
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/CommonSubs.pm 2008/02/21 17:15:40 1.2
@@ -35,12 +35,12 @@
=head3 Services Returning Simples
my $resp = $SI->execute(XMLInputList => \@input_data);
-
+
my $responses = serviceResponseParser($resp); # returns MOBY objects
foreach my $queryID(keys %$responses){
$this_invocation = $responses->{$queryID}; # this is the <mobyData> block with this queryID
my $this_output = "";
-
+
if (my $data = $this_invocation->{'responseArticleName'}){ # whatever your articleName is...
# $data is a MOBY::Client::Simple|Collection|ParameterArticle
my ($namespace) = @{$data->namespaces};
@@ -53,14 +53,14 @@
# DO SOMETHING TO RESPOSE DATA HERE
###################
}
-
+
}
=head3 Services Returning Collections
my $resp = $SI->execute(XMLInputList => \@input_data);
-
+
my $responses = serviceResponseParser($resp); # returns MOBY objects
foreach my $queryID(keys %$responses){ # $inputs is a hashref of $input{queryid}->{articlename} = input object
my $this_invocation = $responses->{$queryID};
@@ -96,19 +96,19 @@
foreach my $queryID(keys %$inputs){
$this_invocation = $inputs->{$queryID}; # this is the <mobyData> block with this queryID
my $this_output = "";
-
+
if (my $input = $this_invocation->{incomingRequest}){
my ($namespace) = @{$input->namespaces};
my $id = $input->id;
my $XML_LibXML = $input->XML_DOM; # get access to the DOM
-
+
###################
# DO YOUR BUSINESS LOGIC HERE
###################
-
+
$this_output = "<moby:Object... rest of the output XML .../>";
}
-
+
$MOBY_RESPONSE .= simpleResponse(
$this_output
, "myArticleName" # the article name of that output object
@@ -162,7 +162,7 @@
sub getGoTerm {
-
+
use MOBY::CommonSubs qw{:all};
my ($caller, $incoming_message) = @_;
my $MOBY_RESPONSE; # holds the response raw XML
@@ -187,7 +187,7 @@
if (my $input = $this_invocation->{GO_id}){ # the articleName of your services input
my ($namespace) = @{$input->namespaces}; # this is returned as a list!
my $id = $input->id;
-
+
# optional - if we want to ENSURE that the incoming ID is in the GO namespace
# we can validate it using the validateThisNamespace routine of CommonSubs
# @validNS comes from validateNamespaces routine of CommonSubs (called above)
@@ -361,7 +361,7 @@
$inputs->{2b2}->{name1} = $MOBY::Client::Collection, # the <Collection> Block
$inputs->{2b2}->{cutoff} = $MOBY::Client::Secondary, # the <Parameter> Block
-
+
@@ -740,7 +740,7 @@
B< caveat :>
B<notes:> returns everything required up to the response articles themselves. i.e. something like:
-
+
<?xml version='1.0' encoding='UTF-8'?>
<moby:MOBY xmlns:moby='http://www.biomoby.org/moby'>
<moby:Response moby:authority='http://www.illuminae.com'>
@@ -793,7 +793,7 @@
B<notes:> returns everything required to use for the responseHeader:
-
+
<moby:mobyException moby:refElement='input1' moby:refQueryID='1' moby:severity =''>
<moby:exceptionCode>600</moby:exceptionCode>
<moby:exceptionMessage>Unable to execute the service</moby:exceptionMessage>
@@ -820,7 +820,7 @@
B<function:> print the XML string of a MOBY response footer
B<usage:>
-
+
return responseHeader('illuminae.com') . $DATA . responseFooter;
B<notes:> returns everything required after the response articles themselves i.e. something like:
@@ -1009,7 +1009,7 @@
<SomeObject namespace='' id=''>
<String namespace='' id='' articleName="SequenceString">TAGCTGATCGAGCTGATGCTGA </String>
</SomeObject>
-
+
my $seq = getNodeContentWithArticle($DOM, "String", "SequenceString");
print "yeah!" if $seq eq "TAGCTGATCGAGCTGATGCTGA";
More information about the MOBY-guts
mailing list