[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Wed May 7 19:20:28 UTC 2003
mwilkinson
Wed May 7 15:20:28 EDT 2003
Update of /home/repository/moby/moby-live/Perl/MOBY/Client
In directory pub.open-bio.org:/tmp/cvs-serv29016/Perl/MOBY/Client
Modified Files:
Central.pm
Log Message:
new MOBY Central API functionality. NO DOCUEMNTATION PRONE TO CHANGE IN THE NEXT 48 hours. DO NOT USE
moby-live/Perl/MOBY/Client Central.pm,1.6,1.7
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2003/03/05 15:29:20 1.6
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2003/05/07 19:20:28 1.7
@@ -108,11 +108,17 @@
my %_attr_data = # DEFAULT ACCESSIBILITY
(
SOAP_connections => [undef, 'read/write'],
- default_MOBY_servername => ['MOBYCentral', 'read/write'],
- default_MOBY_server => ['http://mobycentral.cbr.nrc.ca/cgi-bin/MOBY-Central.pl', 'read/write'],
- default_MOBY_uri => ['http://mobycentral.cbr.nrc.ca/MOBY/Central', 'read/write'],
+ default_MOBY_servername => ['mobycentral', 'read/write'],
+ default_MOBY_server => ['http://localhost/cgi-bin/MOBY-Central.pl', 'read/write'],
+ default_MOBY_uri => ['http://localhost/MOBY/Central', 'read/write'],
Registries => [undef, 'read/write'],
multiple_registries => [undef, 'read/write'],
+ #SOAP_connections => [undef, 'read/write'],
+ #default_MOBY_servername => ['MOBYCentral', 'read/write'],
+ #default_MOBY_server => ['http://mobycentral.cbr.nrc.ca/cgi-bin/MOBY-Central.pl', 'read/write'],
+ #default_MOBY_uri => ['http://mobycentral.cbr.nrc.ca/MOBY/Central', 'read/write'],
+ #Registries => [undef, 'read/write'],
+ #multiple_registries => [undef, 'read/write'],
);
@@ -206,84 +212,130 @@
}
-=head2 registerObject
+=head2 registerObject a.k.a registerObjectClass
- Title : registerObject
+ Title : registerObject ; registerObjectClass
Usage : $REG = $MOBY->registerObject(%args)
+ Usage : $REG = $MOBY->registerObjectClass(%args)
Function : register a new type of MOBY Object
Returns : MOBY::Registration object
Args : objectType => "the name of the Object"
description => "a human-readable description of the object"
- xsd => "an xsd string describing the object structure"
- i.e. everything between (excluding) the <xs:schema/> tags
+ contactEmail => "your at email.address"
ISA => \@list_of_immediate_parent_object_types (or empty listref)
+ HASA => \@list_of_immediate_parent_object_types (or empty listref)
authURI => "URI of the registrar of this object"
clobber => 0 | 1 |2;
0 = DON'T ; 1 = deprecate and re-register ; 2 = overwrite
=cut
-
+#
+# <registerObjectClass>
+# <objectType>NewObjectType</objectType>
+# <Description><![CDATA[
+# human readable description
+# of data type]]>
+# </Description>
+# <ISA>
+# <objectType>ExistingObjectType</objectType>
+# <!-- at the moment we do not allow multiple
+# inheritence, but perhaps we should. It
+# raises some additional complexities -->
+# </ISA>
+# <HASA>
+# <objectType articleName="MyArticleName">ExistingObjectType</objectType>
+# <objectType articleName="MyOtherName">ExistingObjectType</objectType>
+# </HASA>
+# <authURI>Your.URI.here</authURI>
+# <contactEmail>You at your.address.com</contactEmail>
+# <Clobber>0 | 1 | 2</Clobber>
+# </registerObjectClass>
+sub registerObjectClass {
+ my ($self, %a) = @_;
+ return $self->registerObject(%a);
+}
sub registerObject {
my ($self, %a) = @_;
return $self->errorRegXML("Function not allowed when querying multiple registries") if $self->multiple_registries;
+ return $self->errorRegXML("Contact email address (contactEmail parameter) is required for object registration") if (!$a{contactEmail});
my $term = $a{objectType}; $term ||="";
my $desc = $a{description}; $desc ||="";
- my $xsd = $a{xsd}; $xsd ||="";
my @ISA = @{$a{ISA}};
- my $authURI = $a{authURI}; $authURI ||="";
+ my @HASA = @{$a{HASA}};
+ my $contactEmail = $a{contactEmail}; $contactEmail ||="";
+ my $authURI = $a{authURI}; $authURI ||=""; $authURI ||="";
my $clobber = $a{clobber}?$a{clobber}:0;
- my $message = "
- <registerObject>
- <objectType>$term</objectType>
- <Description><![CDATA[$desc]]></Description>
- <ISA>";
+ my $message = "<registerObjectClass><objectType>$term</objectType><Description><![CDATA[$desc]]></Description><ISA>";
foreach (@ISA){
$message .="<objectType>$_</objectType>\n"
}
$message .= "</ISA>
+ <HASA>";
+ foreach (@HASA){
+ $message .="<objectType>$_</objectType>\n"
+ }
+ $message .= "</HASA>
<authURI>$authURI</authURI>
+ <contactEmail>$contactEmail</contactEmail>
<Clobber>$clobber</Clobber>
- <xsd><![CDATA[$xsd]]></xsd>
- </registerObject>";
+ </registerObjectClass>";
- my $return = $self->SOAP_connection->call(registerObject => ($message))->paramsall;
+ my $return = $self->SOAP_connection->call(registerObjectClass => ($message))->paramsall;
return ($self->parseRegXML($return));
}
-=head2 deregisterObject
+=head2 deregisterObject a.k.a. deregisterObjectClass
- Title : deregisterObject
+ Title : deregisterObject ; deregisterObjectClass
Usage : $REG = $MOBY->deregisterObject(%args)
- Function : deregister a deprecated MOBY Object
+ Usage : $REG = $MOBY->deregisterObjectClass(%args)
+ Function : deregister a MOBY Object
Returns : MOBY::Registration object
- Args : objectAcc => $myObjectAccession
+ Args : objectAcc => $objectName (from Object ontology)
=cut
+#
+# <deregisterObjectClass>
+# <objectType>ObjectOntologyTerm</objectType>
+# </deregisterObjectClass>
-
-
+sub deregisterObjectClass {
+ my ($self, %a) = @_;
+ return $self->deregisterObject(%a);
+}
sub deregisterObject {
my ($self, %a) = @_;
return $self->errorRegXML("Function not allowed when querying multiple registries") if $self->multiple_registries;
my $id = $a{'objectAcc'}; $id ||="";
my $message = "
- <deregisterObject>
+ <deregisterObjectClass>
<objectAcc>$id</objectAcc>
- </deregisterObject>";
- my $return = $self->SOAP_connection->call(deregisterObject => ($message))->paramsall;
+ </deregisterObjectClass>";
+ my $return = $self->SOAP_connection->call(deregisterObjectClass => ($message))->paramsall;
return ($self->parseRegXML($return));
}
-
-
+#
+# <registerServiceType>
+# <serviceType>NewServiceType</serviceType>
+# <contactEmail>your_name at contact.address.com</contactEmail>
+# <authURI>Your.URI.here</authURI>
+# <Description>
+# <![CDATA[ human description of service type here]]>
+# </Description>
+# <ISA>
+# <serviceType>ExistingServiceType</serviceType>
+# <serviceType>ExistingServiceType</serviceType>
+# </ISA>
+# </registerServiceType>
=head2 registerServiceType
@@ -294,8 +346,8 @@
Args : serviceType => $serviceType
description => "human readable description"
ISA => [$serviceType1, $serviceType2, ...]
-
-
+ contactEmail => "your at email.address.here"
+ authURI => "your.authority.info"
=cut
@@ -305,12 +357,16 @@
return $self->errorRegXML("Function not allowed when querying multiple registries") if $self->multiple_registries;
my $type = $a{'serviceType'}; $type ||="";
my $desc = $a{'description'}; $desc ||="";
+ my $email = $a{'contactEmail'}; $email ||="";
+ my $auth = $a{'authURI'}; $auth ||="";
my @ISA = @{$a{'ISA'}};
my $message = "
<registerServiceType>
<serviceType>$type</serviceType>
<Description><![CDATA[$desc]]></Description>
+ <contactEmail>email</contactEmail>
+ <authURI>auth</authURI>
<ISA>\n";
foreach (@ISA){
$message .= "<serviceType>$_</serviceType>\n";
@@ -332,12 +388,14 @@
Usage : $REG = $MOBY->deregisterServiceType(%args)
Function : deregister a deprecated MOBY Service Type
Returns : MOBY::Registration object
- Args : serviceTypeAcc => $myServiceTypeAccession
+ Args : serviceTypeAcc => $serviceType (from ontology)
=cut
-
+ #<deregisterServiceType>
+ # <serviceType>ServiceOntologyTerm</serviceType>
+ #</deregisterServiceType>
sub deregisterServiceType {
@@ -363,12 +421,19 @@
Args : namespaceType => $namespaceType (required)
authURI => your.authority.URI (required)
description => "human readable description of namespace" (required)
- clobber => 0 | 1 (optional, default 0)
-
+ contactEmail => "your at address.here"
+
=cut
-
+ #<registerNamespace>
+ # <namespaceType>NewNamespaceHere</namespaceType>
+ # <contactEmail>your_name at contact.address.com</contactEmail>
+ # <authURI>Your.URI.here</authURI>
+ # <Description>
+ # <![CDATA[human readable description]]>
+ # </Description>
+ #</registerNamespace>
sub registerNamespace {
@@ -377,14 +442,13 @@
my $type = $a{'namespaceType'}; $type ||="";
my $authURI = $a{'authURI'}; $authURI ||="";
my $desc = $a{'description'}; $desc ||="";
- my $clobber = $a{'clobber'};
- $clobber ||= 0;
+ my $contact = $a{'contactEmail'};; $contact ||="";
my $message = "
<registerNamespace>
<namespaceType>$type</namespaceType>
<Description><![CDATA[$desc]]></Description>
<authURI>$authURI</authURI>
- <Clobber>$clobber</Clobber>
+ <contactEmail>$contact</contactEmail>
</registerNamespace>";
my $return = $self->SOAP_connection->call(registerNamespace => ($message))->paramsall;
@@ -402,13 +466,11 @@
Usage : $REG = $MOBY->deregisterNamespace(%args)
Function : deregister a deprecated MOBY Namespace
Returns : MOBY::Registration object
- Args : namespaceAcc => $mynamespaceAccession
+ Args : namespaceAcc => $mynamespaceType (from ontology)
=cut
-
-
sub deregisterNamespace {
my ($self, %a) = @_;
@@ -437,30 +499,52 @@
serviceName => $serviceName,
serviceType => $serviceType,
authURI => $authURI,
+ contactEmail => "your at mail.address",
description => $human_readable_description,
- category => "moby" | "cgi" | "soap"
+ category => "moby" | "cgi" | "soap" (currently only moby supported)
Category Specific Args:
input:
- moby: input => {objectType1 => [namespace1, namespace2, namespace3],
- objectType2 => [namespace1, namespace4, namespace5],
+ moby: input => [objType1 => [ns1, ns2...], articleName], # Simple
+ [[objType1 => [ns1, ns2...]], articleName] # Collection (one object Class)
+ [[objType2 => [ns1, ns2...],
+ objType3 => [ns1, ns2...]], articleName] # Collection (two object Classes)
+
+
+ output:
+ moby: output => {objectType1 => [[namespace1, namespace2, namespace3], articleName]
+ objectType2 => [[namespace1, namespace4, namespace5], articlename]
} (hash-ref!)
- cgi : input => ?sprintf_formatted_GET_Parameter_string
- soap: <NO INPUT>
- output:
- moby: output => [ObjectType1, ObjectType2,...], (list ref!)
- cgi : <NO OUTPUT>
- soap: <NO OUTPUT>
-
URL:
moby: URL => $URL_TO_SERVICE
- cgi : URL => $URL_TO_CGI (not including ?GET_STRING...)
- soap: URL => $URL_TO_WSDL_FILE
=cut
+#******************************************* need to have collections and article names! *************************
+
+ #<registerService>
+ # <Category>moby</Category> <!-- one of 'moby', 'cgi', 'soap' ; currently only 'moby' services are fully supported -->
+ # <serviceName>YourServiceNameHere</serviceName>
+ # <serviceType>TypeOntologyTerm</serviceType>
+ # <authURI>your.URI.here</authURI>
+ # <URL>http://URL.to.your/Service.script</URL>;
+ # <contactEmail>your_name at contact.address.com</contactEmail>
+ # <authoritativeService>1 | 0 </authoritativeService>
+ # <Description><![CDATA[
+ # human readable COMPREHENSIVE description of your service]]>
+ # </Description>
+ # <Input>
+ # <!-- zero or more Primary (Simple and/or Complex) articles -->
+ # </Input>
+ # <secondaryArticles>
+ # <!-- zero or more INPUT Secondary articles -->
+ # </secondaryArticles>
+ # <Output>
+ # <!-- zero or more Primary (Simple and/or Complex) articles -->
+ # </Output>
+ #</registerService>
sub registerService {
@@ -469,9 +553,10 @@
my $name = $a{serviceName}; $name ||="";
my $type = $a{serviceType}; $type ||="";
my $authURI = $a{authURI}; $authURI ||="";
+ my $email = $a{contactEmail}; $email ||="";
my $URL = $a{URL}; $URL ||="";
my $desc = $a{description}; $desc ||="";
- my $Category = $a{Category}; $Category ||="";
+ my $Category = $a{Category}; $Category ||="moby";
my $message = "
<registerService>
@@ -509,17 +594,19 @@
$message .="
</outputObjects>
</registerService>";
- } elsif ($Category eq "cgi") {
- my $IN = $a{input};
- $message .= "
- <inputObjects>
- <Input><![CDATA[$IN]]></Input>
- </inputObjects>
- </registerService>";
- } else {
- $message .= "
- </registerService>";
- }
+ } else { return $self->errorRegXML("only moby services are currently supported") if $self->multiple_registries;}
+
+ #elsif ($Category eq "cgi") {
+ # my $IN = $a{input};
+ # $message .= "
+ # <inputObjects>
+ # <Input><![CDATA[$IN]]></Input>
+ # </inputObjects>
+ # </registerService>";
+ #} else {
+ # $message .= "
+ # </registerService>";
+ #}
#unless ($message =~ /\<\/registerService/){ return MOBY::Registration->new(
More information about the MOBY-guts
mailing list