[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Tue Jul 1 15:00:48 UTC 2003
mwilkinson
Tue Jul 1 11:00:48 EDT 2003
Update of /home/repository/moby/moby-live/Perl/MOBY/Client
In directory pub.open-bio.org:/tmp/cvs-serv18230/MOBY/Client
Modified Files:
Central.pm ServiceInstance.html ServiceInstance.pm
Added Files:
CollectionArticle.html CollectionArticle.pm SimpleArticle.html
SimpleArticle.pm
Log Message:
ServiceInstance now returns one of two new object types - Simple and Collection article objects (see documentation) rather than strings in response to the ->input and ->ouptut method calls. Client is updated to read this properly (I hope). This should make it much easier to determine the inputs and outputs of a service... no XML parsing required :-)
moby-live/Perl/MOBY/Client CollectionArticle.html,NONE,1.1 CollectionArticle.pm,NONE,1.1 SimpleArticle.html,NONE,1.1 SimpleArticle.pm,NONE,1.1 Central.pm,1.38,1.39 ServiceInstance.html,1.2,1.3 ServiceInstance.pm,1.4,1.5
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2003/06/23 21:58:45 1.38
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2003/07/01 15:00:47 1.39
@@ -8,6 +8,9 @@
use XML::DOM;
use MOBY::Client::ServiceInstance;
use MOBY::Client::Registration;
+use MOBY::Client::SimpleArticle;
+use MOBY::Client::CollectionArticle;
+
use vars qw($AUTOLOAD @ISA $MOBY_server $MOBY_uri);
=head1 NAME
@@ -1276,44 +1279,6 @@
return $return;
}
-
-#
-#
-#sub ISA {
-# my ($self)= shift;
-# my ($obj) = shift;
-# my ($reg) = shift;
-# return undef unless $obj;
-# my $message = "
-# <ISA>
-# <objectType>$obj</objectType>
-# </ISA>";
-#
-# $reg =$reg?$reg:$self->default_MOBY_servername;
-# return undef unless ($self->SOAP_connection($reg));
-# my $return = $self->SOAP_connection($reg)->call('ISA' => ($message))->paramsall;
-# #<Relationships>
-# # <objectType>QueryObject</objectType>
-# # <ISA>
-# # <objectType>ParentObject</objectType>
-# # ...
-# # ...
-# # </ISA>
-# # <HASA>
-# # <objectType>ContainedObject</objectType>
-# # ...
-# # ...
-# # </HASA>
-# #</Relationships>
-# my $parser = new XML::DOM::Parser;
-# my $doc = $parser->parse($return);
-# my $root = $doc->getDocumentElement;
-# my @ISAs = &_nodeArrayContent($doc, "ISA");
-# my @HASA = &_nodeArrayContent($doc, "HASA");
-# return (\@ISAs, \@HASA);
-#}
-#
-
sub _parseServices {
my ($self, $Registry, $XML) = @_;
my $Parser = new XML::DOM::Parser;
@@ -1327,16 +1292,43 @@
my $AuthURI = $Service->getAttributeNode('authURI')->getValue;
my $servicename = $Service->getAttributeNode('serviceName')->getValue;
my $Type = &_nodeTextContent($Service, 'serviceType');
- my $Output = &_nodeTextContent($Service, 'outputObject');
+ #my $Output = &_nodeTextContent($Service, 'outputObject');
my $Description = &_nodeTextContent($Service, 'Description');
my $cat = &_nodeTextContent($Service, 'Category');
+
+ my @INPUTS;
+ my @OUTPUTS;
+
+ foreach my $inout("Input", "Output"){
+ my $xPuts = $Service->getElementsByTagName("Input"); # there should only be one, but... who knows what
+ for my $in(0..$xPuts->getLength-1){
+ my $current = $xPuts->item($in);
+
+ foreach my $child($current->getChildNodes){ # child nodes will be either "Simple" or "Complex" tagnames
+ my $THIS;
+ if ($child->getTagName eq "Simple"){
+ $THIS = MOBY::Client::SimpleArticle->new(XML_DOM => $child);
+ } elsif ($child->getTagName eq "Collection"){
+ $THIS = MOBY::Client::CollectionArticle->new(XML_DOM => $child);
+ } else {
+ next
+ }
+ if ($inout eq "Input"){
+ push @INPUTS, $THIS;
+ } else {
+ push @OUTPUTS, $THIS;
+ }
+ }
+ }
+ }
my $Instance = MOBY::Client::ServiceInstance->new(
authority => $AuthURI,
name => $servicename,
type => $Type,
category => $cat,
- output => $Output,
+ input => \@INPUTS,
+ output => \@OUTPUTS,
description => $Description,
registry => $Registry,
XML => $Service->toString,
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html 2003/06/11 20:36:59 1.2
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html 2003/07/01 15:00:47 1.3
@@ -23,6 +23,7 @@
<li><a href="#authority">authority</a></li>
<li><a href="#name">name</a></li>
<li><a href="#type">type</a></li>
+ <li><a href="#input">input</a></li>
<li><a href="#output">output</a></li>
<li><a href="#description">description</a></li>
<li><a href="#registry">registry</a></li>
@@ -83,8 +84,10 @@
the name of the service
type : required : string : default NULL
the type of service from ontology
- output : required : string : default NULL
- the type of output object from ontology
+ input : required : listref : default empty listref
+ the SimpleArticle and CollectionArticle inputs for the service
+ output : required : listref : default empty listref
+ the SimpleArticle and CollectionArticle outputs for the service
description : required : string : default NULL
human-readable description of service</pre>
<p>
@@ -92,7 +95,8 @@
<h2><a name="authority">authority</a></h2>
<pre>
Title : authority
- Usage : $URI = $Service->authority([$URI])
+ Usage : $URI = $Service->authority($arg)
+ Args : (optional) scalar string with authority URI
Function : get/set authority
Returns : string</pre>
<p>
@@ -100,7 +104,8 @@
<h2><a name="name">name</a></h2>
<pre>
Title : name
- Usage : $name = $Service->name([$name])
+ Usage : $name = $Service->name($arg)
+ Args : (optional) scalar string with service name
Function : get/set name
Returns : string</pre>
<p>
@@ -108,23 +113,37 @@
<h2><a name="type">type</a></h2>
<pre>
Title : type
- Usage : $type = $Service->type([$type])
+ Usage : $type = $Service->type($arg)
+ Args : (optional) scalar string with servivce type ontology term
Function : get/set type
Returns : string</pre>
<p>
</p>
+<h2><a name="input">input</a></h2>
+<pre>
+ Title : output
+ Usage : $output = $Service->output($args)
+ Args : (optional) listref of SimpleArticle and/or CollectionArticle objects
+ Function : get/set output
+ Returns : listref of MOBY::Client::SimpleArticle
+ and/or MOBY::Client::CollectionArticle objects</pre>
+<p>
+</p>
<h2><a name="output">output</a></h2>
<pre>
Title : output
- Usage : $output = $Service->output([$output])
+ Usage : $output = $Service->output($args)
+ Args : (optional) listref of SimpleArticle and/or CollectionArticle objects
Function : get/set output
- Returns : string</pre>
+ Returns : listref of MOBY::Client::SimpleArticle
+ and/or MOBY::Client::CollectionArticle objects</pre>
<p>
</p>
<h2><a name="description">description</a></h2>
<pre>
Title : description
- Usage : $description = $Service->description([$description])
+ Usage : $description = $Service->description($arg)
+ Args : (optional) scalar string with description
Function : get/set description
Returns : string</pre>
<p>
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm 2003/06/11 20:36:59 1.4
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm 2003/07/01 15:00:47 1.5
@@ -1,8 +1,4 @@
-#!/usr/bin/perl -w
-
package MOBY::Client::ServiceInstance;
-use SOAP::Lite;
-#use SOAP::Lite + trace; # for debugging
use strict;
use Carp;
use XML::DOM;
@@ -60,8 +56,10 @@
the name of the service
type : required : string : default NULL
the type of service from ontology
- output : required : string : default NULL
- the type of output object from ontology
+ input : required : listref : default empty listref
+ the SimpleArticle and CollectionArticle inputs for the service
+ output : required : listref : default empty listref
+ the SimpleArticle and CollectionArticle outputs for the service
description : required : string : default NULL
human-readable description of service
@@ -71,7 +69,8 @@
=head2 authority
Title : authority
- Usage : $URI = $Service->authority([$URI])
+ Usage : $URI = $Service->authority($arg)
+ Args : (optional) scalar string with authority URI
Function : get/set authority
Returns : string
@@ -80,7 +79,8 @@
=head2 name
Title : name
- Usage : $name = $Service->name([$name])
+ Usage : $name = $Service->name($arg)
+ Args : (optional) scalar string with service name
Function : get/set name
Returns : string
@@ -89,25 +89,40 @@
=head2 type
Title : type
- Usage : $type = $Service->type([$type])
+ Usage : $type = $Service->type($arg)
+ Args : (optional) scalar string with servivce type ontology term
Function : get/set type
Returns : string
=cut
+=head2 input
+
+ Title : output
+ Usage : $output = $Service->output($args)
+ Args : (optional) listref of SimpleArticle and/or CollectionArticle objects
+ Function : get/set output
+ Returns : listref of MOBY::Client::SimpleArticle
+ and/or MOBY::Client::CollectionArticle objects
+
+=cut
+
=head2 output
Title : output
- Usage : $output = $Service->output([$output])
+ Usage : $output = $Service->output($args)
+ Args : (optional) listref of SimpleArticle and/or CollectionArticle objects
Function : get/set output
- Returns : string
+ Returns : listref of MOBY::Client::SimpleArticle
+ and/or MOBY::Client::CollectionArticle objects
=cut
=head2 description
Title : description
- Usage : $description = $Service->description([$description])
+ Usage : $description = $Service->description($arg)
+ Args : (optional) scalar string with description
Function : get/set description
Returns : string
@@ -134,7 +149,8 @@
authority => [undef, 'read/write'],
name => [undef, 'read/write'],
type => [undef, 'read/write'],
- output => [undef, 'read/write'],
+ input => [[], 'read/write'], # listref of Simple and Collection articles
+ output => [[], 'read/write'], # listref of Simple and Collection articles
category => [undef, 'read/write'],
description => [undef, 'read/write'],
registry => ['MOBY_Central', 'read/write'],
More information about the MOBY-guts
mailing list