From mwilkinson at pub.open-bio.org Sat Nov 1 04:06:15 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:36:50 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311010906.hA196FQA013696@pub.open-bio.org> mwilkinson Sat Nov 1 04:06:15 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid In directory pub.open-bio.org:/tmp/cvs-serv13678/lsid Log Message: Directory /home/repository/moby/moby-live/Perl/lsid added to the repository moby-live/Perl/lsid - New directory rcsdiff: /home/repository/moby/moby-live/Perl/lsid/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/lsid/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/lsid/RCS/directory,v: No such file or directory From mwilkinson at pub.open-bio.org Sat Nov 1 04:06:24 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:36:53 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311010906.hA196O9g013750@pub.open-bio.org> mwilkinson Sat Nov 1 04:06:24 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv13732/lsid/authority Log Message: Directory /home/repository/moby/moby-live/Perl/lsid/authority added to the repository moby-live/Perl/lsid/authority - New directory rcsdiff: /home/repository/moby/moby-live/Perl/lsid/authority/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/lsid/authority/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/lsid/authority/RCS/directory,v: No such file or directory From mwilkinson at pub.open-bio.org Sat Nov 1 04:40:58 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:36:57 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311010940.hA19ewqw015790@pub.open-bio.org> mwilkinson Sat Nov 1 04:40:58 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv15771/MOBY Modified Files: CommonSubs.pm Log Message: Added the beginnings of an LSID resolver. It currently resolves only namespace type LSIDs. Small changes to commonsubs to make it more robust to namespaced XML moby-live/Perl/MOBY CommonSubs.pm,1.18,1.19 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/10/25 22:20:47 1.18 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/01 09:40:57 1.19 @@ -234,13 +234,13 @@ if ($articleName) { return " - $data + $data "; } elsif($data) { return " - $data + $data "; } else { @@ -276,26 +276,26 @@ foreach (@{$data}){ if($_) { $content .= " - $_ + $_ "; } else { $content .= " - + "; } } if ($articleName) { return " - + $content - + "; } else { return " - $content + $content "; } @@ -322,7 +322,7 @@ sub responseHeader { return " - + "; } @@ -456,7 +456,7 @@ $DOM = $doc->getDocumentElement(); } $DOM = $DOM->getDocumentElement if ($DOM->isa("XML::DOM::Document")); - return 1 if ($DOM->getTagName eq "Collection"); + return 1 if ($DOM->getTagName =~ /Collection/); return 0; } @@ -673,8 +673,8 @@ } my @xrefs; my @XREFS; my @simples; - return @XREFS if $XML->getTagName eq "Collection"; - if ($XML->getTagName eq "Simple"){ + return @XREFS if ($XML->getTagName =~/Collection/); + if ($XML->getTagName =~/Simple/){ foreach my $child ($XML->getChildNodes){ next unless $child->getNodeType == ELEMENT_NODE; $XML = $child; @@ -683,16 +683,16 @@ } foreach ($XML->getChildNodes){ next unless $_->getNodeType == ELEMENT_NODE; - next unless $_->getTagName eq "CrossReference"; + next unless $_->getTagName =~/CrossReference/; foreach my $xref($_->getChildNodes){ next unless $xref->getNodeType == ELEMENT_NODE; - next unless ($xref->getTagName eq "Xref" || $xref->getTagName eq 'Object'); + next unless ($xref->getTagName =~/Xref/ || $xref->getTagName =~ /Object/); push @xrefs, $xref; } } foreach (@xrefs){ - $x = &_makeXrefType($_) if $_->getTagName eq "Xref"; - $x = &_makeObjectType($_) if $_->getTagName eq "Object"; + $x = &_makeXrefType($_) if $_->getTagName =~/Xref/; + $x = &_makeObjectType($_) if $_->getTagName =~ /Object/; push @XREFS, $x if $x; } return @XREFS; From mwilkinson at pub.open-bio.org Sat Nov 1 04:40:58 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:37:01 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311010940.hA19ew42015805@pub.open-bio.org> mwilkinson Sat Nov 1 04:40:58 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv15771/lsid/authority Added Files: RDFConfigure.pm authority.pl dbConfigure.pm.template metadata.pl Log Message: Added the beginnings of an LSID resolver. It currently resolves only namespace type LSIDs. Small changes to commonsubs to make it more robust to namespaced XML moby-live/Perl/lsid/authority RDFConfigure.pm,NONE,1.1 authority.pl,NONE,1.1 dbConfigure.pm.template,NONE,1.1 metadata.pl,NONE,1.1 From mwilkinson at pub.open-bio.org Sat Nov 1 04:59:04 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:37:04 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311010959.hA19x4Hn016935@pub.open-bio.org> mwilkinson Sat Nov 1 04:59:04 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv16916/MOBY Modified Files: CommonSubs.pm Log Message: adding debugging info to commonsubs. I broke it with the last commit moby-live/Perl/MOBY CommonSubs.pm,1.19,1.20 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/01 09:40:57 1.19 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/01 09:59:04 1.20 @@ -603,10 +603,13 @@ my $responses = $moby->getElementsByTagName('moby:queryResponse'); $responses ||= $moby->getElementsByTagName('queryResponse'); foreach my $n(0..($responses->getLength - 1)){ + print STDERR "***found response # $n\n"; my $resp = $responses->item($n); foreach my $response_component($resp->getChildNodes){ + print STDERR "***found child node\n"; next unless $response_component->getNodeType == ELEMENT_NODE; if (($response_component->getTagName eq "Simple") || ($response_component->getTagName eq "moby:Simple")){ + print STDERR "***found Simple # $n\n"; my $simples = $resp->getElementsByTagName('Simple'); $simples ||=$resp->getElementsByTagName('moby:Simple'); From mwilkinson at pub.open-bio.org Sat Nov 1 05:02:13 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:37:08 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011002.hA1A2D9K017009@pub.open-bio.org> mwilkinson Sat Nov 1 05:02:13 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv16990/MOBY Modified Files: CommonSubs.pm Log Message: adding debugging info to commonsubs. I broke it with the last commit moby-live/Perl/MOBY CommonSubs.pm,1.20,1.21 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/01 09:59:04 1.20 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/01 10:02:13 1.21 @@ -602,6 +602,7 @@ my $success = 0; my $responses = $moby->getElementsByTagName('moby:queryResponse'); $responses ||= $moby->getElementsByTagName('queryResponse'); + print STDERR "***checked responses\n"; foreach my $n(0..($responses->getLength - 1)){ print STDERR "***found response # $n\n"; my $resp = $responses->item($n); From mwilkinson at pub.open-bio.org Sat Nov 1 05:04:13 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:37:13 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011004.hA1A4DwG017341@pub.open-bio.org> mwilkinson Sat Nov 1 05:04:13 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv17322/MOBY Modified Files: CommonSubs.pm Log Message: adding debugging info to commonsubs. I broke it with the last commit moby-live/Perl/MOBY CommonSubs.pm,1.21,1.22 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/01 10:02:13 1.21 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/01 10:04:13 1.22 @@ -587,7 +587,9 @@ sub extractResponseArticles { my ($result) = @_; + print STDERR "***extracting response articles\n"; return ([], []) unless $result; + print STDERR "***extracted response articles\n"; my $moby; unless (ref($result) =~ /XML\:\:DOM/){ my $parser = new XML::DOM::Parser; From mwilkinson at pub.open-bio.org Sat Nov 1 05:23:54 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:37:18 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011023.hA1ANsYP018465@pub.open-bio.org> mwilkinson Sat Nov 1 05:23:54 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv18446/MOBY Modified Files: CommonSubs.pm Log Message: this should fix it. moby-live/Perl/MOBY CommonSubs.pm,1.22,1.23 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/01 10:04:13 1.22 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/01 10:23:54 1.23 @@ -587,7 +587,6 @@ sub extractResponseArticles { my ($result) = @_; - print STDERR "***extracting response articles\n"; return ([], []) unless $result; print STDERR "***extracted response articles\n"; my $moby; @@ -614,10 +613,10 @@ if (($response_component->getTagName eq "Simple") || ($response_component->getTagName eq "moby:Simple")){ print STDERR "***found Simple # $n\n"; - my $simples = $resp->getElementsByTagName('Simple'); - $simples ||=$resp->getElementsByTagName('moby:Simple'); - next unless $simples->item(0); - foreach my $Object($simples->item(0)->getChildNodes) { +# my $simples = $resp->getElementsByTagName('Simple'); +# $simples ||=$resp->getElementsByTagName('moby:Simple'); + # next unless $simples->item(0); + foreach my $Object($response_component->getChildNodes) { next unless $Object->getNodeType == ELEMENT_NODE; $success = 1; push @objects,$Object; From mwilkinson at pub.open-bio.org Sat Nov 1 05:35:20 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:37:23 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011035.hA1AZK5g019193@pub.open-bio.org> mwilkinson Sat Nov 1 05:35:20 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv19174/lsid/authority Modified Files: metadata.pl Log Message: undeclared variables fixed moby-live/Perl/lsid/authority metadata.pl,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl 2003/11/01 09:40:58 1.1 +++ /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl 2003/11/01 10:35:20 1.2 @@ -12,6 +12,7 @@ $SERVICE_CGI $RDF_PREFIX $RDF_SUFFIX); + use dbConfigure qw( $service $namespace @@ -169,8 +170,8 @@ my $host = $db->{host}; my $dbname = $db->{dbname}; my $port = $db->{port}; - my ($dsn) = "DBI:mysql:$dbname:$url:$port"; - my $dbh = DBI->connect($dsn, $username, $password, {RaiseError => 1}) or die "can't connect to database"; + my ($dsn) = "DBI:mysql:$dbname:$host:$port"; + my $dbh = DBI->connect($dsn, $user, $pass, {RaiseError => 1}) or die "can't connect to database"; return ($dbh); } From mwilkinson at pub.open-bio.org Sat Nov 1 05:37:41 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:37:27 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011037.hA1AbfXc019290@pub.open-bio.org> mwilkinson Sat Nov 1 05:37:41 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv19275 Added Files: Error.pm Log Message: this isn't useful yet, but it is used in the code so silence the error message moby-live/Perl/lsid/authority Error.pm,NONE,1.1 From mwilkinson at pub.open-bio.org Sat Nov 1 05:40:28 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:37:35 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011040.hA1AeSga019653@pub.open-bio.org> mwilkinson Sat Nov 1 05:40:28 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv19634/MOBY Modified Files: CommonSubs.pm Log Message: fixed. removing debugging messages moby-live/Perl/MOBY CommonSubs.pm,1.23,1.24 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/01 10:23:54 1.23 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/01 10:40:28 1.24 @@ -588,7 +588,6 @@ sub extractResponseArticles { my ($result) = @_; return ([], []) unless $result; - print STDERR "***extracted response articles\n"; my $moby; unless (ref($result) =~ /XML\:\:DOM/){ my $parser = new XML::DOM::Parser; @@ -603,19 +602,11 @@ my $success = 0; my $responses = $moby->getElementsByTagName('moby:queryResponse'); $responses ||= $moby->getElementsByTagName('queryResponse'); - print STDERR "***checked responses\n"; foreach my $n(0..($responses->getLength - 1)){ - print STDERR "***found response # $n\n"; my $resp = $responses->item($n); foreach my $response_component($resp->getChildNodes){ - print STDERR "***found child node\n"; next unless $response_component->getNodeType == ELEMENT_NODE; if (($response_component->getTagName eq "Simple") || ($response_component->getTagName eq "moby:Simple")){ - print STDERR "***found Simple # $n\n"; - -# my $simples = $resp->getElementsByTagName('Simple'); -# $simples ||=$resp->getElementsByTagName('moby:Simple'); - # next unless $simples->item(0); foreach my $Object($response_component->getChildNodes) { next unless $Object->getNodeType == ELEMENT_NODE; $success = 1; From mwilkinson at pub.open-bio.org Sat Nov 1 06:17:24 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:37:40 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011117.hA1BHOsu021549@pub.open-bio.org> mwilkinson Sat Nov 1 06:17:24 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv21514/lsid/authority Modified Files: Error.pm RDFConfigure.pm authority.pl dbConfigure.pm.template metadata.pl Log Message: shuffling stuff around to make it available to various modules moby-live/Perl/lsid/authority Error.pm,1.1,1.2 RDFConfigure.pm,1.1,1.2 authority.pl,1.1,1.2 dbConfigure.pm.template,1.1,1.2 metadata.pl,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/Error.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/lsid/authority/Error.pm 2003/11/01 10:37:41 1.1 +++ /home/repository/moby/moby-live/Perl/lsid/authority/Error.pm 2003/11/01 11:17:24 1.2 @@ -1,3 +1,4 @@ +#$Id$ package Error; sub clientFault {} =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/RDFConfigure.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/lsid/authority/RDFConfigure.pm 2003/11/01 09:40:58 1.1 +++ /home/repository/moby/moby-live/Perl/lsid/authority/RDFConfigure.pm 2003/11/01 11:17:24 1.2 @@ -1,3 +1,4 @@ +#$Id$ package RDFConfigure; use strict; @@ -8,11 +9,16 @@ $SERVICE_CGI $RDF_PREFIX $RDF_SUFFIX + rdfLiteral + rdfResource ); -#our %EXPORT_TAGS =(all => [qw($SERVICE_CGI -# $RDF_PREFIX -# $RDF_SUFFIX -# )]); +our %EXPORT_TAGS =(all => [qw( + $SERVICE_CGI + $RDF_PREFIX + $RDF_SUFFIX + rdfLiteral + rdfResource + )]); our $SERVICE_CGI= 'http://localhost:80/cgi-bin/authority/metadata.pl'; @@ -23,4 +29,20 @@ xmlns:i3cp='urn:lsid:i3c.org:predicates:' xmlns:mobyp='urn:lsid:biomoby.org:rdfpredicates:'>\n\n"; our $RDF_SUFFIX= ""; + + +sub rdfLiteral { + my ($subj, $pred, $obj)= @_; + return " +\t<$pred>$obj +\n"; +} + +sub rdfResource { + my ($subj, $pred, $obj)= @_; + return " +\t<$pred rdf:resource='$obj'/> +"; +} + 1; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/authority.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/lsid/authority/authority.pl 2003/11/01 09:40:58 1.1 +++ /home/repository/moby/moby-live/Perl/lsid/authority/authority.pl 2003/11/01 11:17:24 1.2 @@ -1,12 +1,5 @@ #!/usr/bin/perl -w -# ===================================================================== -# Copyright (c) 2002,2003 IBM Corporation -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Common Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.opensource.org/licenses/cpl.php -# -# ===================================================================== +#$Id$ use LS::Authority::WSDL::Simple; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/dbConfigure.pm.template,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/lsid/authority/dbConfigure.pm.template 2003/11/01 09:40:58 1.1 +++ /home/repository/moby/moby-live/Perl/lsid/authority/dbConfigure.pm.template 2003/11/01 11:17:24 1.2 @@ -14,22 +14,22 @@ =cut - +#$Id$ package dbConfigure; use strict; use base 'Exporter'; require Exporter; our @EXPORT_OK = qw( - $central - $namespace - $object - $service - $relationship + $centraldb + $namespacedb + $objectdb + $servicedb + $relationshipdb ); # parameters for the mobycentral database -our $central = {'host' => '', +our $centraldb = {'host' => '', 'dbname' => '', 'user' => '', 'pass' => '', @@ -37,7 +37,7 @@ }; # parameters for the namespace database -our $namespace = {'host' => '', +our $namespacedb = {'host' => '', 'dbname' => '', 'user' => '', 'pass' => '', @@ -45,7 +45,7 @@ }; # parameters for the object database -our $object = { 'host' => '', +our $objectdb = { 'host' => '', 'dbname' => '', 'user' => '', 'pass' => '', @@ -53,7 +53,7 @@ }; # parameters for the service database -our $service = {'host' => '', +our $servicedb = {'host' => '', 'dbname' => '', 'user' => '', 'pass' => '', @@ -62,7 +62,7 @@ # parameters for the relationship database -our $relationship = {'host' => '', +our $relationshipdb = {'host' => '', 'dbname' => '', 'user' => '', 'pass' => '', =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl 2003/11/01 10:35:20 1.2 +++ /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl 2003/11/01 11:17:24 1.3 @@ -1,4 +1,6 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl -w +#$Id$ + use CGI qw/:standard/; use lib "/usr/local/apache/cgi-bin/lsid/authority"; use strict; @@ -8,19 +10,17 @@ use LS::Authority::WSDL::Simple; use Error; -use RDFConfigure qw( - $SERVICE_CGI - $RDF_PREFIX - $RDF_SUFFIX); +use RDFConfigure qw(:all); use dbConfigure qw( - $service - $namespace - $object - $central - $relationship + $servicedb + $namespacedb + $objectdb + $centraldb + $relationshipdb ); +use NamespaceResolver qw(:all); my %known_types = ( # switch on/off various LSID resolvers. 'namespacetype' => 1, @@ -37,15 +37,8 @@ my $lsid = param('lsid'); print header(-type => 'x-application/rdf+xml', -expires => 'now'); # both tags are required by the spec - - #my $rdfheader = "\n". - #"\n"; my $rdf = validate_lsid($lsid); - #my $rdffooter = ''; _die("RDF creation failed") unless ($rdf); -# print $rdfheader.$rdf.$rdffooter; print $rdf; exit 1; } @@ -71,7 +64,7 @@ _die("unknown LSID namespace $1 : $known_types{$1}; known types are ".(keys %known_types)."\n", 404); } - return resolve_namespacetype($lsid) if $1 eq "namespacetype"; + return resolve_namespacetype($namespacedb,$lsid) if $1 eq "namespacetype"; } @@ -81,98 +74,3 @@ die ($e, $m); } -sub resolve_namespacetype { - my $ls = shift; - print STDERR "LSID is $ls\n"; - my $lsid= LS::ID->new($ls)->canonical; - unless ($lsid) { - _die('Malformed LSID', 200); - } - - my $authority= $lsid->authority; - my $ns= $lsid->namespace; - my $obj= $lsid->object; - my $rev= $lsid->revision; - - my $mdata; - my $dbh = _dbAccess($namespace); - - my $sth = $dbh->prepare("select namespace_type, description, authority, contact_email from namespace where namespace_lsid = ?"); - $sth->execute($lsid); - my ($namespace_type, $description, $authURI, $contact_email) = $sth->fetchrow_array; - unless ($namespace_type){ - _die('LSID Does not exist', 404); - } - - # SID is now fully validated. Carry on with metadata. - $RDF_PREFIX?1:1; - $mdata= $RDF_PREFIX; - $mdata.= rdfLiteral( - $lsid->as_string, - 'dc:title', - $namespace_type - ); - $mdata.= rdfLiteral( - $lsid->as_string, - 'rdfs:label', - $namespace_type - ); - $mdata.= rdfLiteral( - $lsid->as_string, - 'dc:description', - $description - ); - $mdata.= rdfLiteral( - $lsid->as_string, - 'dc:contributor', - $authURI - ); - $mdata.= rdfLiteral( - $lsid->as_string, - 'dc:type', - "bioMoby namespace identifier" - ); - $mdata.= rdfResource( - $contact_email, - 'dc:label', - $contact_email - ); - $mdata.= $RDF_SUFFIX; - $RDF_SUFFIX?1:1; - - unless ($mdata) { - die Error::clientFault('Metadata not available', 300); - } - return $mdata; -} - -sub rdfLiteral { - my ($subj, $pred, $obj)= @_; - return " -\t<$pred>$obj -\n"; -} - -sub rdfResource { - my ($subj, $pred, $obj)= @_; - return " -\t<$pred rdf:resource='$obj'/> -"; -} - - -sub _dbAccess { - use DBI; - use DBD::mysql; - my ($db) = @_; - my $pass = $db->{pass}; - my $user = $db->{user}; - my $host = $db->{host}; - my $dbname = $db->{dbname}; - my $port = $db->{port}; - my ($dsn) = "DBI:mysql:$dbname:$host:$port"; - my $dbh = DBI->connect($dsn, $user, $pass, {RaiseError => 1}) or die "can't connect to database"; - - return ($dbh); -} - From mwilkinson at pub.open-bio.org Sat Nov 1 06:26:08 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:37:44 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011126.hA1BQ8sf022231@pub.open-bio.org> mwilkinson Sat Nov 1 06:26:08 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv22216 Added Files: NamespaceResolver.pm dbConnect.pm Log Message: db connection module and namespace resolver RDF meta-data generator moby-live/Perl/lsid/authority NamespaceResolver.pm,NONE,1.1 dbConnect.pm,NONE,1.1 From mwilkinson at pub.open-bio.org Sat Nov 1 06:37:02 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:37:47 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011137.hA1Bb2ta022867@pub.open-bio.org> mwilkinson Sat Nov 1 06:37:02 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv22848 Modified Files: NamespaceResolver.pm Log Message: debugging changes moby-live/Perl/lsid/authority NamespaceResolver.pm,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/NamespaceResolver.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/lsid/authority/NamespaceResolver.pm 2003/11/01 11:26:08 1.1 +++ /home/repository/moby/moby-live/Perl/lsid/authority/NamespaceResolver.pm 2003/11/01 11:37:02 1.2 @@ -3,7 +3,6 @@ require Exporter; use XML::DOM; -use MOBY::CrossReference; use dbConnect qw(:all); use RDFConfigure qw(:all); From mwilkinson at pub.open-bio.org Sat Nov 1 08:28:33 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:37:51 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011328.hA1DSX8e029006@pub.open-bio.org> mwilkinson Sat Nov 1 08:28:32 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv28979 Modified Files: NamespaceResolver.pm RDFConfigure.pm metadata.pl Added Files: ClassResolver.pm RelationshipResolver.pm ServiceResolver.pm Log Message: added LSID resolvers for the Class and Service and Relationship ontologies. moby-live/Perl/lsid/authority ClassResolver.pm,NONE,1.1 RelationshipResolver.pm,NONE,1.1 ServiceResolver.pm,NONE,1.1 NamespaceResolver.pm,1.2,1.3 RDFConfigure.pm,1.2,1.3 metadata.pl,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/NamespaceResolver.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/lsid/authority/NamespaceResolver.pm 2003/11/01 11:37:02 1.2 +++ /home/repository/moby/moby-live/Perl/lsid/authority/NamespaceResolver.pm 2003/11/01 13:28:32 1.3 @@ -17,7 +17,7 @@ sub resolve_namespacetype { my ($namespace_db_params, $ls) = @_; - print STDERR "LSID is $ls\n"; + #print STDERR "LSID is $ls\n"; my $lsid= LS::ID->new($ls)->canonical; unless ($lsid) { _die('Malformed LSID', 200); @@ -29,7 +29,7 @@ my $rev= $lsid->revision; my $mdata; - my $dbh = dbAccess($namespace_db_params); + my $dbh = dbConnect($namespace_db_params); my $sth = $dbh->prepare("select namespace_type, description, authority, contact_email from namespace where namespace_lsid = ?"); $sth->execute($lsid); @@ -64,7 +64,7 @@ $mdata.= rdfLiteral( $lsid->as_string, 'dc:type', - "bioMoby namespace identifier" + "bioMoby Namespace identifier" ); $mdata.= rdfResource( $contact_email, =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/RDFConfigure.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/lsid/authority/RDFConfigure.pm 2003/11/01 11:17:24 1.2 +++ /home/repository/moby/moby-live/Perl/lsid/authority/RDFConfigure.pm 2003/11/01 13:28:32 1.3 @@ -11,6 +11,7 @@ $RDF_SUFFIX rdfLiteral rdfResource + _die ); our %EXPORT_TAGS =(all => [qw( $SERVICE_CGI @@ -18,6 +19,7 @@ $RDF_SUFFIX rdfLiteral rdfResource + _die )]); @@ -45,4 +47,11 @@ "; } + +sub _die { + my $m = shift; + my $e = shift; + die ($e, $m); +} + 1; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl 2003/11/01 11:17:24 1.3 +++ /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl 2003/11/01 13:28:32 1.4 @@ -21,12 +21,16 @@ ); use NamespaceResolver qw(:all); +use ClassResolver qw(:all); +use ServiceResolver qw(:all); +use RelationshipResolver qw(:all); -my %known_types = ( # switch on/off various LSID resolvers. +my %known_types = ( # switch on/off various LSID-namespace resolvers. 'namespacetype' => 1, - 'objecttype' => 0, - 'servicetype' => 0, - 'relationshiptype' => 0, + 'objectclass' => 1, + 'servicetype' => 1, + 'servicerelation' => 1, + 'objectrelation' => 1, 'serviceinstance' => 0, ); @@ -65,12 +69,10 @@ } return resolve_namespacetype($namespacedb,$lsid) if $1 eq "namespacetype"; + return resolve_classtype($objectdb,$lsid) if $1 eq "objectclass"; + return resolve_servicetype($servicedb,$lsid) if $1 eq "objectclass"; + return resolve_relationshiptype($relationshipdb,$lsid) if $1 eq "objectrelation"; + return resolve_relationshiptype($relationshipdb,$lsid) if $1 eq "servicerelation"; } -sub _die { - my $m = shift; - my $e = shift; - die ($e, $m); -} - From mwilkinson at pub.open-bio.org Sat Nov 1 08:35:12 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:38:01 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011335.hA1DZCgp029347@pub.open-bio.org> mwilkinson Sat Nov 1 08:35:12 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv29328 Modified Files: metadata.pl Log Message: added service LSID's were resolving to the Object ontology. oops. moby-live/Perl/lsid/authority metadata.pl,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl 2003/11/01 13:28:32 1.4 +++ /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl 2003/11/01 13:35:12 1.5 @@ -70,7 +70,7 @@ return resolve_namespacetype($namespacedb,$lsid) if $1 eq "namespacetype"; return resolve_classtype($objectdb,$lsid) if $1 eq "objectclass"; - return resolve_servicetype($servicedb,$lsid) if $1 eq "objectclass"; + return resolve_servicetype($servicedb,$lsid) if $1 eq "servicetype"; return resolve_relationshiptype($relationshipdb,$lsid) if $1 eq "objectrelation"; return resolve_relationshiptype($relationshipdb,$lsid) if $1 eq "servicerelation"; From mwilkinson at pub.open-bio.org Sat Nov 1 08:41:46 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:38:06 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011341.hA1Dfks0029697@pub.open-bio.org> mwilkinson Sat Nov 1 08:41:46 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv29678 Modified Files: RelationshipResolver.pm Log Message: bad SQL moby-live/Perl/lsid/authority RelationshipResolver.pm,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/RelationshipResolver.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/lsid/authority/RelationshipResolver.pm 2003/11/01 13:28:32 1.1 +++ /home/repository/moby/moby-live/Perl/lsid/authority/RelationshipResolver.pm 2003/11/01 13:41:46 1.2 @@ -30,7 +30,7 @@ my $mdata; my $dbh = dbConnect($class_db_params); # e.g. urn:lsid:biomoby.org:objectrelation:isa - my $sth = $dbh->prepare("select relationship_type, description, authority, contact_email, ontology from object where object_lsid = ?"); + my $sth = $dbh->prepare("select relationship_type, description, authority, contact_email, ontology from relationship where relationship_lsid = ?"); $sth->execute($lsid); my ($relationship_type, $description, $authURI, $contact_email, $ontology) = $sth->fetchrow_array; unless ($relationship_type){ From mwilkinson at pub.open-bio.org Sat Nov 1 09:00:58 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:38:10 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011400.hA1E0wMV030851@pub.open-bio.org> mwilkinson Sat Nov 1 09:00:58 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv30832 Modified Files: RelationshipResolver.pm Added Files: PredicateResolver.pm Log Message: bioMoby predicate resolver to deal with LSID's that reprsent MOBY-project specific RDF predicates moby-live/Perl/lsid/authority PredicateResolver.pm,NONE,1.1 RelationshipResolver.pm,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/RelationshipResolver.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/lsid/authority/RelationshipResolver.pm 2003/11/01 13:41:46 1.2 +++ /home/repository/moby/moby-live/Perl/lsid/authority/RelationshipResolver.pm 2003/11/01 14:00:58 1.3 @@ -68,7 +68,7 @@ $mdata.= rdfLiteral( $lsid->as_string, 'mobyp:mobyOntology', - $ontology + uc_first($ontology) ); $mdata.= rdfResource( $contact_email, From mwilkinson at pub.open-bio.org Sat Nov 1 09:06:35 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:38:18 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011406.hA1E6ZvP031202@pub.open-bio.org> mwilkinson Sat Nov 1 09:06:35 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv31179 Modified Files: PredicateResolver.pm metadata.pl Log Message: fixing the class LSID resolver and making more useful error messages moby-live/Perl/lsid/authority PredicateResolver.pm,1.1,1.2 metadata.pl,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/PredicateResolver.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/lsid/authority/PredicateResolver.pm 2003/11/01 14:00:57 1.1 +++ /home/repository/moby/moby-live/Perl/lsid/authority/PredicateResolver.pm 2003/11/01 14:06:35 1.2 @@ -18,7 +18,7 @@ }; sub resolve_mobyPredicate { - my ($class_db_params, $ls) = @_; + my ($ls) = @_; my $lsid= LS::ID->new($ls)->canonical; unless ($lsid) { _die('Malformed LSID', 200); =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl 2003/11/01 13:35:12 1.5 +++ /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl 2003/11/01 14:06:35 1.6 @@ -24,6 +24,7 @@ use ClassResolver qw(:all); use ServiceResolver qw(:all); use RelationshipResolver qw(:all); +use PredicateResolver qw(:all); my %known_types = ( # switch on/off various LSID-namespace resolvers. 'namespacetype' => 1, @@ -32,6 +33,7 @@ 'servicerelation' => 1, 'objectrelation' => 1, 'serviceinstance' => 0, + 'rdfpredicates' => 1, ); MetaData(); @@ -65,7 +67,7 @@ _die('Malformed LSID', 200); } unless ($known_types{$1}){ - _die("unknown LSID namespace $1 : $known_types{$1}; known types are ".(keys %known_types)."\n", 404); + _die("unknown LSID namespace $1; known types are ".(join ",", (keys %known_types))."\n", 404); } return resolve_namespacetype($namespacedb,$lsid) if $1 eq "namespacetype"; @@ -73,6 +75,7 @@ return resolve_servicetype($servicedb,$lsid) if $1 eq "servicetype"; return resolve_relationshiptype($relationshipdb,$lsid) if $1 eq "objectrelation"; return resolve_relationshiptype($relationshipdb,$lsid) if $1 eq "servicerelation"; + return resolve_mobyPredicate($lsid) if $1 eq "rdfpredicates"; } From mwilkinson at pub.open-bio.org Sat Nov 1 09:10:05 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:38:25 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011410.hA1EA5SL031547@pub.open-bio.org> mwilkinson Sat Nov 1 09:10:05 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv31524 Modified Files: RDFConfigure.pm metadata.pl Log Message: changed the predicate namespace from plural to singular... it sounds better that way moby-live/Perl/lsid/authority RDFConfigure.pm,1.3,1.4 metadata.pl,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/RDFConfigure.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/lsid/authority/RDFConfigure.pm 2003/11/01 13:28:32 1.3 +++ /home/repository/moby/moby-live/Perl/lsid/authority/RDFConfigure.pm 2003/11/01 14:10:05 1.4 @@ -29,7 +29,7 @@ xmlns:rdfs='http://www.w3.org/2000/01/rdf-schema#' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:i3cp='urn:lsid:i3c.org:predicates:' -xmlns:mobyp='urn:lsid:biomoby.org:rdfpredicates:'>\n\n"; +xmlns:mobyp='urn:lsid:biomoby.org:rdfpredicate:'>\n\n"; our $RDF_SUFFIX= ""; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl 2003/11/01 14:06:35 1.6 +++ /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl 2003/11/01 14:10:05 1.7 @@ -33,7 +33,7 @@ 'servicerelation' => 1, 'objectrelation' => 1, 'serviceinstance' => 0, - 'rdfpredicates' => 1, + 'rdfpredicate' => 1, ); MetaData(); @@ -75,7 +75,7 @@ return resolve_servicetype($servicedb,$lsid) if $1 eq "servicetype"; return resolve_relationshiptype($relationshipdb,$lsid) if $1 eq "objectrelation"; return resolve_relationshiptype($relationshipdb,$lsid) if $1 eq "servicerelation"; - return resolve_mobyPredicate($lsid) if $1 eq "rdfpredicates"; + return resolve_mobyPredicate($lsid) if $1 eq "rdfpredicate"; } From mwilkinson at pub.open-bio.org Sat Nov 1 09:25:15 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:38:31 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011425.hA1EPFbH032408@pub.open-bio.org> mwilkinson Sat Nov 1 09:25:15 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv32389 Modified Files: PredicateResolver.pm Log Message: compensating for ambiguity v.v. whether or not LSID's are case sensitive. Will chose one or the other when I get confirmation from the horses mouth moby-live/Perl/lsid/authority PredicateResolver.pm,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/PredicateResolver.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/lsid/authority/PredicateResolver.pm 2003/11/01 14:06:35 1.2 +++ /home/repository/moby/moby-live/Perl/lsid/authority/PredicateResolver.pm 2003/11/01 14:25:15 1.3 @@ -15,6 +15,7 @@ my $known_predicates = { mobyOntology => 'A phrase representing one of the bioMoby ontologies.', + mobyontology => 'A phrase representing one of the bioMoby ontologies.', }; sub resolve_mobyPredicate { @@ -31,7 +32,7 @@ # e.g. urn:lsid:biomoby.org:rdfpredicates:mobyOntology unless ($known_predicates->{$obj}){ - _die('LSID '.($lsid->as_string).' Does not exist', 404); + _die('LSID '.($lsid->as_string).' ($obj) Does not exist', 404); } # LSID is now fully validated. Carry on with metadata. From mwilkinson at pub.open-bio.org Sat Nov 1 10:24:00 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:38:36 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011524.hA1FO0XQ003242@pub.open-bio.org> mwilkinson Sat Nov 1 10:23:59 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv3223 Modified Files: Central.pm Log Message: screen for illegally formatted authURIs in order to be able to use them in our LSID's moby-live/Perl/MOBY Central.pm,1.109,1.110 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.109 retrieving revision 1.110 diff -u -r1.109 -r1.110 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2003/10/22 14:27:45 1.109 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2003/11/01 15:23:59 1.110 @@ -1014,6 +1014,7 @@ $error .="missing serviceName \n" unless defined $serviceName; $error .="missing serviceType \n" unless defined $serviceType; $error .="missing authURI \n" unless defined $AuthURI; + $error .="malformed authURI; must be the domain name only with no http prefix or trailing path information \n" if $AuthURI =~ '[/:]'; $error .="missing contactEmail \n" unless defined $contactEmail; $error .="missing URL \n" unless defined $URL; $error .="missing description \n" unless defined $desc; From mwilkinson at pub.open-bio.org Sat Nov 1 10:53:14 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:38:42 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011553.hA1FrExw004679@pub.open-bio.org> mwilkinson Sat Nov 1 10:53:14 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv4633/Client Modified Files: Central.pm ServiceInstance.html ServiceInstance.pm Log Message: pass the authoritative flag back to a service instance object since it should be there, and now we need it for the LSID resolution service moby-live/Perl/MOBY/Client Central.pm,1.57,1.58 ServiceInstance.html,1.3,1.4 ServiceInstance.pm,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.57 retrieving revision 1.58 diff -u -r1.57 -r1.58 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2003/10/22 14:27:46 1.57 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2003/11/01 15:53:13 1.58 @@ -1438,6 +1438,7 @@ my $AuthURI = $Service->getAttributeNode('authURI')->getValue; my $servicename = $Service->getAttributeNode('serviceName')->getValue; my $Type = &_nodeTextContent($Service, 'serviceType'); + my $authoritative = &_nodeTextContent($Service, 'authoritative'); #my $Output = &_nodeTextContent($Service, 'outputObject'); my $Description = &_nodeTextContent($Service, 'Description'); my $cat = &_nodeTextContent($Service, 'Category'); @@ -1471,6 +1472,7 @@ my $Instance = MOBY::Client::ServiceInstance->new( authority => $AuthURI, + authoritative => $authoritative, name => $servicename, type => $Type, category => $cat, =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html 2003/07/01 15:00:47 1.3 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html 2003/11/01 15:53:14 1.4 @@ -26,6 +26,7 @@
  • input
  • output
  • description
  • +
  • authoritative
  • registry
  • @@ -148,6 +149,15 @@ Returns : string

    +

    authoritative

    +
    + Title     :    authoritative
    + Usage     :    $description = $Service->authoritative(1|0)
    + Args      :    (optional) boolean 1 or 0
    + Function  :    get/set authoritative flag
    + Returns   :    current value
    +

    +

    registry

      Title     :    registry
    
    ===================================================================
    RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm,v
    retrieving revision 1.5
    retrieving revision 1.6
    diff -u -r1.5 -r1.6
    --- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm	2003/07/01 15:00:47	1.5
    +++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm	2003/11/01 15:53:14	1.6
    @@ -129,6 +129,17 @@
     =cut
     
     
    +=head2 authoritative
    +
    + Title     :	authoritative
    + Usage     :	$description = $Service->authoritative(1|0)
    + Args      :    (optional) boolean 1 or 0
    + Function  :	get/set authoritative flag
    + Returns   :	current value
    +
    +=cut
    +
    +
     =head2 registry
     
      Title     :	registry
    @@ -155,6 +166,7 @@
                           description   => [undef,      'read/write'],
     					  registry		=> ['MOBY_Central', 		'read/write'],
     					  XML           => [undef, 		'read/write'],
    +					  authoritative => [undef,		'read/write'],
     				);
     
        #_____________________________________________________________
    
    From mwilkinson at pub.open-bio.org  Sat Nov  1 11:02:53 2003
    From: mwilkinson at pub.open-bio.org (Mark Wilkinson)
    Date: Mon Nov  3 10:38:54 2003
    Subject: [MOBY-guts] biomoby commit
    Message-ID: <200311011602.hA1G2rC5005294@pub.open-bio.org>
    
    
    mwilkinson
    Sat Nov  1 11:02:53 EST 2003
    Update of /home/repository/moby/moby-live/Perl/MOBY/Client
    In directory pub.open-bio.org:/tmp/cvs-serv5271/Client
    
    Modified Files:
    	Central.pm ServiceInstance.pm 
    Log Message:
    pass the URL back to a service instance object since it should be there, and now we need it for the LSID resolution service
    
    moby-live/Perl/MOBY/Client Central.pm,1.58,1.59 ServiceInstance.pm,1.6,1.7
    ===================================================================
    RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v
    retrieving revision 1.58
    retrieving revision 1.59
    diff -u -r1.58 -r1.59
    --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm	2003/11/01 15:53:13	1.58
    +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm	2003/11/01 16:02:52	1.59
    @@ -1439,6 +1439,7 @@
             my $servicename = $Service->getAttributeNode('serviceName')->getValue;
             my $Type = &_nodeTextContent($Service, 'serviceType');
             my $authoritative = &_nodeTextContent($Service, 'authoritative');
    +        my $URL = &_nodeTextContent($Service, 'URL');
             #my $Output = &_nodeTextContent($Service, 'outputObject');
             my $Description = &_nodeTextContent($Service, 'Description');
             my $cat = &_nodeTextContent($Service, 'Category');
    @@ -1473,6 +1474,7 @@
             my $Instance = MOBY::Client::ServiceInstance->new(
                 authority => $AuthURI,
     			authoritative => $authoritative,
    +			URL => $URL,
                 name => $servicename,
                 type => $Type,
                 category => $cat,
    
    ===================================================================
    RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm,v
    retrieving revision 1.6
    retrieving revision 1.7
    diff -u -r1.6 -r1.7
    --- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm	2003/11/01 15:53:14	1.6
    +++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm	2003/11/01 16:02:52	1.7
    @@ -132,7 +132,7 @@
     =head2 authoritative
     
      Title     :	authoritative
    - Usage     :	$description = $Service->authoritative(1|0)
    + Usage     :	$auth = $Service->authoritative(1|0)
      Args      :    (optional) boolean 1 or 0
      Function  :	get/set authoritative flag
      Returns   :	current value
    @@ -140,6 +140,17 @@
     =cut
     
     
    +=head2 URL
    +
    + Title     :    URL
    + Usage     :	$URL = $Service->URL($url)
    + Args      :    (optional) string representing a URL
    + Function  :	get/set service URL endpoint
    + Returns   :	current value
    +
    +=cut
    +
    +
     =head2 registry
     
      Title     :	registry
    @@ -167,6 +178,7 @@
     					  registry		=> ['MOBY_Central', 		'read/write'],
     					  XML           => [undef, 		'read/write'],
     					  authoritative => [undef,		'read/write'],
    +					  URL			=> [undef, 		'read/write'],
     				);
     
        #_____________________________________________________________
    
    From mwilkinson at pub.open-bio.org  Sat Nov  1 11:03:04 2003
    From: mwilkinson at pub.open-bio.org (Mark Wilkinson)
    Date: Mon Nov  3 10:39:00 2003
    Subject: [MOBY-guts] biomoby commit
    Message-ID: <200311011603.hA1G34Sn005339@pub.open-bio.org>
    
    
    mwilkinson
    Sat Nov  1 11:03:04 EST 2003
    Update of /home/repository/moby/moby-live/Perl/MOBY/Client
    In directory pub.open-bio.org:/tmp/cvs-serv5320/Client
    
    Modified Files:
    	ServiceInstance.html 
    Log Message:
    pass the URL back to a service instance object since it should be there, and now we need it for the LSID resolution service
    
    moby-live/Perl/MOBY/Client ServiceInstance.html,1.4,1.5
    ===================================================================
    RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html,v
    retrieving revision 1.4
    retrieving revision 1.5
    diff -u -r1.4 -r1.5
    --- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html	2003/11/01 15:53:14	1.4
    +++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html	2003/11/01 16:03:04	1.5
    @@ -27,6 +27,7 @@
     		
  • output
  • description
  • authoritative
  • +
  • URL
  • registry
  • @@ -152,12 +153,21 @@

    authoritative

      Title     :    authoritative
    - Usage     :    $description = $Service->authoritative(1|0)
    + Usage     :    $auth = $Service->authoritative(1|0)
      Args      :    (optional) boolean 1 or 0
      Function  :    get/set authoritative flag
      Returns   :    current value

    +

    URL

    +
    + Title     :    URL
    + Usage     :    $URL = $Service->URL($url)
    + Args      :    (optional) string representing a URL
    + Function  :    get/set service URL endpoint
    + Returns   :    current value
    +

    +

    registry

      Title     :    registry
    
    From mwilkinson at pub.open-bio.org  Sat Nov  1 11:42:14 2003
    From: mwilkinson at pub.open-bio.org (Mark Wilkinson)
    Date: Mon Nov  3 10:39:12 2003
    Subject: [MOBY-guts] biomoby commit
    Message-ID: <200311011642.hA1GgERt007577@pub.open-bio.org>
    
    
    mwilkinson
    Sat Nov  1 11:42:14 EST 2003
    Update of /home/repository/moby/moby-live/Perl/MOBY/Client
    In directory pub.open-bio.org:/tmp/cvs-serv7526/Client
    
    Modified Files:
    	Central.pm ServiceInstance.html ServiceInstance.pm 
    Log Message:
    changed the output of the findService method to return XML elements for the service endpoint and the contact email address.  This should be a backward-compatible change.  Updated the client code accordingly.  updated the ServiceInstance object to hold this new data.  Updated documentation
    
    moby-live/Perl/MOBY/Client Central.pm,1.59,1.60 ServiceInstance.html,1.5,1.6 ServiceInstance.pm,1.7,1.8
    ===================================================================
    RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v
    retrieving revision 1.59
    retrieving revision 1.60
    diff -u -r1.59 -r1.60
    --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm	2003/11/01 16:02:52	1.59
    +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm	2003/11/01 16:42:14	1.60
    @@ -1439,6 +1439,7 @@
             my $servicename = $Service->getAttributeNode('serviceName')->getValue;
             my $Type = &_nodeTextContent($Service, 'serviceType');
             my $authoritative = &_nodeTextContent($Service, 'authoritative');
    +        my $contactEmail = &_nodeTextContent($Service, 'contactEmail');
             my $URL = &_nodeTextContent($Service, 'URL');
             #my $Output = &_nodeTextContent($Service, 'outputObject');
             my $Description = &_nodeTextContent($Service, 'Description');
    @@ -1475,6 +1476,7 @@
                 authority => $AuthURI,
     			authoritative => $authoritative,
     			URL => $URL,
    +			contactEmail => $contactEmail,
                 name => $servicename,
                 type => $Type,
                 category => $cat,
    
    ===================================================================
    RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html,v
    retrieving revision 1.5
    retrieving revision 1.6
    diff -u -r1.5 -r1.6
    --- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html	2003/11/01 16:03:04	1.5
    +++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html	2003/11/01 16:42:14	1.6
    @@ -28,6 +28,7 @@
     		
  • description
  • authoritative
  • URL
  • +
  • contactEmail
  • registry
  • @@ -168,6 +169,15 @@ Returns : current value

    +

    contactEmail

    +
    + Title     :    contactEmail
    + Usage     :    $email = $Service->contactEmail($email)
    + Args      :    (optional) string representing an email address
    + Function  :    get/set service email address
    + Returns   :    current value
    +

    +

    registry

      Title     :    registry
    
    ===================================================================
    RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm,v
    retrieving revision 1.7
    retrieving revision 1.8
    diff -u -r1.7 -r1.8
    --- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm	2003/11/01 16:02:52	1.7
    +++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm	2003/11/01 16:42:14	1.8
    @@ -151,6 +151,17 @@
     =cut
     
     
    +=head2 contactEmail
    +
    + Title     :    contactEmail
    + Usage     :	$email = $Service->contactEmail($email)
    + Args      :    (optional) string representing an email address
    + Function  :	get/set service email address
    + Returns   :	current value
    +
    +=cut
    +
    +
     =head2 registry
     
      Title     :	registry
    @@ -179,6 +190,7 @@
     					  XML           => [undef, 		'read/write'],
     					  authoritative => [undef,		'read/write'],
     					  URL			=> [undef, 		'read/write'],
    +					  contactEmail	=> [undef, 		'read/write'],
     				);
     
        #_____________________________________________________________
    
    From mwilkinson at pub.open-bio.org  Sat Nov  1 12:48:56 2003
    From: mwilkinson at pub.open-bio.org (Mark Wilkinson)
    Date: Mon Nov  3 10:39:19 2003
    Subject: [MOBY-guts] biomoby commit
    Message-ID: <200311011748.hA1HmuoI011380@pub.open-bio.org>
    
    
    mwilkinson
    Sat Nov  1 12:48:56 EST 2003
    Update of /home/repository/moby/moby-live/Perl/lsid/authority
    In directory pub.open-bio.org:/tmp/cvs-serv11357/lsid/authority
    
    Modified Files:
    	RDFConfigure.pm metadata.pl 
    Added Files:
    	ServiceInstanceResolver.pm 
    Log Message:
    added a prototype service instance LSID resolver.  I'm not sure that the RDF graph of this is correct, and it also ignores secondary parameters, so it isn't complete either.  It uses the predicate vocabulary that we agreed upon at the I3C meeting in Hinxton, so we should be able to discover both myGrid and MOBY services with identical meta data vocabularies.  This will also allow third parties to construct and publish workflows by referring to MOBY and/or myGrid services by their LSID's.
    
    moby-live/Perl/lsid/authority ServiceInstanceResolver.pm,NONE,1.1 RDFConfigure.pm,1.4,1.5 metadata.pl,1.7,1.8
    ===================================================================
    RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/RDFConfigure.pm,v
    retrieving revision 1.4
    retrieving revision 1.5
    diff -u -r1.4 -r1.5
    --- /home/repository/moby/moby-live/Perl/lsid/authority/RDFConfigure.pm	2003/11/01 14:10:05	1.4
    +++ /home/repository/moby/moby-live/Perl/lsid/authority/RDFConfigure.pm	2003/11/01 17:48:56	1.5
    @@ -29,7 +29,8 @@
     xmlns:rdfs='http://www.w3.org/2000/01/rdf-schema#'
     xmlns:dc='http://purl.org/dc/elements/1.1/'
     xmlns:i3cp='urn:lsid:i3c.org:predicates:'
    -xmlns:mobyp='urn:lsid:biomoby.org:rdfpredicate:'>\n\n";
    +xmlns:mobyp='urn:lsid:biomoby.org:rdfpredicate:'
    +xmlns:i3csp='urn:lsid:i3c.org:services:'>\n\n";
     our $RDF_SUFFIX= "";
     
     
    @@ -47,6 +48,33 @@
     ";
     }
     
    +sub rdfBnode {
    +	my ($subj, $pred, $id)= @_;
    +	return "
    +\t<$pred rdf:nodeID='$id'/>
    +";
    +}
    +
    +sub rdfBnodeResource {
    +	my ($subj, $pred, $obj)= @_;
    +	return "
    +\t<$pred rdf:resource='$obj'/>
    +";
    +}
    +
    +sub rdfBnodeLiteral {
    +	my ($subj, $pred, $obj)= @_;
    +	return "
    +\t<$pred>$obj
    +";
    +}
    +
    +sub rdfBnodeBnode {
    +	my ($subj, $pred, $id)= @_;
    +	return "
    +\t<$pred rdf:nodeID='$id'/>
    +";
    +}
     
     sub _die {
         my $m = shift;
    
    ===================================================================
    RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl,v
    retrieving revision 1.7
    retrieving revision 1.8
    diff -u -r1.7 -r1.8
    --- /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl	2003/11/01 14:10:05	1.7
    +++ /home/repository/moby/moby-live/Perl/lsid/authority/metadata.pl	2003/11/01 17:48:56	1.8
    @@ -25,6 +25,7 @@
     use ServiceResolver qw(:all);
     use RelationshipResolver qw(:all);
     use PredicateResolver qw(:all);
    +use ServiceInstanceResolver qw(:all);
     
     my %known_types = (  # switch on/off various LSID-namespace resolvers.
         'namespacetype' => 1,
    @@ -32,7 +33,7 @@
         'servicetype' => 1,
         'servicerelation' => 1,
         'objectrelation' => 1,
    -    'serviceinstance' => 0,
    +    'serviceinstance' => 1,
         'rdfpredicate' => 1,
                       );
     
    @@ -76,6 +77,7 @@
         return resolve_relationshiptype($relationshipdb,$lsid) if $1 eq "objectrelation";
         return resolve_relationshiptype($relationshipdb,$lsid) if $1 eq "servicerelation";
         return resolve_mobyPredicate($lsid) if $1 eq "rdfpredicate";
    +    return resolve_ServiceInstance($lsid) if $1 eq "serviceinstance";
         
     }
     
    
    From mwilkinson at pub.open-bio.org  Sat Nov  1 13:04:44 2003
    From: mwilkinson at pub.open-bio.org (Mark Wilkinson)
    Date: Mon Nov  3 10:39:25 2003
    Subject: [MOBY-guts] biomoby commit
    Message-ID: <200311011804.hA1I4inL012219@pub.open-bio.org>
    
    
    mwilkinson
    Sat Nov  1 13:04:44 EST 2003
    Update of /home/repository/moby/moby-live/Perl/MOBY/Client
    In directory pub.open-bio.org:/tmp/cvs-serv12200/MOBY/Client
    
    Modified Files:
    	ServiceInstance.pm 
    Log Message:
    forgot to export the new RDF graph writing subs
    
    moby-live/Perl/MOBY/Client ServiceInstance.pm,1.8,1.9
    ===================================================================
    RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm,v
    retrieving revision 1.8
    retrieving revision 1.9
    diff -u -r1.8 -r1.9
    --- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm	2003/11/01 16:42:14	1.8
    +++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.pm	2003/11/01 18:04:44	1.9
    @@ -14,6 +14,9 @@
      use MOBY::Client::ServiceInstance;
      my $Instance = MOBY::Client::ServieInstance->new(
          authority => 'bioinfo.pbi.nrc.ca',
    +     authoritative => 0,
    +     URL => http://bioinfo.pbi.nrc.ca/runMe.pl,
    +     contactEmail => markw@illumin.com,
          name => 'marksFabulousService',
          type => 'Retrieve',
     	 category => 'moby',
    @@ -33,8 +36,7 @@
     
     =head1 AUTHORS
     
    -Mark Wilkinson (mwilkinson@gene.pbi.nrc.ca)
    -Plant Biotechnology Institute, National Research Council of Canada.
    +Mark Wilkinson (markw at illuminae dot com)
     
     BioMOBY Project:  http://www.biomoby.org
     
    
    From mwilkinson at pub.open-bio.org  Sat Nov  1 13:04:44 2003
    From: mwilkinson at pub.open-bio.org (Mark Wilkinson)
    Date: Mon Nov  3 10:39:31 2003
    Subject: [MOBY-guts] biomoby commit
    Message-ID: <200311011804.hA1I4iq2012238@pub.open-bio.org>
    
    
    mwilkinson
    Sat Nov  1 13:04:44 EST 2003
    Update of /home/repository/moby/moby-live/Perl/lsid/authority
    In directory pub.open-bio.org:/tmp/cvs-serv12200/lsid/authority
    
    Modified Files:
    	RDFConfigure.pm 
    Log Message:
    forgot to export the new RDF graph writing subs
    
    moby-live/Perl/lsid/authority RDFConfigure.pm,1.5,1.6
    ===================================================================
    RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/RDFConfigure.pm,v
    retrieving revision 1.5
    retrieving revision 1.6
    diff -u -r1.5 -r1.6
    --- /home/repository/moby/moby-live/Perl/lsid/authority/RDFConfigure.pm	2003/11/01 17:48:56	1.5
    +++ /home/repository/moby/moby-live/Perl/lsid/authority/RDFConfigure.pm	2003/11/01 18:04:44	1.6
    @@ -5,24 +5,6 @@
     use base 'Exporter';
     require Exporter;
     
    -our @EXPORT_OK = qw(
    -    $SERVICE_CGI
    -    $RDF_PREFIX
    -    $RDF_SUFFIX
    -    rdfLiteral
    -    rdfResource
    -    _die
    -    );
    -our %EXPORT_TAGS =(all => [qw(
    -    $SERVICE_CGI
    -    $RDF_PREFIX
    -    $RDF_SUFFIX
    -    rdfLiteral
    -    rdfResource
    -    _die
    -    )]);
    -
    -
     our $SERVICE_CGI= 'http://localhost:80/cgi-bin/authority/metadata.pl';
     our $RDF_PREFIX="
      [qw(
    +    $SERVICE_CGI
    +    $RDF_PREFIX
    +    $RDF_SUFFIX
    +    rdfLiteral
    +    rdfResource
    +    rdfBnode
    +    rdfBnodeResource
    +    rdfBnodeLiteral
    +    rdfBnodeBnode
    +    _die
    +    )]);
    +
     1;
    
    From mwilkinson at pub.open-bio.org  Sat Nov  1 13:05:55 2003
    From: mwilkinson at pub.open-bio.org (Mark Wilkinson)
    Date: Mon Nov  3 10:39:34 2003
    Subject: [MOBY-guts] biomoby commit
    Message-ID: <200311011805.hA1I5t0O012289@pub.open-bio.org>
    
    
    mwilkinson
    Sat Nov  1 13:05:55 EST 2003
    Update of /home/repository/moby/moby-live/Perl/MOBY/Client
    In directory pub.open-bio.org:/tmp/cvs-serv12269/MOBY/Client
    
    Modified Files:
    	ServiceInstance.html 
    Log Message:
    forgot to export the new RDF graph writing subs
    
    moby-live/Perl/MOBY/Client ServiceInstance.html,1.6,1.7
    ===================================================================
    RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html,v
    retrieving revision 1.6
    retrieving revision 1.7
    diff -u -r1.6 -r1.7
    --- /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html	2003/11/01 16:42:14	1.6
    +++ /home/repository/moby/moby-live/Perl/MOBY/Client/ServiceInstance.html	2003/11/01 18:05:55	1.7
    @@ -48,6 +48,9 @@
      use MOBY::Client::ServiceInstance;
      my $Instance = MOBY::Client::ServieInstance->new(
          authority => 'bioinfo.pbi.nrc.ca',
    +     authoritative => 0,
    +     URL => http://bioinfo.pbi.nrc.ca/runMe.pl,
    +     contactEmail => markw@illumin.com,
          name => 'marksFabulousService',
          type => 'Retrieve',
              category => 'moby',
    @@ -66,8 +69,7 @@
     


    AUTHORS

    -

    Mark Wilkinson (mwilkinson@gene.pbi.nrc.ca) -Plant Biotechnology Institute, National Research Council of Canada.

    +

    Mark Wilkinson (markw at illuminae dot com)

    BioMOBY Project: http://www.biomoby.org

    From mwilkinson at pub.open-bio.org Sat Nov 1 13:25:03 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:39:39 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011825.hA1IP31r013429@pub.open-bio.org> mwilkinson Sat Nov 1 13:25:03 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv13410 Modified Files: ServiceInstanceResolver.pm Log Message: primary inputs and outputs were referring to the same bnode because the counter was reset. I have re-numbered them to be unique now moby-live/Perl/lsid/authority ServiceInstanceResolver.pm,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/ServiceInstanceResolver.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/lsid/authority/ServiceInstanceResolver.pm 2003/11/01 17:48:56 1.1 +++ /home/repository/moby/moby-live/Perl/lsid/authority/ServiceInstanceResolver.pm 2003/11/01 18:25:02 1.2 @@ -158,8 +158,8 @@ 'i3csp:primaryOutput', # primaryInput bnode 'primaryOutput' ); - my $out= 0; - foreach (@outputs){ + my $out= $in; # switch for readability + foreach (@outputs){ ++$out; $mdata .= rdfBnodeBnode( 'primaryOutput', From mwilkinson at pub.open-bio.org Sat Nov 1 13:34:52 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:39:43 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011834.hA1IYqH1014010@pub.open-bio.org> mwilkinson Sat Nov 1 13:34:52 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv13991 Modified Files: ServiceInstanceResolver.pm Log Message: primary inputs and outputs articlenames were given same predicate as the service name. bad bad bad. I'm leaving them in there even if they are blank for the moment so that Chris can see how my entire graph is structured. In the future I will not write them out if the value is null. moby-live/Perl/lsid/authority ServiceInstanceResolver.pm,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/ServiceInstanceResolver.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/lsid/authority/ServiceInstanceResolver.pm 2003/11/01 18:25:02 1.2 +++ /home/repository/moby/moby-live/Perl/lsid/authority/ServiceInstanceResolver.pm 2003/11/01 18:34:52 1.3 @@ -122,7 +122,7 @@ ); $mdata .= rdfBnodeLiteral( "primaryParameter$in", - 'i3csp:name', + 'i3csp:parameterName', $_->articleName ); if ($_->isSimple){ @@ -168,7 +168,7 @@ ); $mdata .= rdfBnodeLiteral( "primaryParameter$out", - 'i3csp:name', + 'i3csp:parameterName', $_->articleName ); if ($_->isSimple){ From mwilkinson at pub.open-bio.org Sat Nov 1 13:38:22 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 10:39:47 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311011838.hA1IcMuK014093@pub.open-bio.org> mwilkinson Sat Nov 1 13:38:22 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv14073 Modified Files: ServiceInstanceResolver.pm Log Message: input and output had different predicates for their simple articles. ick. moby-live/Perl/lsid/authority ServiceInstanceResolver.pm,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/ServiceInstanceResolver.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Perl/lsid/authority/ServiceInstanceResolver.pm 2003/11/01 18:34:52 1.3 +++ /home/repository/moby/moby-live/Perl/lsid/authority/ServiceInstanceResolver.pm 2003/11/01 18:38:22 1.4 @@ -175,7 +175,7 @@ $mdata .= rdfBnodeResource( "primaryParameter$out", 'i3csp:parameterType', - 'i3csp:simpleType' + 'i3csp:mobySimpleType' ); $mdata .= rdfBnodeResource( "primaryParameter$out", @@ -186,7 +186,7 @@ $mdata .= rdfBnodeResource( "primaryParameter$out", 'i3csp:parameterType', - 'i3csp:collectionType' + 'i3csp:mobyCollectionType' ); my $simps = $_->Simples; foreach my $simp(@{$simps}){ From mwilkinson at pub.open-bio.org Mon Nov 3 17:37:34 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 17:30:27 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311032237.hA3MbYT2022781@pub.open-bio.org> mwilkinson Mon Nov 3 17:37:34 EST 2003 Update of /home/repository/moby/moby-live/Perl/docs In directory pub.open-bio.org:/tmp/cvs-serv22765 Removed Files: INSTALL-Service_Provider.txt Log Message: removing deprecated documentation moby-live/Perl/docs INSTALL-Service_Provider.txt,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Perl/docs/RCS/INSTALL-Service_Provider.txt,v: No such file or directory From mwilkinson at pub.open-bio.org Mon Nov 3 20:48:10 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 3 20:41:01 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311040148.hA41mAO5032635@pub.open-bio.org> mwilkinson Mon Nov 3 20:48:10 EST 2003 Update of /home/repository/moby/moby-live/Perl/lsid/authority In directory pub.open-bio.org:/tmp/cvs-serv32616/lsid/authority Modified Files: authority.pl Log Message: this should make LSID resolution kick into life moby-live/Perl/lsid/authority authority.pl,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/lsid/authority/authority.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Perl/lsid/authority/authority.pl 2003/11/01 11:17:24 1.2 +++ /home/repository/moby/moby-live/Perl/lsid/authority/authority.pl 2003/11/04 01:48:10 1.3 @@ -34,7 +34,7 @@ type => 'metaDataPortType', protocol => $LS::Authority::WSDL::HTTP, method => 'GET', - location => "localhost", + location => "mobycentral.cbr.nrc.ca", operations => { getMetaData => "/cgi-bin/authority/metadata.pl?lsid=$lsid" } From cherburtner at lauvabrum.hasmoved.com Tue Nov 4 10:59:34 2003 From: cherburtner at lauvabrum.hasmoved.com (Female Update) Date: Tue Nov 4 11:58:39 2003 Subject: [MOBY-guts] L|ps SO Plump - your friends will be envious! Message-ID: An HTML attachment was scrubbed... URL: http://portal.open-bio.org/pipermail/moby-guts/attachments/20031104/dcbd6e93/attachment.htm From sixtadenby at prorsus.prospectivebuyers.com Tue Nov 11 06:11:32 2003 From: sixtadenby at prorsus.prospectivebuyers.com (Beauty Secret) Date: Tue Nov 11 07:15:33 2003 Subject: [MOBY-guts] Get Plumper & Sexier L|ps Message-ID: An HTML attachment was scrubbed... URL: http://portal.open-bio.org/pipermail/moby-guts/attachments/20031111/da65fcc0/attachment.htm From senger at pub.open-bio.org Sat Nov 8 20:05:02 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 15:13:55 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311090105.hA9152W9021554@pub.open-bio.org> senger Sat Nov 8 20:05:02 EST 2003 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv21510/docs Modified Files: ChangeLog Log Message: moby-live/Java/docs ChangeLog,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/08 00:27:24 1.4 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/09 01:05:02 1.5 @@ -1,3 +1,7 @@ +2003-11-09 Martin Senger + + * Added servlet properties for HTTP proxies and path to 'dot'. + 2003-11-07 Martin Senger * Added BioMoby Graphs (command-line client and a servlet-based From senger at pub.open-bio.org Sat Nov 8 20:52:28 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 15:14:11 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311090152.hA91qSQj021795@pub.open-bio.org> senger Sat Nov 8 20:52:28 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv21776/src/main/org/biomoby/client Modified Files: GraphsServlet.java Log Message: moby-live/Java/src/main/org/biomoby/client GraphsServlet.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/09 01:05:02 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/09 01:52:28 1.3 @@ -667,9 +667,9 @@ // where is the 'dot' program String dotProg = "dot"; - String dotPath = getString (req, DOT_PATH); + String dotPath = (String)initParams.get (DOT_PATH); if (dotPath != null) - dotProg = dotPath + System.getProperty ("file.sparator") + dotProg; + dotProg = dotPath + System.getProperty ("file.separator") + dotProg; // depending on the cache implementation we may ask // 'dot' to produce output to its standard output, or @@ -742,9 +742,9 @@ // where is the 'dot' program String dotProg = "dot"; - String dotPath = getString (req, DOT_PATH); + String dotPath = (String)initParams.get (DOT_PATH); if (dotPath != null) - dotProg = dotPath + System.getProperty ("file.sparator") + dotProg; + dotProg = dotPath + System.getProperty ("file.separator") + dotProg; // depending on the cache implementation we may ask // 'dot' to produce output to its standard output, or From senger at pub.open-bio.org Fri Nov 7 19:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 15:14:21 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROes017330@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv17161/src/Clients/help Modified Files: MobyGraphs_usage.txt Log Message: added graphs for exploring biomoby registry moby-live/Java/src/Clients/help MobyGraphs_usage.txt,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2003/10/17 13:13:34 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2003/11/08 00:27:24 1.2 @@ -1,15 +1,27 @@ Usage: java MobyGraphs -h[elp] - java MobyGraphs [] + java MobyGraphs -q ... quiet mode - -debug ... print debug messages -d ... graph showing data types -s ... graph showing services -t ... reserved: for the graph of service types - outputs: + output format: + -dot ... (this is default) + -rdf ... (this works only for graph of services) + + output filter (what to be included, + only used for services): + -auth + -name + -depth ... an integer, how far to go from + given services (default is 1) + or + -path + + output destinations: -fd ... where to put the data types graph (makes sense only together with -d) -fs ... where to put the services graph From mwilkinson at pub.open-bio.org Wed Nov 12 11:08:52 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed Nov 12 15:14:29 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121608.hACG8qhe011391@pub.open-bio.org> mwilkinson Wed Nov 12 11:08:52 EST 2003 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv11376 Added Files: debug_a_service.pl Log Message: added a simple service debugging script moby-live/Perl/scripts debug_a_service.pl,NONE,1.1 From mwilkinson at pub.open-bio.org Wed Nov 12 11:12:47 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed Nov 12 15:14:30 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121612.hACGCl3K011506@pub.open-bio.org> mwilkinson Wed Nov 12 11:12:47 EST 2003 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv11491 Added Files: debugYourService Log Message: oops. Forgot to set the executable flag. Have to rename the file to get CVS to accept this kind of change moby-live/Perl/scripts debugYourService,NONE,1.1 From senger at pub.open-bio.org Sat Nov 8 20:05:02 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:13:52 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311090105.hA9152Df021535@pub.open-bio.org> senger Sat Nov 8 20:05:02 EST 2003 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv21510 Modified Files: build.properties.template build.xml Log Message: moby-live/Java build.properties.template,1.1,1.2 build.xml,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.properties.template,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/build.properties.template 2003/11/08 00:27:23 1.1 +++ /home/repository/moby/moby-live/Java/build.properties.template 2003/11/09 01:05:02 1.2 @@ -7,6 +7,11 @@ build.compiler = jikes +#dot.path = /path/to/dot +#proxySet = true +#http.proxyHost = your proxy host +#http.proxyPort = your proxy port + # all other properties are used only if you wish to deploy jMoby # servlets into your Tomcat - the more verbose description of these # properties is in the deployment descriptor in =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/build.xml 2003/11/08 21:05:51 1.5 +++ /home/repository/moby/moby-live/Java/build.xml 2003/11/09 01:05:02 1.6 @@ -196,6 +196,18 @@ + + + + + + + + + + + + @@ -380,6 +392,10 @@ + + + + senger Sat Nov 8 20:05:02 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs In directory pub.open-bio.org:/tmp/cvs-serv21510/docs/graphs Modified Files: index.html Log Message: moby-live/Java/docs/graphs index.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/graphs/index.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/graphs/index.html 2003/11/08 00:27:24 1.1 +++ /home/repository/moby/moby-live/Java/docs/graphs/index.html 2003/11/09 01:05:02 1.2 @@ -27,7 +27,7 @@ The BioMoby Graphs are available:
      -
    • As an experimental +
    • As an experimental interactive service (implemented as a Java servlet).

    • The graphs can be also created from the command-line provided that @@ -49,7 +49,7 @@ Click on the thumbnail to see a graph of data types (notice that this is not a current graph - -for the current data go to the interactive service). +for the current data go to the interactive service).

      @@ -126,7 +126,7 @@

      Suggestions, comments, and bug reports to:
      Martin Senger
      -Last modified: Fri Nov 7 22:37:27 2003 +Last modified: Sun Nov 9 00:21:16 2003
      From senger at pub.open-bio.org Sat Nov 8 20:05:03 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:14:02 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311090105.hA91533e021596@pub.open-bio.org> senger Sat Nov 8 20:05:02 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv21510/src/main/org/biomoby/client Modified Files: FileCache.java GraphsServlet.java Log Message: moby-live/Java/src/main/org/biomoby/client FileCache.java,1.1,1.2 GraphsServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/FileCache.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/FileCache.java 2003/11/08 00:27:24 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/FileCache.java 2003/11/09 01:05:02 1.2 @@ -128,7 +128,7 @@ parent.mkdirs(); if (parent.exists()) return filename; - throw new IOException ("Cannot create all needed directories."); + throw new IOException ("Cannot create all needed directories: '" + parent.toString() + "'."); } /************************************************************************** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/08 00:27:24 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/09 01:05:02 1.2 @@ -41,6 +41,10 @@ static final protected String CACHE_URL = "cache_url"; static final protected String DEFAULT_ENDPOINT = "default_endpoint"; static final protected String DEFAULT_NAMESPACE = "default_namespace"; + static final protected String PROXY_SET = "proxySet"; + static final protected String PROXY_PORT = "http.proxyPort"; + static final protected String PROXY_HOST = "http.proxyHost"; + static final protected String DOT_PATH = "dot_path"; // expected/known form's element names static final protected String VERBOSE = "verbose"; @@ -214,6 +218,19 @@ defaultNamespace = (String)initParams.get (DEFAULT_NAMESPACE); if (UUtils.isEmpty (defaultNamespace)) defaultNamespace = CentralImpl.DEFAULT_NAMESPACE; + + // set HTTP proxy - this is probably useless because (I guess) + // the proxy can be set in the Tomcat configuration file (and + // not to let each servlet to do it) - but it's here, anyway + String proxySet = (String)initParams.get (PROXY_SET); + if (! UUtils.isEmpty (proxySet)) + System.setProperty (PROXY_SET, proxySet); + String proxyPort = (String)initParams.get (PROXY_PORT); + if (! UUtils.isEmpty (proxyPort)) + System.setProperty (PROXY_PORT, proxyPort); + String proxyHost = (String)initParams.get (PROXY_HOST); + if (! UUtils.isEmpty (proxyHost)) + System.setProperty (PROXY_HOST, proxyHost); } /************************************************************************* @@ -648,6 +665,12 @@ } else { graph = Graphviz.createServicesGraph (edges, props); + // where is the 'dot' program + String dotProg = "dot"; + String dotPath = getString (req, DOT_PATH); + if (dotPath != null) + dotProg = dotPath + System.getProperty ("file.sparator") + dotProg; + // depending on the cache implementation we may ask // 'dot' to produce output to its standard output, or // to write to a file @@ -657,12 +680,12 @@ String filename = cache.getFilename (id); // call 'dot' to create a real graph in a 'filename' - executeDot (graph, wantedOutputType, filename); + executeDot (dotProg, graph, wantedOutputType, filename); } else { // call 'dot' to return a real graph as byte array - byte[] graphBytes = executeDot (graph, wantedOutputType); + byte[] graphBytes = executeDot (dotProg, graph, wantedOutputType); if (graphBytes == null || graphBytes.length == 0) throw new MobyException ("An empty graph. Strange."); cache.setContents (id, graphBytes); @@ -716,6 +739,13 @@ log ("Creating a graph of the data types...\n"); String dotGraph = Graphviz.createDataTypesGraph (dataTypes, props); + + // where is the 'dot' program + String dotProg = "dot"; + String dotPath = getString (req, DOT_PATH); + if (dotPath != null) + dotProg = dotPath + System.getProperty ("file.sparator") + dotProg; + // depending on the cache implementation we may ask // 'dot' to produce output to its standard output, or // to write to a file @@ -725,12 +755,12 @@ String filename = cache.getFilename (id); // call 'dot' to create a real graph in a 'filename' - executeDot (dotGraph, wantedOutputType, filename); + executeDot (dotProg, dotGraph, wantedOutputType, filename); } else { // call 'dot' to return a real graph as byte array - byte[] graph = executeDot (dotGraph, wantedOutputType); + byte[] graph = executeDot (dotProg, dotGraph, wantedOutputType); if (graph == null || graph.length == 0) throw new MobyException ("An empty graph. Strange."); cache.setContents (id, graph); @@ -821,17 +851,18 @@ } /******************************************************************** - * Execute 'dot' program with the given graph description in + * Execute 'dotProg' program with the given graph description in * 'dotGraph' in order to create a graph in 'outputType' * format. The graph is created in the given file 'filename'. ********************************************************************/ - protected void executeDot (String dotGraph, String outputType, String filename) + protected void executeDot (String dotProg, String dotGraph, + String outputType, String filename) throws MobyException { if (outputType.equals ("txt")) outputType = "plain-ext"; - String[] cmdLine = new String[] { "dot", "-T" + outputType, "-o" + filename }; + String[] cmdLine = new String[] { dotProg, "-T" + outputType, "-o" + filename }; String[] envArr = new String[] {}; // no environment try { // start an external process @@ -852,17 +883,17 @@ } /******************************************************************** - * Execute 'dot' program with the given graph description in + * Execute 'dotProg' program with the given graph description in * 'dotGraph' in order to create a graph in 'outputType' * format. The created graph is returned back as a byte array. ********************************************************************/ - protected byte[] executeDot (String dotGraph, String outputType) + protected byte[] executeDot (String dotProg, String dotGraph, String outputType) throws MobyException { if (outputType.equals ("txt")) outputType = "plain-ext"; - String[] cmdLine = new String[] { "dot", "-T" + outputType }; + String[] cmdLine = new String[] { dotProg, "-T" + outputType }; String[] envArr = new String[] {}; // no environment try { // start an external process From senger at pub.open-bio.org Sat Nov 8 20:05:03 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:14:06 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311090105.hA91533F021615@pub.open-bio.org> senger Sat Nov 8 20:05:02 EST 2003 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv21510/src/webapps Modified Files: web.xml.template Log Message: moby-live/Java/src/webapps web.xml.template,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/webapps/web.xml.template,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/webapps/web.xml.template 2003/11/08 00:36:18 1.1 +++ /home/repository/moby/moby-live/Java/src/webapps/web.xml.template 2003/11/09 01:05:02 1.2 @@ -43,6 +43,7 @@ both the appeareance and the contents of these graphs. org.biomoby.client.GraphsServlet + refresh_interval @REFRESH_INTERVAL@ @@ -51,6 +52,7 @@ from the BioMoby registry - in minutes. An integer. + cache_dir @CACHE_DIR@ @@ -62,6 +64,7 @@ 'cache_url' parameter. + cache_url @CACHE_URL@ @@ -71,6 +74,7 @@ where 'cache_dir' (yet another parameter) ends. + default_endpoint @DEFAULT_ENDPOINT@ @@ -80,6 +84,7 @@ default an official BioMoby site in Canada. + default_namespace @DEFAULT_NAMESPACE@ @@ -90,6 +95,42 @@ registry in Canada). + + + dot_path + @DOT_PATH@ + + A full path to the 'dot' program (excluding the 'dot' itself + and the ending slash). Use this only if the 'dot' program + is not on the PATH used by Tomcat. + + + + + proxySet + @PROXY_SET@ + + Set to 'true' if your Tomcat needs to find an HTTP proxy + server, and if it does not have it set in its own configuration. + + + + + http.proxyHost + @PROXY_HOST@ + + The HTTP proxy hostname. + + + + + http.proxyPort + @PROXY_PORT@ + + The HTTP proxy port number. + + + - - - - + + + + + + + + + + + + + + @@ -25,16 +36,19 @@ - - - - - + + + + + + + + @@ -63,6 +77,8 @@ + + @@ -96,6 +112,9 @@ + + + @@ -115,6 +134,7 @@ + @@ -134,15 +154,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + description="Compile all source code (default)."> Missing one or more third-party libraries. Try to run build.sh or build.bat to fetch them from the net. @@ -157,6 +218,11 @@ excludes="${project.excludes}"> + + + @@ -165,7 +231,7 @@ - + + @@ -210,10 +277,11 @@ + description="Create a jar file with jMoby classes."> + @@ -223,8 +291,8 @@ - + @@ -237,10 +305,10 @@ - + - + @@ -262,12 +330,86 @@ + - + - + + + + + + + + + + + + + + Tomcat Catalina not found. + Please set environment variable CATALINA_HOME to point to it, or + create a file 'build.properties' and put there the line: + catalina.home = <location of your CATALINA> + (do not include '<' and '>' there) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -278,3 +420,4 @@ + From senger at pub.open-bio.org Fri Nov 7 19:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:14:25 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROMX017243@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/dist In directory pub.open-bio.org:/tmp/cvs-serv17161/docs/dist Modified Files: .cvsignore.template Added Files: _README_ Log Message: added graphs for exploring biomoby registry moby-live/Java/docs/dist _README_,NONE,1.1 .cvsignore.template,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/dist/.cvsignore.template,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/dist/.cvsignore.template 2003/09/25 02:10:27 1.1 +++ /home/repository/moby/moby-live/Java/docs/dist/.cvsignore.template 2003/11/08 00:27:24 1.2 @@ -3,3 +3,4 @@ *.zip *.tar.gz *.tgz +*.war From senger at pub.open-bio.org Fri Nov 7 19:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:14:30 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROiI017258@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs In directory pub.open-bio.org:/tmp/cvs-serv17161/docs/graphs Added Files: index.html Log Message: added graphs for exploring biomoby registry moby-live/Java/docs/graphs index.html,NONE,1.1 From senger at pub.open-bio.org Fri Nov 7 19:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:14:34 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROXc017273@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs/images In directory pub.open-bio.org:/tmp/cvs-serv17161/docs/graphs/images Added Files: example-data-types-small.jpg example-data-types.png example-services-small.jpg example-services.png legend.dot legend.png logo.png Log Message: added graphs for exploring biomoby registry moby-live/Java/docs/graphs/images example-data-types-small.jpg,NONE,1.1 example-data-types.png,NONE,1.1 example-services-small.jpg,NONE,1.1 example-services.png,NONE,1.1 legend.dot,NONE,1.1 legend.png,NONE,1.1 logo.png,NONE,1.1 From senger at pub.open-bio.org Fri Nov 7 19:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:14:39 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROKN017311@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv17161/src/Clients Modified Files: MobyGraphs.java Added Files: EchoClient.java EchoClient2.java Log Message: added graphs for exploring biomoby registry moby-live/Java/src/Clients EchoClient.java,NONE,1.1 EchoClient2.java,NONE,1.1 MobyGraphs.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2003/10/17 13:13:34 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2003/11/08 00:27:24 1.2 @@ -50,7 +50,7 @@ BaseCmdLine cmd = new BaseCmdLine (args, true); if (cmd.hasParam ("-help") || cmd.hasParam ("-h")) { - System.out.print (MobyCmdLineClient.getUsage()); + System.out.print (MobyGraphs.getUsage()); System.exit (0); } @@ -127,10 +127,41 @@ services = new MobyService [v.size()]; v.copyInto (services); - // create a graph + // create a set of graph edges decorationLn ("Creating a graph of the services..."); ServicesEdge[] edges = ServiceConnections.build (dataTypes, services); - String graph = Graphviz.createServicesGraph (edges, props); + + // filter edges + String[] authorities = null; + String[] serviceNames = null; + int depth = 1; + if ((param = cmd.getParam ("-auth")) != null ) + authorities = StringUtils.split (param, ","); + if ((param = cmd.getParam ("-name")) != null ) + serviceNames = StringUtils.split (param, ","); + param = cmd.getParam ("-depth"); + if (param != null) { + try { + depth = Integer.valueOf (param).intValue(); + } catch (java.lang.NumberFormatException e) {} + } + edges = FilterServices.filter (edges, authorities, serviceNames, depth); + + String[] pathEnds = cmd.getParam ("-path", 2); + if (pathEnds.length == 2) + edges = FilterServices.pathes (edges, pathEnds[0], pathEnds[1]); + if (edges == null) { + System.err.println ("No connection found between '" + + pathEnds[0] + "' and '" + pathEnds[1] + "'"); + System.exit(1); + } + + // create a graph (in whatever format) + String graph; + if (cmd.hasOption ("-rdf")) + graph = RDF.createServicesGraph (edges, props); + else + graph = Graphviz.createServicesGraph (edges, props); // output the graph param = cmd.getParam ("-fs"); From senger at pub.open-bio.org Fri Nov 7 19:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:14:44 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROWx017292@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/lib In directory pub.open-bio.org:/tmp/cvs-serv17161/lib Modified Files: README Log Message: added graphs for exploring biomoby registry moby-live/Java/lib README,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/README,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/lib/README 2003/09/24 12:33:48 1.3 +++ /home/repository/moby/moby-live/Java/lib/README 2003/11/08 00:27:24 1.4 @@ -39,6 +39,11 @@ wsdl4j.jar, axis.jar, log4j-1.2.4.jar, saaj.jar. Libraries from the Apache Axis project (a toolkit for the SOAP protocol). -* servlet.jar, activation.jar. +* servlet.jar, activation.jar Libraries dealing with servlets. They come from Apache Tomcat project. +* jena.jar, adenine.jar + Libraries from 'haystack' (IBM) for producing RDF files. + They can be fetched from here: + http://www.ai.mit.edu/people/dquan/adenine.jar + http://www.ai.mit.edu/people/dquan/jena.jar From senger at pub.open-bio.org Fri Nov 7 19:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:14:49 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80RO72017353@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv17161/src/main/org/biomoby/client Modified Files: CentralImpl.java ServicesEdge.java Added Files: FileCache.java FilterServices.java GraphsServlet.java RDF.java ServletFileCache.java SimpleCache.java Log Message: added graphs for exploring biomoby registry moby-live/Java/src/main/org/biomoby/client FileCache.java,NONE,1.1 FilterServices.java,NONE,1.1 GraphsServlet.java,NONE,1.1 RDF.java,NONE,1.1 ServletFileCache.java,NONE,1.1 SimpleCache.java,NONE,1.1 CentralImpl.java,1.2,1.3 ServicesEdge.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/10/17 13:13:34 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/08 00:27:24 1.3 @@ -625,7 +625,7 @@ /************************************************************************** * The 'retrieveObjectDefinition' method returns something like this; * - * + * * urn:lsid:biomoby.org:objectclass:go_term * * http://www.illuminae.com @@ -637,7 +637,7 @@ * urn:lsid:biomoby.org:objectclass:string * urn:lsid:biomoby.org:objectclass:string * - * + * * *************************************************************************/ public MobyDataType getDataType (String dataTypeName) @@ -652,7 +652,7 @@ // parse returned XML Document document = parser.parse (new StringReader (result)); - NodeList list = document.getElementsByTagName ("registerObjectClass"); + NodeList list = document.getElementsByTagName ("retrieveObjectDefinition"); if (list == null || list.getLength() == 0) throw new NoSuccessException ("Data Type name was not founnd.", dataTypeName); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServicesEdge.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServicesEdge.java 2003/10/17 13:13:34 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServicesEdge.java 2003/11/08 00:27:24 1.2 @@ -89,6 +89,26 @@ } /************************************************************************* + * Retrieves the source service. + * + * @return the source service + * + *************************************************************************/ + public MobyService getSourceService() { + return sourceService; + } + + /************************************************************************* + * Retrieves the target service. + * + * @return the target service + * + *************************************************************************/ + public MobyService getTargetService() { + return targetService; + } + + /************************************************************************* * Sets connector. * * @param connector is a string representing namespace and data From senger at pub.open-bio.org Fri Nov 7 19:27:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:14:55 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80RPtR017372@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/src/support In directory pub.open-bio.org:/tmp/cvs-serv17161/src/support Modified Files: README Added Files: run-any-client run-any-client.bat run-graphs-client run-graphs-client.bat Log Message: added graphs for exploring biomoby registry moby-live/Java/src/support run-any-client,NONE,1.1 run-any-client.bat,NONE,1.1 run-graphs-client,NONE,1.1 run-graphs-client.bat,NONE,1.1 README,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/support/README,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/support/README 2003/09/25 10:49:09 1.2 +++ /home/repository/moby/moby-live/Java/src/support/README 2003/11/08 00:27:24 1.3 @@ -10,6 +10,7 @@ sh ./run-cmdline-client -help sh ./run-testing-central + sh ./run-graphs-client -help Or, on Unix platforms, use chmod to make the scripts above executable and call them without 'sh' (note that this small inconvenience is due From senger at pub.open-bio.org Fri Nov 7 19:28:44 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:14:58 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080028.hA80SiSl017413@pub.open-bio.org> senger Fri Nov 7 19:28:44 EST 2003 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv17395/webapps Log Message: Directory /home/repository/moby/moby-live/Java/src/webapps added to the repository moby-live/Java/src/webapps - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/webapps/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/webapps/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/webapps/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Nov 7 19:31:36 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:15:02 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080031.hA80Vavo017459@pub.open-bio.org> senger Fri Nov 7 19:31:36 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services In directory pub.open-bio.org:/tmp/cvs-serv17441/Services Log Message: Directory /home/repository/moby/moby-live/Java/src/Services added to the repository moby-live/Java/src/Services - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Nov 7 19:33:03 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:15:06 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080033.hA80X3g1017542@pub.open-bio.org> senger Fri Nov 7 19:33:02 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org/biomoby In directory pub.open-bio.org:/tmp/cvs-serv17524/Services/org/biomoby Log Message: Directory /home/repository/moby/moby-live/Java/src/Services/org/biomoby added to the repository moby-live/Java/src/Services/org/biomoby - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Nov 7 19:32:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:15:09 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080032.hA80WOe0017500@pub.open-bio.org> senger Fri Nov 7 19:32:24 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org In directory pub.open-bio.org:/tmp/cvs-serv17482/Services/org Log Message: Directory /home/repository/moby/moby-live/Java/src/Services/org added to the repository moby-live/Java/src/Services/org - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Nov 7 19:33:49 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:15:12 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080033.hA80XnZO017583@pub.open-bio.org> senger Fri Nov 7 19:33:48 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service In directory pub.open-bio.org:/tmp/cvs-serv17565/Services/org/biomoby/service Log Message: Directory /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service added to the repository moby-live/Java/src/Services/org/biomoby/service - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Nov 7 19:36:18 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:15:15 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080036.hA80aImp017646@pub.open-bio.org> senger Fri Nov 7 19:36:18 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service In directory pub.open-bio.org:/tmp/cvs-serv17631/src/Services/org/biomoby/service Added Files: Echo.java EchoImpl.java EchoImplFromStubs.java README Log Message: added graphs for exploring biomoby registry moby-live/Java/src/Services/org/biomoby/service Echo.java,NONE,1.1 EchoImpl.java,NONE,1.1 EchoImplFromStubs.java,NONE,1.1 README,NONE,1.1 From senger at pub.open-bio.org Fri Nov 7 19:36:18 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:15:19 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080036.hA80aIGL017661@pub.open-bio.org> senger Fri Nov 7 19:36:18 EST 2003 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv17631/src/webapps Added Files: web.xml.template Log Message: added graphs for exploring biomoby registry moby-live/Java/src/webapps web.xml.template,NONE,1.1 From senger at pub.open-bio.org Fri Nov 7 19:49:07 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:15:22 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080049.hA80n79q017906@pub.open-bio.org> senger Fri Nov 7 19:49:06 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated In directory pub.open-bio.org:/tmp/cvs-serv17891/src/Services/org/biomoby/service/generated Added Files: Echo.java EchoService.java EchoServiceLocator.java EchoStringSoapBindingImpl.java EchoStringSoapBindingStub.java deploy.wsdd undeploy.wsdd Log Message: starting to play with services moby-live/Java/src/Services/org/biomoby/service/generated Echo.java,NONE,1.1 EchoService.java,NONE,1.1 EchoServiceLocator.java,NONE,1.1 EchoStringSoapBindingImpl.java,NONE,1.1 EchoStringSoapBindingStub.java,NONE,1.1 deploy.wsdd,NONE,1.1 undeploy.wsdd,NONE,1.1 From senger at pub.open-bio.org Fri Nov 7 18:14:34 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:15:26 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311072314.hA7NEYck016951@pub.open-bio.org> senger Fri Nov 7 18:14:34 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs In directory pub.open-bio.org:/tmp/cvs-serv16933/graphs Log Message: Directory /home/repository/moby/moby-live/Java/docs/graphs added to the repository moby-live/Java/docs/graphs - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Nov 7 18:15:22 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:15:30 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311072315.hA7NFMdE016995@pub.open-bio.org> senger Fri Nov 7 18:15:22 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs/images In directory pub.open-bio.org:/tmp/cvs-serv16977/graphs/images Log Message: Directory /home/repository/moby/moby-live/Java/docs/graphs/images added to the repository moby-live/Java/docs/graphs/images - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/images/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/images/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/images/RCS/directory,v: No such file or directory From mwilkinson at pub.open-bio.org Wed Nov 12 12:31:43 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed Nov 12 16:15:35 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121731.hACHVhWO012380@pub.open-bio.org> mwilkinson Wed Nov 12 12:31:43 EST 2003 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv12338/t Modified Files: Client-Central.t Log Message: Yay! We have a Makefile and test suite again! This is more simple than the one that Richard was working on at the Singapore hackathon (his was able to actually install and test local services), but this will at least install the modules and test the basic functionality of MOBY::Client::Central moby-live/Perl/t Client-Central.t,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Central.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/t/Client-Central.t 2003/02/19 21:23:16 1.1 +++ /home/repository/moby/moby-live/Perl/t/Client-Central.t 2003/11/12 17:31:42 1.2 @@ -5,187 +5,249 @@ # change 'tests => 1' to 'tests => last_test_to_print'; -use Test::More tests => 20; # perldoc Test::More for details +use Test::More tests => 12; # perldoc Test::More for details # Test 1 BEGIN { use_ok('MOBY::Client::Central') }; # Test 2 my $C = MOBY::Client::Central->new( - MOBY_server => "http://localhost/cgi-bin/MOBY-Central.pl", - MOBY_uri => "http://localhost/MOBY/Central" + #MOBY_server => "http://localhost/cgi-bin/MOBY-Central.pl", + #MOBY_uri => "http://localhost/MOBY/Central" ); isa_ok( $C,'MOBY::Client::Central',"Connected to test MOBY Central") or - die("Cannot Connect to test MOBY Central... cannot continue?"); + die("Cannot Connect to MOBY Central... cannot continue?"); my %TestRegistry ; # to keep track of registry id's for the various tests ################## MOBY Registration Tests ################# # Test 3 -$r = $C->registerObject( - objectType => "testObject", - description => "this is a test", - xsd => "", - ISA => ["Object"], - authURI => "http://www.illuminae.com", - clobber => 0, +$r = $C->registerObjectClass(objectType => "TotalCrap", + description => "a human-readable description of the object", + contactEmail => 'your@email.address', + authURI => "URI of the registrar of this object", + Relationships => { + ISA => [ + ['Object', 'article1'], + ['Object', 'articleName2']], + HASA => [ + ['Object', 'articleName3']]} ); -( ok(!$r->success,"Object registration successful") and - ($TestRegistry{'Object'} = $r->registration_id) -) or diag("Object registration failure: ".$r->error_message) ; +( ok($r->success,"Object registration successful") + or diag("Object registration failure: ".$r->message)); + # Test 4 -$r = $C->registerServiceType( - serviceType => "testService", - description => "this is a test", - ISA => ["Retrieve"], +$r = $C->deregisterObjectClass(objectType => "TotalCrap"); +( ok($r->success,"Object deregistration successful")) +or diag("Object deregistration failure: ".$r->message) ; + +# Test 5 (identical to #3 +$r = $C->registerObjectClass(objectType => "TotalCrap", + description => "a human-readable description of the object", + contactEmail => 'your@email.address', + authURI => "URI of the registrar of this object", + Relationships => { + ISA => [ + ['Object', 'article1'], + ['Object', 'articleName2']], + HASA => [ + ['Object', 'articleName3']]} ); -( ok(!$r->success,"Service type registration successful") and - ($TestRegistry{'ServiceType'} = $r->registration_id) -) or diag("Service type registration failure: ".$r->error_message) ; +( ok($r->success,"Object registration successful") + or diag("Object registration failure: ".$r->message)); + -# Test 5 +# Test 6 $r = $C->registerNamespace( - namespaceType => "testNamespace", - description => "this is a test", - authURI => "http://illuminae.com", - clobber => 0 + namespaceType =>'UglyNamespace', + authURI => 'your.authority.URI', + description => "human readable description of namespace", + contactEmail => 'your@address.here'); +( ok($r->success,"Name space registration successful") +) or diag("Name space registration failure: ".$r->message) ; + + +# Test 7 +$r = $C->registerServiceType(serviceType => "CrappyService", + description => "a human-readable description of the service", + contactEmail => 'your@email.address', + authURI => "URI of the registrar of this object", + Relationships => { + ISA => ['Retrieval']} ); -( ok(!$r->success,"Name space registration successful") and - ($TestRegistry{'NameSpace'} = $r->registration_id) -) or diag("Name space registration failure: ".$r->error_message) ; +( ok($r->success,"Service Type registration successful") +) or diag("Service Type registration failure: ".$r->message) ; -# Test 6 +# Test 8 $r = $C->registerService( - serviceName => "Servicetest2", - serviceType => "Retrieve", - authURI => "illuminae.com", - input => {"Object" => ["Genbank/GI"]}, - output => ["Object"], - URL => "http://www.illuminae.com/cgi-bin/services.cgi", - description => "this is a test", - ); -( ok(!$r->success,"Service registration successful") and - ($TestRegistry{'Service'} = $r->registration_id) -) or diag("Name space registration failure: ".$r->error_message) ; - -################## MOBY Central Search Tests ################# - -my @service ; - -# Tests 7,8: locateServiceByOutput with output 'Object' and full_objects + full_services -@service = $C->locateServiceByOutput( - objectType => "Object", - fullObjects => 1, - fullServices => 1, -) ; - -SKIP: { - skip "locateServiceByOutput w/full object & services". - "did not return any services?", 2 unless scalar(@service) ; - is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; - is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; -} ; - -# Tests 9,10: Testing locateServiceByOutput with output "Object" and full_services only -@service = $C->locateServiceByOutput( - objectType => "Object", - fullObjects => 0, - fullServices => 1, - ); -SKIP: { - skip "locateServiceByOutput w/ output 'Object' and full services only ". - "did not return any services?", 2 unless scalar(@service) ; - is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; - is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; -} ; - -# Tests 11,12: Testing locateServiceByInput with input -# 'Object' => Genbank/GI and full_objects + full_services -@service = $C->locateServiceByInput( - input => {"Sequence" => ["Genbank/GI"]}, - fullObjects => 1, - fullServices => 1, - ); -SKIP: { - skip "locateServiceByInput w/input 'Object' => Genbank/GI ". - "and full_objects + full_services ". - "did not return any services?", 2 unless scalar(@service) ; - is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; - is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; -} ; - -# Tests 13,14: Testing locateServiceByInput with input -# 'Object' => Genbank/GI and full_services only -@service = $C->locateServiceByInput( - input => {"Object" => ["Genbank/GI"]}, - fullObjects => 0, - fullServices => 1, - ); -SKIP: { - skip "locateServiceByInput w/input 'Object' => Genbank/GI ". - "and full_services ". - "did not return any services?", 2 unless scalar(@service) ; - is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; - is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; -} ; - -# Tests 15,16: Testing locateServiceByType with type 'Retrieve' + full_services -@service = $C->locateServiceByType( - serviceType => "Retrieve", - fullServices => 1, - ); -SKIP: { - skip "locateServiceByType w/type 'Retrieve' and full_services ". - "did not return any services?", 2 unless scalar(@service) ; - is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; - is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; -} ; - -################## MOBY Deregistration Tests ################# - -# Test 17 -SKIP: { - skip "Skipping test DeregisterService since service registration failed", - 1 unless(exists($TestRegistry{'Service'})) ; - - $r = $C->deregisterService( serviceID => $TestRegistry{'Service'} ); - ok(!$r->success,"Service ID#".$r->registration_id." deregistration successful") - or diag("Service ID#",$TestRegistry{'Service'}, - "deregistration failure: ".$r->error_message) ; -} - -# Test 18 -SKIP: { - skip "Skipping test DeregisterNamespace since name space registration failed", - 1 unless(exists($TestRegistry{'NameSpace'})) ; - - $r = $C->deregisterNamespace( namespaceAcc => $TestRegistry{'NameSpace'} ); - ok(!$r->success,"Name space ID#".$r->registration_id." deregistration successful") - or diag("Name space ID#",$TestRegistry{'NameSpace'}, - "deregistration failure: ".$r->error_message) ; -} - -# Test 19 -SKIP: { - skip "Skipping test DeregisterServiceType since service registration failed", - 1 unless(exists($TestRegistry{'ServiceType'})) ; - - $r = $C->deregisterServiceType( serviceID => $TestRegistry{'ServiceType'} ); - ok(!$r->success,"Service type ID#".$r->registration_id." deregistration successful") - or diag("Service type ID#",$TestRegistry{'ServiceType'}, - "deregistration failure: ".$r->error_message) ; -} - -# Test 20 -SKIP: { - skip "Skipping test DeregisterObject since initial object registration failed", - 1 unless(exists($TestRegistry{'Object'})) ; - - $r = $C->deregisterObject( serviceID => $TestRegistry{'Object'} ); - ok(!$r->success,"Object ID#".$r->registration_id." deregistration successful") - or diag("Object ID#",$TestRegistry{'Object'}, - "deregistration failure: ".$r->error_message) ; -} + serviceName => "myfirstservice", + serviceType => "Retrieval", + authURI => "www.illuminae.com", + contactEmail => 'your@mail.address', + description => "this is my first service", + category => "moby", + URL => "http://illuminae/cgi-bin/service.pl", + input =>[ + ['articleName1', [Object => ['UglyNamespace']]], # Simple + ], + output =>[ + ['articleName2', [String => ['UglyNamespace']]], # Simple + ], + secondary => { + parametername1 => { + datatype => 'Int', + default => 0, + max => 10, + min => -10, + enum => [-10, 10, 0]}}); + +( ok($r->success,"Service registration successful") +) or diag("Service registration failure: ".$r->message) ; + + +# Test 9 + +$r = $C->deregisterService( + serviceName => "myfirstservice", + authURI => "www.illuminae.com", + ); +( ok($r->success,"Service deregistration successful") +) or diag("Service deregistration failure: ".$r->message) ; + + +# Test 10 +$r = $C->deregisterObjectClass(objectType => "TotalCrap"); +( ok($r->success,"Object deregistration successful") +) or diag("Object deregistration failure: ".$r->message) ; + +# Test 11 +$r = $C->deregisterServiceType(serviceType => "CrappyService"); +( ok($r->success,"Service Type deregistration successful") +) or diag("Service Type deregistration failure: ".$r->message) ; + +# Test 12 +$r = $C->deregisterNamespace(namespaceType =>'UglyNamespace'); +( ok($r->success,"namespace deregistration successful") +) or diag("namespace deregistration failure: ".$r->message) ; + +################### MOBY Central Search Tests ################# +# +#my @service ; +# +## Tests 7,8: locateServiceByOutput with output 'Object' and full_objects + full_services +#@service = $C->locateServiceByOutput( +# objectType => "Object", +# fullObjects => 1, +# fullServices => 1, +#) ; +# +#SKIP: { +# skip "locateServiceByOutput w/full object & services". +# "did not return any services?", 2 unless scalar(@service) ; +# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; +# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; +#} ; +# +## Tests 9,10: Testing locateServiceByOutput with output "Object" and full_services only +#@service = $C->locateServiceByOutput( +# objectType => "Object", +# fullObjects => 0, +# fullServices => 1, +# ); +#SKIP: { +# skip "locateServiceByOutput w/ output 'Object' and full services only ". +# "did not return any services?", 2 unless scalar(@service) ; +# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; +# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; +#} ; +# +## Tests 11,12: Testing locateServiceByInput with input +## 'Object' => Genbank/GI and full_objects + full_services +#@service = $C->locateServiceByInput( +# input => {"Sequence" => ["Genbank/GI"]}, +# fullObjects => 1, +# fullServices => 1, +# ); +#SKIP: { +# skip "locateServiceByInput w/input 'Object' => Genbank/GI ". +# "and full_objects + full_services ". +# "did not return any services?", 2 unless scalar(@service) ; +# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; +# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; +#} ; +# +## Tests 13,14: Testing locateServiceByInput with input +## 'Object' => Genbank/GI and full_services only +#@service = $C->locateServiceByInput( +# input => {"Object" => ["Genbank/GI"]}, +# fullObjects => 0, +# fullServices => 1, +# ); +#SKIP: { +# skip "locateServiceByInput w/input 'Object' => Genbank/GI ". +# "and full_services ". +# "did not return any services?", 2 unless scalar(@service) ; +# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; +# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; +#} ; +# +## Tests 15,16: Testing locateServiceByType with type 'Retrieve' + full_services +#@service = $C->locateServiceByType( +# serviceType => "Retrieve", +# fullServices => 1, +# ); +#SKIP: { +# skip "locateServiceByType w/type 'Retrieve' and full_services ". +# "did not return any services?", 2 unless scalar(@service) ; +# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; +# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; +#} ; +# +################### MOBY Deregistration Tests ################# +# +## Test 17 +#SKIP: { +# skip "Skipping test DeregisterService since service registration failed", +# 1 unless(exists($TestRegistry{'Service'})) ; +# +# $r = $C->deregisterService( serviceID => $TestRegistry{'Service'} ); +# ok(!$r->success,"Service ID#".$r->registration_id." deregistration successful") +# or diag("Service ID#",$TestRegistry{'Service'}, +# "deregistration failure: ".$r->message) ; +#} +# +## Test 18 +#SKIP: { +# skip "Skipping test DeregisterNamespace since name space registration failed", +# 1 unless(exists($TestRegistry{'NameSpace'})) ; +# +# $r = $C->deregisterNamespace( namespaceAcc => $TestRegistry{'NameSpace'} ); +# ok(!$r->success,"Name space ID#".$r->registration_id." deregistration successful") +# or diag("Name space ID#",$TestRegistry{'NameSpace'}, +# "deregistration failure: ".$r->message) ; +#} +# +## Test 19 +#SKIP: { +# skip "Skipping test DeregisterServiceType since service registration failed", +# 1 unless(exists($TestRegistry{'ServiceType'})) ; +# +# $r = $C->deregisterServiceType( serviceID => $TestRegistry{'ServiceType'} ); +# ok(!$r->success,"Service type ID#".$r->registration_id." deregistration successful") +# or diag("Service type ID#",$TestRegistry{'ServiceType'}, +# "deregistration failure: ".$r->message) ; +#} +# +## Test 20 +#SKIP: { +# skip "Skipping test DeregisterObject since initial object registration failed", +# 1 unless(exists($TestRegistry{'Object'})) ; +# +# $r = $C->deregisterObject( serviceID => $TestRegistry{'Object'} ); +# ok(!$r->success,"Object ID#".$r->registration_id." deregistration successful") +# or diag("Object ID#",$TestRegistry{'Object'}, +# "deregistration failure: ".$r->message) ; +#} From senger at pub.open-bio.org Fri Nov 7 19:47:33 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Wed Nov 12 16:15:45 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080047.hA80lXjn017845@pub.open-bio.org> senger Fri Nov 7 19:47:32 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated In directory pub.open-bio.org:/tmp/cvs-serv17827/generated Log Message: Directory /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated added to the repository moby-live/Java/src/Services/org/biomoby/service/generated - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated/RCS/directory,v: No such file or directory From mwilkinson at pub.open-bio.org Sat Nov 8 12:21:32 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed Nov 12 16:15:49 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311081721.hA8HLWGp020549@pub.open-bio.org> mwilkinson Sat Nov 8 12:21:31 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv20526/Perl/MOBY Modified Files: CommonSubs.pm CommonSubs.html Log Message: updated CommonSubs to handle new message format; also included a paradigmatic example of a service moby-live/Perl/MOBY CommonSubs.pm,1.26,1.27 CommonSubs.html,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/06 16:23:14 1.26 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/08 17:21:31 1.27 @@ -8,46 +8,125 @@ =cut +=head1 Client Side Paradigm -=head1 SYNOPSIS +=cut - use MOBY::CommonSubs qw(:all); - my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles); - my $ns = getSimpleArticleNamespaceURI($SimpleArticle); +=head2 Service-Side Paradigm -A COMPLETE EXAMPLE OF A SIMPLE MOBY SERVICE +The following is a generalized architecture for *all* +BioMOBY services showing how to parse incoming messages... sub myServiceName { - my ($caller, $query) = @_; # get the incoming MOBY query XML - my @queries = getInputArticles($query); # returns DOM nodes - my $MOBY_RESPONSE = ""; # set empty response + my ($caller, $message) = @_; # get the incoming MOBY query XML + + my @queries = getInputs($message); # returns XML::DOM nodes + my $MOBY_RESPONSE = ""; # set empty response - foreach (@queries){ - my @inputs = @{$_}; #(may be more than one Simple/Collection input per query) - foreach my $input(@inputs){ - @sequence = getNodeContentWithArticle($_, "String", "SequenceString"); - my $sequence = join "", @sequence; # join all lines of string - # print STDERR "Analyzing $sequence\n"; - my $result = &_AnalyzeString($sequence); # do your analysis - $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename"); + foreach my $query(@queries){ + + my $queryID = getInputID($query); # get the queryID attribute of the queryInput + + my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query + foreach my $input(@input_articles){ # input is a listref + + my ($articleName, $article) = @{$input}; # get the named article + + my $simple = isSimpleArticle($article); # articles may be simple or collection + my $collection = isCollectionArticle($article); + + if ($collection){ + + # do something wtih the collection... + # for example... + my @simples = getCollectedSimples($article); + # blah blah blah... + + } elsif ($simple){ + # maybe you just need the ID of the incoming query: + my ($id) = getSimpleArticleIDs('NCBI_gi', $article); # if you need the ID + + # or maybe you are going to do something with the content? + # for example, this will get the array of text lines + # for the moby:String object with the articleName 'SequenceString' + # that is in this $article + my @sequence = getNodeContentWithArticle($article, "String", "SequenceString"); + + # DO YOUR ANALYSIS HERE + my $result = ""; #whatever you analysis says + + $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename", $queryID); + } } } - return responseHeader . $MOBY_RESPONSE . responseFooter; + return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter; + } + +=cut + +=head1 EXAMPLE + + +A COMPLETE EXAMPLE OF AN EASY MOBY SERVICE + +This is a service that: + +CONSUMES: Object in the NCBI_Acc namespace +EXECUTES: Retrieval +PRODUCES: GenericSequence (in the NCBI_Acc namespace) + + + use Bio::Perl; + + # this subroutine is called from your dispatch_with line + # in your SOAP daemon + + sub myServiceName { + my ($caller, $message) = @_; # get the incoming MOBY query XML + + my @queries = getInputs($message); # returns XML::DOM nodes + my $MOBY_RESPONSE = ""; # set empty response + + foreach my $query(@queries){ + + my $queryID = getInputID($query); # get the queryID attribute of the queryInput + + my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query + foreach my $input(@input_articles){ # input is a listref + my ($articleName, $article) = @{$input}; # get the named article + next unless isSimpleArticle($article); # I only allow simple inputs in my service signature + my ($id) = getSimpleArticleIDs('NCBI_Acc', $article); # if you need the ID + my $seq; + eval {$seq = get_sequence('genbank',$id);} # suppress bioperl error messages + my $response = ""; + if ($seq){ + $length = length($seq); + $response = " + $length + $seq + "; + } + $MOBY_RESPONSE .= simpleResponse($response, '', $queryID); + } + } + } + return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter; } =head1 DESCRIPTION -Used to do various transactions with MOBY-Central registry, including registering -new Object and Service types, querying for these types, registering new -Servers/Services, or queryiong for available services given certain input/output -or service type constraints. +CommonSubs are used to do various manipulations of MOBY Messages. It is useful +both Client and Service side to construct and parse MOBY Messages, and ensure +that the message structure is valid as per the API. + +It DOES NOT connect to MOBY Central for any of its functions. =head1 AUTHORS -Mark Wilkinson (markw@illuminae.com) +Mark Wilkinson (markw at illuminae dot com) BioMOBY Project: http://www.biomoby.org @@ -63,6 +142,7 @@ require Exporter; use XML::DOM; use MOBY::CrossReference; +use MOBY::Client::OntologyServer; @ISA = qw(Exporter); @EXPORT_OK = qw( @@ -72,6 +152,10 @@ responseHeader responseFooter getInputArticles + getInputs + getInputID + getArticles + getCollectedSimples getNodeContentWithArticle collectionResponse validateNamespaces @@ -88,6 +172,10 @@ responseHeader responseFooter getInputArticles + getInputs + getInputID + getArticles + getCollectedSimples getNodeContentWithArticle collectionResponse validateNamespaces @@ -130,7 +218,9 @@ sub getSimpleArticleIDs { my ($desired_namespace, $input_nodes) = @_; return undef unless $input_nodes; + $input_nodes = [$input_nodes] unless ref($input_nodes) =~ /ARRAY/; # be flexible! return undef unless scalar @{$input_nodes}; + my @input_nodes = @{$input_nodes}; my $OS = MOBY::Client::OntologyServer->new; my ($s, $m); @@ -218,40 +308,38 @@ name : simpleResponse function : wraps a simple article in the appropriate queryResponse structure - usage : $resp .= &simpleResponse($object, 'MyArticleName', $queryInput); + usage : $resp .= &simpleResponse($object, 'MyArticleName', $queryID); args : (in order) $object - (optional) a MOBY Object as raw XML $article - (optional) an articeName for this article - $query - (optional, but strongly recommended) the queryInput block - to which you are responding, either as raw XML, - or an XML::DOM object + $query - (optional, but strongly recommended) the queryID value for the + queryInput block to which you are responding notes : as required by the API you must return a response for every input. If one of the inputs was invalid, you return a valid (empty) MOBY - response by calling &simpleResponse() with no arguments. + response by calling &simpleResponse(undef, undef, $queryID) with no arguments. =cut sub simpleResponse { - my ($data, $articleName, $query) = @_; # articleName optional - my $qID = ''; + my ($data, $articleName, $qID) = @_; # articleName optional $data ||=''; - $qID = &_getQueryID($query) if $query; + $qID = &_getQueryID($qID) if ref($qID) =~ /XML::DOM/; # in case they send the DOM instead of the ID if ($articleName) { return " - + $data "; } elsif($data) { return " - - $data + + $data "; } else { return " - + "; } } @@ -263,8 +351,9 @@ my $doc = $parser->parse($query); $query = $doc->getDocumentElement(); } - return '' unless $query->getTagName eq "queryInput"; + return '' unless $query->getTagName =~/queryInput/; my $id = $query->getAttribute('queryID'); + $id ||= $query->getAttribute('moby:queryID'); return $id; } @@ -273,26 +362,24 @@ name : collectionResponse function : wraps a set of articles in the appropriate queryResponse structure - usage : return responseHeader . &collectionResponse(\@objects, 'MyArticleName') . responseFooter; + usage : return responseHeader . &collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter; args : (in order) \@objects - (optional) a listref of MOBY Objects as raw XML $article - (optional) an articeName for this article - $query - (optional, but strongly recommended) the queryInput block - to which you are responding, either as raw XML, - or an XML::DOM object + $queryID - (optional, but strongly recommended) the queryInput ID + to which you are responding notes : as required by the API you must return a response for every input. If one of the inputs was invalid, you return a valid (empty) MOBY - response by calling &collectionResponse() with no arguments. + response by calling &collectionResponse(undef, undef, $queryID). =cut sub collectionResponse { - my ($data, $articleName, $query) = @_; # articleName optional + my ($data, $articleName, $qID) = @_; # articleName optional my $content = ""; - my $qID = ''; - $data ||=''; - $qID = &_getQueryID($query) if $query; + $data ||=[]; + $qID ||= ''; unless ((ref($data) =~ /array/i) && $data->[0]){ # we're expecting an arrayref as input data,and it must not be empty return ""; } @@ -319,7 +406,7 @@ } else { return " - $content + $content "; } @@ -394,9 +481,11 @@ my ($XML) = @_; - my $parser = new XML::DOM::Parser; - my $doc = $parser->parse($XML); - my $moby = $doc->getDocumentElement(); + unless (ref($XML) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($XML); + $moby = $doc->getDocumentElement(); + } my $x = $moby->getElementsByTagName('queryInput'); # get the queryInput block unless ($x->item(0)){ @@ -411,62 +500,118 @@ } +=head2 getInputID -=head2 get_queryInput_Articles + name : getInputID + function : get the value of the queryID element + usage : @queryInputs = getInputID($XML) + args : the raw XML or XML::DOM of a block + returns : integer, or '' + Note : queryInputs and queryResponses are coordinately enumerated! + The integer you get here is what you + pass as the third argument to the simpleResponse or collectionResponse + subroutine to associate the numbered input to the numbered response - name : get_queryInput_Articles - function : get the Simple/Collection articles for each queryInput, in order - usage : @queries = get_queryInput_Articles($XML) - args : XML of a or an XML::DOM::Node of the element - returns : a list of listrefs, each listref is the input to a single query. - Remember that the input to a single query may be one or more Simple - and/or Collection articles. These are provided as XML::DOM nodes. - - i.e.: @queries = ([$SIMPLE_DOM_NODE], [$SIMPLE_DOM_NODE2]) - or : @queries = ([$COLLECTION_DOM_NODE], [$COLLECTION_DOM_NODE2]) - - the former is generated from the following XML: +=cut + + +sub getInputID { + my ($XML) = @_; + unless (ref($XML) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($XML); + $XML = $doc->getDocumentElement(); + } + return '' unless $XML->getTagName =~ /queryInput/; + my $qid = $XML->getAttribute('queryID'); + return defined($qid)?$qid:''; +} + + + +=head2 getArticles + + name : getArticles + function : get the Simple/Collection articles for a single queryInput + or queryResponse node + usage : @articles = getArticles($XML) + args : raw XML or XML::DOM of a moby:queryInput or a moby:queryResponse block + returns : a list of listrefs; each listref is one component of the queryInput. + a single queryInput/Responsemay consist of one or more named or unnamed + simple or collection articles. The listref structure is thus [name, $ARTICLE]: - ... - + e.g.: @articles = ['name1', $SIMPLE_DOM] + or : @articles = ['name1', $COLLECTION_DOM], ['name2', $SIMPLE_DOM]... + + the former is generated from the following sample XML: + - + - + - - ... =cut -sub get_queryInput_Articles { +sub getArticles { - my ($XML) = @_; - my $parser = new XML::DOM::Parser; - my $doc = $parser->parse($XML); - my $moby = $doc->getDocumentElement(); + my ($moby) = @_; + unless (ref($moby) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($moby); + $moby = $doc->getDocumentElement(); + } - my $x = $moby->getElementsByTagName('queryInput'); # get the queryInput block - unless ($x->item(0)){ - $x = $moby->getElementsByTagName('moby:queryInput'); + return undef unless $moby->getNodeType == ELEMENT_NODE; + return undef unless ($moby->getTagName =~ /queryInput/ || $moby->getTagName =~ /queryResponse/); + my @articles; + foreach $child($moby->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them + next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace + next unless ($child->getTagName =~ /Simple/ || $child->getTagName =~ /Collection/); + my $articleName = $child->getAttribute('articleName'); + $articleName ||= $child->getAttribute('moby:articleName'); + push @articles, [$articleName, $child]; # take the child elements, which are or } + return @articles; # return them. +} - my @queries; - for (0..$x->getLength-1){ # there may be more than one queryInput per message - my @this_query; - foreach $child($x->item($_)->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them - next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace - push @this_query, $child; # take the child elements, which are or - } - push @queries, \@this_query; - } - return @queries; # return them in the order that they were discovered. + +=head2 getCollectedSimples + + name : getCollectedSimples + function : get the Simple articles collected in a moby:Collection block + usage : @Simples = getCollectedSimples($XML) + args : raw XML or XML::DOM of a moby:Collection block + returns : a list of XML::DOM nodes, each of which is a moby:Simple block + +=cut + + +sub getCollectedSimples { + + my ($moby) = @_; + unless (ref($moby) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($moby); + $moby = $doc->getDocumentElement(); + } + + return undef unless $moby->getNodeType == ELEMENT_NODE; + return undef unless ($moby->getTagName =~ /Collection/); + + my @articles; + foreach $child($moby->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them + next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace + next unless ($child->getTagName =~ /Simple/); + push @articles, $child; # take the child elements, which are or + } + return (@articles); # return them. } @@ -475,7 +620,7 @@ name : getInputArticles function : get the Simple/Collection articles for each input query, in order usage : @queries = getInputArticles($XML) - args : the raw XML of a query + args : the raw XML of a moby:MOBY query returns : a list of listrefs, each listref is the input to a single query. Remember that the input to a single query may be one or more Simple and/or Collection articles. These are provided as XML::DOM nodes. @@ -505,10 +650,12 @@ sub getInputArticles { - my ($XML) = @_; - my $parser = new XML::DOM::Parser; - my $doc = $parser->parse($XML); - my $moby = $doc->getDocumentElement(); + my ($moby) = @_; + unless (ref($moby) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($moby); + $moby = $doc->getDocumentElement(); + } my $x = $moby->getElementsByTagName('queryInput'); # get the queryInput block unless ($x->item(0)){ @@ -520,14 +667,7 @@ my @this_query; foreach $child($x->item($_)->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace -# if ($asObject){ -# my $obj; -# $obj = MOBY::Client::SimpleArticle->new(XML_DOM => $child) if (isSimpleArticle($child)); -# $obj = MOBY::Client::CollectionArticle->new(XML_DOM => $child) if (isCollectionArticle($child)); -# push @this_query, $child; -# } else { push @this_query, $child; # take the child elements, which are or -# } } push @queries, \@this_query; } @@ -554,7 +694,7 @@ $DOM = $doc->getDocumentElement(); } $DOM = $DOM->getDocumentElement if ($DOM->isa("XML::DOM::Document")); - return 1 if ($DOM->getTagName eq "Simple"); + return 1 if ($DOM->getTagName =~ /Simple/); return 0; } @@ -822,13 +962,13 @@ $ns = $xref->getAttributeNode('moby:namespace') unless $ns; return undef unless $ns; my $id = $xref->getAttributeNode('id'); - $id = $xref->getAttributeNode('moby:id') unless $ns; + $id = $xref->getAttributeNode('moby:id') unless $id; return undef unless $id; my $xr = $xref->getAttributeNode('xref_type'); - $xr = $xref->getAttributeNode('moby:namespace') unless $ns; + $xr = $xref->getAttributeNode('moby:xref_type') unless $xr; return undef unless $xr; my $ec = $xref->getAttributeNode('evidence_code'); - $ec = $xref->getAttributeNode('moby:namespace') unless $ns; + $ec = $xref->getAttributeNode('moby:evidence_code') unless $ec; return undef unless $ec; my $au = $xref->getAttributeNode('authURI'); $au = $xref->getAttributeNode('moby:authURI') unless $au; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html 2003/10/25 22:20:47 1.5 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html 2003/11/08 17:21:31 1.6 @@ -15,7 +15,13 @@
      • NAME
      • -
      • SYNOPSIS
      • +
      • Client Side Paradigm
      • + + +
      • EXAMPLE
      • DESCRIPTION
      • AUTHORS
      • METHODS
      • @@ -27,6 +33,10 @@
      • collectionResponse
      • responseHeader
      • responseFooter
      • +
      • getInputs
      • +
      • getInputID
      • +
      • getArticles
      • +
      • getCollectedSimples
      • getInputArticles
      • isSimpleArticle
      • isCollectionArticle
      • @@ -49,43 +59,116 @@


        -

        SYNOPSIS

        +

        Client Side Paradigm

        +

        +

        +

        Service-Side Paradigm

        +

        The following is a generalized architecture for *all* +BioMOBY services showing how to parse incoming messages...

        +
        + sub myServiceName {
        +   my ($caller, $message) = @_;  # get the incoming MOBY query XML
        +
        +   my @queries = getInputs($message);  # returns XML::DOM nodes
        +   my $MOBY_RESPONSE = "";           # set empty response
        + 
        +   foreach my $query(@queries){
        - use MOBY::CommonSubs qw(:all);
        - my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles);
        - my $ns = getSimpleArticleNamespaceURI($SimpleArticle);
        -

        A COMPLETE EXAMPLE OF A SIMPLE MOBY SERVICE

        + my $queryID = getInputID($query); # get the queryID attribute of the queryInput + + my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query + foreach my $input(@input_articles){ # input is a listref +
        +        my ($articleName, $article) = @{$input}; # get the named article
        +        
        +        my $simple = isSimpleArticle($article);  # articles may be simple or collection
        +        my $collection = isCollectionArticle($article);
        +
        +        if ($collection){
        +
        +            # do something wtih the collection...
        +            # for example...
        +            my @simples = getCollectedSimples($article);
        +            # blah blah blah...
        +            
        +        } elsif ($simple){
        +            # maybe you just need the ID of the incoming query:
        +            my ($id) = getSimpleArticleIDs('NCBI_gi', $article); # if you need the ID
        +
        +            # or maybe you are going to do something with the content?
        +            # for example, this will get the array of text lines
        +            # for the moby:String object with the articleName 'SequenceString'
        +            # that is in this $article
        +            my @sequence = getNodeContentWithArticle($article, "String", "SequenceString");
        +
        +            #  DO YOUR ANALYSIS HERE
        +            my $result = ""; #whatever you analysis says
        +            
        +            $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename", $queryID);
        +        }
        +     }
        +   }
        +   return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter;
        + }
        +

        +

        +
        +

        EXAMPLE

        +

        A COMPLETE EXAMPLE OF AN EASY MOBY SERVICE

        +

        This is a service that:

        +

        CONSUMES: Object in the NCBI_Acc namespace +EXECUTES: Retrieval +PRODUCES: GenericSequence (in the NCBI_Acc namespace)

        + use Bio::Perl;
        + 
        + # this subroutine is called from your dispatch_with line
        + # in your SOAP daemon
        + 
          sub myServiceName {
        -   my ($caller, $query) = @_;  # get the incoming MOBY query XML
        -   my @queries = getInputArticles($query);  # returns DOM nodes
        -   my $MOBY_RESPONSE = "";  # set empty response
        +   my ($caller, $message) = @_;  # get the incoming MOBY query XML
        +
        +   my @queries = getInputs($message);  # returns XML::DOM nodes
        +   my $MOBY_RESPONSE = "";           # set empty response
          
        -   foreach (@queries){
        -     my @inputs = @{$_}; #(may be more than one Simple/Collection input per query)
        -     foreach my $input(@inputs){
        -        @sequence = getNodeContentWithArticle($_, "String", "SequenceString");
        -        my $sequence = join "", @sequence; # join all lines of string
        -        # print STDERR "Analyzing $sequence\n"; 
        -        my $result = &_AnalyzeString($sequence);  # do your analysis
        -        $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename");
        +   foreach my $query(@queries){
        +
        +     my $queryID = getInputID($query);  # get the queryID attribute of the queryInput
        +     
        +     my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query
        +     foreach my $input(@input_articles){       # input is a listref
        +        my ($articleName, $article) = @{$input}; # get the named article
        +        next unless isSimpleArticle($article);   # I only allow simple inputs in my service signature
        +        my ($id) = getSimpleArticleIDs('NCBI_Acc', $article); # if you need the ID
        +        my $seq;
        +        eval {$seq = get_sequence('genbank',$id);} # suppress bioperl error messages
        +        my $response = "";
        +        if ($seq){
        +            $length = length($seq);
        +            $response = "<GenericSequence namespace='NCBI_Acc' id='$id'>
        +                           <Integer namespace='' id='' articleName='Length'>$length</Integer>
        +                           <String namespace='' id='' articleName='SequenceString'>$seq</String>
        +                         </GenericSequence>";
        +        }
        +            $MOBY_RESPONSE .= simpleResponse($response, '', $queryID);
        +        }
              }
            }
        -   return responseHeader . $MOBY_RESPONSE . responseFooter;
        +   return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter;
          }


        DESCRIPTION

        -

        Used to do various transactions with MOBY-Central registry, including registering -new Object and Service types, querying for these types, registering new -Servers/Services, or queryiong for available services given certain input/output -or service type constraints.

        +

        CommonSubs are used to do various manipulations of MOBY Messages. It is useful +both Client and Service side to construct and parse MOBY Messages, and ensure +that the message structure is valid as per the API.

        +

        It DOES NOT connect to MOBY Central for any of its functions.


        AUTHORS

        -

        Mark Wilkinson (markw@illuminae.com)

        +

        Mark Wilkinson (markw at illuminae dot com)

        BioMOBY Project: http://www.biomoby.org

        @@ -127,33 +210,38 @@
          name     : simpleResponse
          function : wraps a simple article in the appropriate queryResponse structure
        - usage    : return responseHeader . &simpleResponse($object, 'MyArticleName') . responseFooter;
        + usage    : $resp .= &simpleResponse($object, 'MyArticleName', $queryID);
          args     : (in order)
                     $object   - (optional) a MOBY Object as raw XML
                     $article  - (optional) an articeName for this article
        +            $query    - (optional, but strongly recommended) the queryID value for the
        +                        queryInput block to which you are responding
          notes    : as required by the API you must return a response for every input.
                     If one of the inputs was invalid, you return a valid (empty) MOBY
        -            response by calling &simpleResponse() with no arguments.
        + response by calling &simpleResponse(undef, undef, $queryID) with no arguments.

        collectionResponse

          name     : collectionResponse
          function : wraps a set of articles in the appropriate queryResponse structure
        - usage    : return responseHeader . &collectionResponse(\@objects, 'MyArticleName') . responseFooter;
        + usage    : return responseHeader . &collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter;
          args     : (in order)
                     \@objects - (optional) a listref of MOBY Objects as raw XML
                     $article  - (optional) an articeName for this article
        +            $queryID  - (optional, but strongly recommended) the queryInput ID
        +                        to which you are responding
          notes    : as required by the API you must return a response for every input.
                     If one of the inputs was invalid, you return a valid (empty) MOBY
        -            response by calling &collectionResponse() with no arguments.
        + response by calling &collectionResponse(undef, undef, $queryID).

        responseHeader

        - name     : responseHeader
        + name     : responseHeader($auth)
          function : print the XML string of a MOBY response header
        - usage    : return responseHeader . $DATA . responseFooter;
        + usage    : return responseHeader('illuminae.com') . $DATA . responseFooter;
        + args     : a string representing the service providers authority URI
          caveat   : will soon be expanded to include service provision info
                     and additional namespace declarations
          notes    :  returns everything required up to the response articles themselves.
        @@ -167,7 +255,7 @@
         
          name     : responseFooter
          function : print the XML string of a MOBY response footer
        - usage    : return responseHeader . $DATA . responseFooter;
        + usage    : return responseHeader('illuminae.com') . $DATA . responseFooter;
          notes    :  returns everything required after the response articles themselves
                      i.e. something like:
           
        @@ -175,12 +263,74 @@
              </moby:MOBY>

        +

        getInputs

        +
        + name     : getInputs
        + function : get the queryInput block(s) as XML::DOM nodes
        + usage    : @queryInputs = getInputArticles($XML)
        + args     : the raw XML of a <MOBY> query, or an XML::DOM document
        + returns  : a list of XML::DOM::Node's, each is a queryInput.
        + Note     : Remember that queryInputs are numbered!  This is what you
        +            pass as the third argument to the simpleResponse or collectionResponse
        +            subroutine to associate the numbered input to the numbered response
        +

        +

        +

        getInputID

        +
        + name     : getInputID
        + function : get the value of the queryID element
        + usage    : @queryInputs = getInputID($XML)
        + args     : the raw XML or XML::DOM of a <queryInput> block
        + returns  : integer, or ''
        + Note     : queryInputs and queryResponses are coordinately enumerated!
        +            The integer you get here is what you
        +            pass as the third argument to the simpleResponse or collectionResponse
        +            subroutine to associate the numbered input to the numbered response
        +

        +

        +

        getArticles

        +
        + name     : getArticles
        + function : get the Simple/Collection articles for a single queryInput
        +            or queryResponse node
        + usage    : @articles = getArticles($XML)
        + args     : raw XML or XML::DOM of a moby:queryInput or a moby:queryResponse block
        + returns  : a list of listrefs; each listref is one component of the queryInput.
        +            a single queryInput/Responsemay consist of one or more named or unnamed
        +            simple or collection articles.  The listref structure is thus [name, $ARTICLE]:
        +            
        +            e.g.:  @articles = ['name1', $SIMPLE_DOM]
        +            or  :  @articles = ['name1', $COLLECTION_DOM], ['name2', $SIMPLE_DOM]...
        +
        +            the former is generated from the following sample XML:
        +
        +                <queryInput>
        +                    <Simple articleName='name1'>
        +                      <Object namespace=blah id=blah/>
        +                    </Simple>
        +                </queryInput>
        +                <queryInput>
        +                    <Simple articleName='name1'>
        +                      <Object namespace=blah id=blah/>
        +                    </Simple>
        +                </queryInput>
        +

        +

        +

        getCollectedSimples

        +
        + name     : getCollectedSimples
        + function : get the Simple articles collected in a moby:Collection block
        + usage    : @Simples = getCollectedSimples($XML)
        + args     : raw XML or XML::DOM of a moby:Collection block
        + returns  : a list of XML::DOM nodes, each of which is a moby:Simple block
        +

        +

        getInputArticles

          name     : getInputArticles
          function : get the Simple/Collection articles for each input query, in order
          usage    : @queries = getInputArticles($XML)
        - args     : the raw XML of a <MOBY> query
        + args     : the raw XML of a moby:MOBY query
          returns  : a list of listrefs, each listref is the input to a single query.
                     Remember that the input to a single query may be one or more Simple
                     and/or Collection articles.  These are provided as XML::DOM nodes.
        @@ -203,11 +353,7 @@
                             </Simple>
                         </queryInput>
                       </moby:Query>
        -                 ...
        - note     : This subroutine enforces valid message structure
        -            in that you may only have one Simple OR one Collection
        -            article per queryInput!  if you have more, only the first
        -            is read.
        + ...

        isSimpleArticle

        From mwilkinson at pub.open-bio.org Wed Nov 12 12:31:43 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed Nov 12 16:15:54 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121731.hACHVhx8012361@pub.open-bio.org> mwilkinson Wed Nov 12 12:31:42 EST 2003 Update of /home/repository/moby/moby-live/Perl In directory pub.open-bio.org:/tmp/cvs-serv12338 Modified Files: MANIFEST Added Files: Makefile.PL Log Message: Yay! We have a Makefile and test suite again! This is more simple than the one that Richard was working on at the Singapore hackathon (his was able to actually install and test local services), but this will at least install the modules and test the basic functionality of MOBY::Client::Central moby-live/Perl Makefile.PL,1.4,1.5 MANIFEST,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/Makefile.PL,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Perl/Makefile.PL 2003/10/09 16:49:22 1.4 +++ /home/repository/moby/moby-live/Perl/Makefile.PL 2003/11/12 17:31:42 1.5 @@ -1,100 +1,101 @@ use ExtUtils::MakeMaker; use FindBin '$Bin'; -#require 5.008; -my $VERSION = '0.04'; - -my $WWW_ROOT_PATH = "/usr/local/apache" ; -my $CGI_BIN = "cgi-bin" ; -my $WWW_USER = "www" ; -# -# RMB - Singapore biohackethon - Work in progress, to make a cleaner installation -# Welcome... -print STDERR "\n\nMOBY Installation (Perl Implementation)\n" ; -print STDERR "=======================================\n\n" ; - -my $line ; -print STDERR - "I need to know your web server path...\n", - "This is typically something like one of the following:\n\n", - "\tStandard Apache Unix location: '/usr/local/apache'\n", - "\tTypical location under Linux: '/var/www/'\n", - "\tLocation under Mac OS X: '/Library/WebServer'\n\n", - "Path to your WWW server root \[$WWW_ROOT_PATH\]? "; -chomp ($line = <>); -$WWW_ROOT_PATH=$line if ($line) ; -print STDERR "Setting WWW server root path to '$WWW_ROOT_PATH'\n\n" ; - -print STDERR - "I also need the name of your CGI script directory there:\n\n", - "\tMost of the time, this is 'cgi-bin'\n", - "\tbut Mac OS X uses 'CGI-Executables'\n\n", - "Name of your CGI directory \[$CGI_BIN\]? "; -chomp ($line = <>); -$CGI_BIN=$line if ($line) ; -my $CGI_BIN_PATH = "$WWW_ROOT_PATH/$CGI_BIN" ; -print STDERR "Setting CGI bin path to '$CGI_BIN_PATH'\n\n" ; - -print STDERR - "Your server runs under a specific user account.\n", - "\tUnder most installations, this is usually 'nobody' or 'www'\n", - "\tUnder Mac OS X, this is 'root'\n\n", - "Name of WWW server user account \[$WWW_USER\]? "; -chomp ($line = <>); -$WWW_USER=$line if ($line) ; -print STDERR "Setting WWW user to '$WWW_USER'\n\n" ; - -my $WWW_GROUP=$WWW_USER ; -print STDERR - "A UNIX group is also generally associated with the web directories.\n", - "\tThis may be the same as the above user account name, or\n", - "\tin be something else, like 'admin' in Mac OS X\n\n", - "Name of WWW server group \[$WWW_GROUP\]? "; -chomp($line = <>) ; -$WWW_GROUP=$line if($line) ; -print STDERR "Setting WWW group to '$WWW_GROUP'\n\n" ; -print STDERR "Press any key to continue...\n\n" ; -$line=<>; - -sub MY::post_initialize { - return <<"MAKE_FRAG"; -MOBY_WWW_ROOT_PATH = $WWW_ROOT_PATH -MOBY_CGI_BIN_PATH = $CGI_BIN_PATH -MOBY_WWW_USER = $WWW_USER -MOBY_WWW_GROUP = $WWW_GROUP -MAKE_FRAG -} +my $VERSION = '0.1'; +#my $WWW_ROOT_PATH = "/usr/local/apache" ; +#my $CGI_BIN = "cgi-bin" ; +#my $WWW_USER = "www" ; +## +## RMB - Singapore biohackethon - Work in progress, to make a cleaner installation +## Welcome... +#print STDERR "\n\nMOBY Installation (Perl Implementation)\n" ; +#print STDERR "=======================================\n\n" ; +# +#my $line ; +#print STDERR +# "I need to know your web server path...\n", +# "This is typically something like one of the following:\n\n", +# "\tStandard Apache Unix location: '/usr/local/apache'\n", +# "\tTypical location under Linux: '/var/www/'\n", +# "\tLocation under Mac OS X: '/Library/WebServer'\n\n", +# "Path to your WWW server root \[$WWW_ROOT_PATH\]? "; +#chomp ($line = <>); +#$WWW_ROOT_PATH=$line if ($line) ; +#print STDERR "Setting WWW server root path to '$WWW_ROOT_PATH'\n\n" ; +# +#print STDERR +# "I also need the name of your CGI script directory there:\n\n", +# "\tMost of the time, this is 'cgi-bin'\n", +# "\tbut Mac OS X uses 'CGI-Executables'\n\n", +# "Name of your CGI directory \[$CGI_BIN\]? "; +#chomp ($line = <>); +#$CGI_BIN=$line if ($line) ; +#my $CGI_BIN_PATH = "$WWW_ROOT_PATH/$CGI_BIN" ; +#print STDERR "Setting CGI bin path to '$CGI_BIN_PATH'\n\n" ; +# +#print STDERR +# "Your server runs under a specific user account.\n", +# "\tUnder most installations, this is usually 'nobody' or 'www'\n", +# "\tUnder Mac OS X, this is 'root'\n\n", +# "Name of WWW server user account \[$WWW_USER\]? "; +#chomp ($line = <>); +#$WWW_USER=$line if ($line) ; +#print STDERR "Setting WWW user to '$WWW_USER'\n\n" ; +# +#my $WWW_GROUP=$WWW_USER ; +#print STDERR +# "A UNIX group is also generally associated with the web directories.\n", +# "\tThis may be the same as the above user account name, or\n", +# "\tin be something else, like 'admin' in Mac OS X\n\n", +# "Name of WWW server group \[$WWW_GROUP\]? "; +#chomp($line = <>) ; +#$WWW_GROUP=$line if($line) ; +#print STDERR "Setting WWW group to '$WWW_GROUP'\n\n" ; +#print STDERR "Press any key to continue...\n\n" ; +#$line=<>; +# +#sub MY::post_initialize { +# return <<"MAKE_FRAG"; +#MOBY_WWW_ROOT_PATH = $WWW_ROOT_PATH +#MOBY_CGI_BIN_PATH = $CGI_BIN_PATH +#MOBY_WWW_USER = $WWW_USER +#MOBY_WWW_GROUP = $WWW_GROUP +#MAKE_FRAG +#} +# # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( - 'NAME' => 'MOBY', + 'NAME' => 'MOBY-S', 'VERSION' => $VERSION, 'PREREQ_PM' => { + 'SOAP::Lite' => 0.55, + 'XML::DOM' => 1.42, }, # e.g., Module::Name => 1.1 #'PM_FILTER' => "", ($] >= 5.005 ? ## Add these new keywords supported since 5.005 - (ABSTRACT => 'Perl module binding for MOBY', + (ABSTRACT => 'Perl module binding for MOBY-S', AUTHOR => 'Mark Wilkinson [markw@illuminae.com]') : ()), ); # # Insert additional MOBY specific Makefile targets # - -sub MY::postamble { - return <<"MAKE_FRAG"; -Central: - echo 'Make (local) MOBY Central stub' - -Server: - echo 'Make (local) MOBY Server stub' - -WWWClient: - echo 'Setting up MOBY WWW Client' - cp scripts/MOBY-Client.cgi \$(MOBY_CGI_BIN_PATH) - chown \$(MOBY_WWW_USER):\$(MOBY_WWW_GROUP) \$(MOBY_CGI_BIN_PATH)/MOBY-Client.cgi - -MAKE_FRAG -} +# +#sub MY::postamble { +# return <<"MAKE_FRAG"; +#Central: +# echo 'Make (local) MOBY Central stub' +# +#Server: +# echo 'Make (local) MOBY Server stub' +# +#WWWClient: +# echo 'Setting up MOBY WWW Client' +# cp scripts/MOBY-Client.cgi \$(MOBY_CGI_BIN_PATH) +# chown \$(MOBY_WWW_USER):\$(MOBY_WWW_GROUP) \$(MOBY_CGI_BIN_PATH)/MOBY-Client.cgi +# +#MAKE_FRAG +#} =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MANIFEST,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Perl/MANIFEST 2003/11/12 16:49:13 1.5 +++ /home/repository/moby/moby-live/Perl/MANIFEST 2003/11/12 17:31:42 1.6 @@ -22,12 +22,7 @@ MOBY/Client/SimpleArticle.pm MOBY/Client/SimpleInput.pm MOBY/Client/Service.pm -t/Central.t t/Client-Central.t -t/Registration.t -t/ServiceInstance.t -t/Service.t -t/BasicLocalServices.t scripts/debugYourService scripts/MOBY-Central.pl scripts/Services.cgi From mwilkinson at pub.open-bio.org Wed Nov 12 11:14:04 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed Nov 12 16:15:58 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121614.hACGE4aW011592@pub.open-bio.org> mwilkinson Wed Nov 12 11:14:04 EST 2003 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv11576 Removed Files: debug_a_service.pl Log Message: removing old moby-live/Perl/scripts debug_a_service.pl,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Perl/scripts/RCS/debug_a_service.pl,v: No such file or directory From mwilkinson at pub.open-bio.org Wed Nov 12 11:38:49 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed Nov 12 16:16:02 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121638.hACGcncD011745@pub.open-bio.org> mwilkinson Wed Nov 12 11:38:49 EST 2003 Update of /home/repository/moby/moby-live/Perl/scripts/Services In directory pub.open-bio.org:/tmp/cvs-serv11729/Services Added Files: HelloWorldService.pm Removed Files: PlanetLocalServices.pm Log Message: removed Rebecca's helloPlanet service and replaced it with a more generic helloWorld service that uses the correct new message structure and the CommonSubs routines to make it even easier. The helloWorld service simply echos back to you what you pass it. moby-live/Perl/scripts/Services HelloWorldService.pm,NONE,1.1 PlanetLocalServices.pm,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Perl/scripts/Services/RCS/PlanetLocalServices.pm,v: No such file or directory From mwilkinson at pub.open-bio.org Wed Nov 12 11:47:16 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed Nov 12 16:16:06 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121647.hACGlGus011866@pub.open-bio.org> mwilkinson Wed Nov 12 11:47:16 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv11847/MOBY Modified Files: CommonSubs.pm Log Message: added a somewhat useful subroutine to common subs that will extract the content of a request as a string moby-live/Perl/MOBY CommonSubs.pm,1.27,1.28 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/08 17:21:31 1.27 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/12 16:47:16 1.28 @@ -157,6 +157,7 @@ getArticles getCollectedSimples getNodeContentWithArticle + extractRawContent collectionResponse validateNamespaces isSimpleArticle @@ -177,6 +178,7 @@ getArticles getCollectedSimples getNodeContentWithArticle + extractRawContent collectionResponse validateNamespaces isSimpleArticle @@ -768,6 +770,31 @@ =cut +=head2 extractRawContent + + name : extractRawContent + function : pass me an article (Simple, or Collection) and I'll give you the + content AS A STRING - i.e. the raw XML of the contained MOBY Object(s) + usage : extractRawContent($simple) + input : the one element of the output from getArticles + returns : string + +=cut + + +sub extractRawContent { + my ($article) = @_; + return "" unless $article; + return "" unless ref($article) =~ /XML::DOM/; + my $response; + foreach ($article->getChildNodes){ + $response .= $_->toString; + } + return $response; + +} + + sub getNodeContentWithArticle{ # give me a DOM, a TagName, an articleName and I will return you the content # of that node **as a string** (beware if there are additional XML tags in there!) From mwilkinson at pub.open-bio.org Wed Nov 12 11:49:13 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed Nov 12 16:16:10 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121649.hACGnDMM011910@pub.open-bio.org> mwilkinson Wed Nov 12 11:49:13 EST 2003 Update of /home/repository/moby/moby-live/Perl In directory pub.open-bio.org:/tmp/cvs-serv11891 Modified Files: MANIFEST Log Message: updated MANIFEST in anticipation of releasing a Makefile (finally!) moby-live/Perl MANIFEST,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MANIFEST,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Perl/MANIFEST 2003/06/03 16:28:50 1.4 +++ /home/repository/moby/moby-live/Perl/MANIFEST 2003/11/12 16:49:13 1.5 @@ -1,36 +1,52 @@ MANIFEST README Changes -config/MOBYPatch.pl Makefile.PL -docs/INSTALL-Central.txt -docs/INSTALL-Client.txt -docs/INSTALL-Service_Provider.txt -docs/html/Central.html -MOBY.pm MOBY/authority.pm MOBY/central_db_connection.pm MOBY/mysql.pm MOBY/OntologyServer.pm +MOBY/CommonSubs.pm +MOBY/CrossReference.pm MOBY/service_instance.pm MOBY/service_type.pm MOBY/simple_input.pm MOBY/simple_output.pm MOBY/Central.pm -MOBY/Central_WSDL_SandR.wsdl MOBY/Client/Central.pm MOBY/Client/Registration.pm MOBY/Client/ServiceInstance.pm +MOBY/Client/CollectionArticle.pm +MOBY/Client/OntologyServer.pm +MOBY/Client/ServiceInstance.pm +MOBY/Client/SimpleArticle.pm +MOBY/Client/SimpleInput.pm MOBY/Client/Service.pm -MOBY/Services/BasicLocalServices.pm -MOBY/Services/Services.cgi t/Central.t t/Client-Central.t t/Registration.t t/ServiceInstance.t t/Service.t t/BasicLocalServices.t +scripts/debugYourService scripts/MOBY-Central.pl scripts/Services.cgi scripts/testMOBYCentral_v05.pl -scripts/testMOBYClientCentral_v05.pl \ No newline at end of file +scripts/testMOBYClientCentral_v05.pl +scripts/OntologyServer.cgi +scripts/Services/HelloWorldService.pm +scripts/Services/LocalServices.pm +lsid/authority/authority.pl +lsid/authority/ClassResolver.pm +lsid/authority/dbConfigure.pm.template +lsid/authority/dbConnect.pm +lsid/authority/Error.pm +lsid/authority/metadata.pl +lsid/authority/NamespaceResolver.pm +lsid/authority/PredicateResolver.pm +lsid/authority/RDFConfigure.pm +lsid/authority/RelationshipResolver.pm +lsid/authority/ServiceInstanceResolver.pm +lsid/authority/ServiceResolver.pm + + From mwilkinson at pub.open-bio.org Wed Nov 12 12:05:48 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed Nov 12 16:16:14 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121705.hACH5mTL012057@pub.open-bio.org> mwilkinson Wed Nov 12 12:05:48 EST 2003 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv12037 Removed Files: BasicLocalServices.t Central.t Registration.t Service.t ServiceInstance.t Log Message: removing outdated test files moby-live/Perl/t BasicLocalServices.t,1.1,NONE Central.t,1.1,NONE Registration.t,1.1,NONE Service.t,1.1,NONE ServiceInstance.t,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Perl/t/RCS/BasicLocalServices.t,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/t/RCS/Central.t,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/t/RCS/Registration.t,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/t/RCS/Service.t,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/t/RCS/ServiceInstance.t,v: No such file or directory From mwilkinson at pub.open-bio.org Wed Nov 12 17:33:09 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed Nov 12 17:23:11 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311122233.hACMX9sJ013630@pub.open-bio.org> mwilkinson Wed Nov 12 17:33:09 EST 2003 Update of /home/repository/moby/moby-live/Perl In directory pub.open-bio.org:/tmp/cvs-serv13611 Modified Files: Makefile.PL Log Message: okay, now we have a makefile that actually WORKS moby-live/Perl Makefile.PL,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/Makefile.PL,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Perl/Makefile.PL 2003/11/12 17:31:42 1.5 +++ /home/repository/moby/moby-live/Perl/Makefile.PL 2003/11/12 22:33:09 1.6 @@ -3,6 +3,10 @@ my $VERSION = '0.1'; +system "mkdir lib" unless (-e 'lib' && -d 'lib'); # put the files into the lib directory so that they will be properly installed +system "cp -rf MOBY lib"; + + #my $WWW_ROOT_PATH = "/usr/local/apache" ; #my $CGI_BIN = "cgi-bin" ; #my $WWW_USER = "www" ; From sipuijvl3 at msn.com Sun Nov 16 19:40:42 2003 From: sipuijvl3 at msn.com (Robbie Herndon) Date: Sun Nov 16 03:29:45 2003 Subject: [MOBY-guts] V 1 @ G R A ---> 75% Cheaper Today! wtxu e Message-ID: An HTML attachment was scrubbed... URL: http://portal.open-bio.org/pipermail/moby-guts/attachments/20031117/a3384af9/attachment.htm From azaleeriecke at caste.loanprime.net Tue Nov 18 05:51:12 2003 From: azaleeriecke at caste.loanprime.net (Woman Solutions) Date: Tue Nov 18 06:55:13 2003 Subject: [MOBY-guts] Be the envy of all your friends! Message-ID: An HTML attachment was scrubbed... URL: http://portal.open-bio.org/pipermail/moby-guts/attachments/20031118/5fa5ecf8/attachment.htm From senger at pub.open-bio.org Thu Nov 20 12:08:47 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu Nov 20 11:57:57 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311201708.hAKH8loo023950@pub.open-bio.org> senger Thu Nov 20 12:08:47 EST 2003 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv23931/docs Modified Files: ChangeLog Log Message: SOAPAction header added moby-live/Java/docs ChangeLog,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/09 01:05:02 1.5 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/20 17:08:46 1.6 @@ -1,3 +1,14 @@ +2003-11-20 Martin Senger + + * CentralImpl.call method can deal now with results of type byte[] + (base64 in the SOAP terminology). + + * CentralImpl sets now SOAPAction header. It was not needed when + accessing the Moby Central (registry) but some users started to + use CentralImpl also for calling services (by using + CentralImp.call method) and that usually required a SOAPAction + header. + 2003-11-09 Martin Senger * Added servlet properties for HTTP proxies and path to 'dot'. From senger at pub.open-bio.org Thu Nov 20 12:08:47 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu Nov 20 11:58:04 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311201708.hAKH8lHq023969@pub.open-bio.org> senger Thu Nov 20 12:08:47 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv23931/src/main/org/biomoby/client Modified Files: CentralImpl.java Log Message: SOAPAction header added moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/08 00:27:24 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/20 17:08:47 1.4 @@ -133,6 +133,9 @@ Service service = new Service(); call = (Call) service.createCall(); call.setTargetEndpointAddress (endpoint); + + call.setSOAPActionURI (uri + "#" + method); + if (debug) { System.err.println ("METHOD CALL: " + method); System.err.println ("------------"); @@ -1067,6 +1070,9 @@ buf.append (tmp[i]); return new String (buf); } + if (result instanceof byte[]) + return new String ((byte[])result); + throw new MobyException ("Unknown type of result: " + result.getClass().getName()); } From mwilkinson at pub.open-bio.org Fri Nov 21 19:08:10 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Fri Nov 21 18:57:13 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311220008.hAM08AY6029239@pub.open-bio.org> mwilkinson Fri Nov 21 19:08:10 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv29220/Perl/MOBY/Client Modified Files: Central.pm Log Message: small fix to allow local registries moby-live/Perl/MOBY/Client Central.pm,1.61,1.62 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.61 retrieving revision 1.62 diff -u -r1.61 -r1.62 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2003/11/04 15:05:45 1.61 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2003/11/22 00:08:10 1.62 @@ -247,6 +247,7 @@ my $url = $acc->{URL}; my $uri = $acc->{URI}; my $type = $acc->{TYPE}; + $type ||='soap'; if (lc($type) eq "get"){ push @{$self->Connections}, [$name, $type, $url]; } else { From mwilkinson at pub.open-bio.org Mon Nov 24 12:25:49 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 24 12:27:00 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241725.hAOHPn5n014476@pub.open-bio.org> mwilkinson Mon Nov 24 12:25:49 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14453/Perl/MOBY Modified Files: Central.pm OntologyServer.pm Log Message: fixed bug reported by Martin this AM. Relationships method should now return only the relationships that you asked for, and should not return duplicates... I hope... moby-live/Perl/MOBY Central.pm,1.111,1.112 OntologyServer.pm,1.28,1.29 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.111 retrieving revision 1.112 diff -u -r1.111 -r1.112 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2003/11/01 16:42:13 1.111 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2003/11/24 17:25:48 1.112 @@ -234,13 +234,10 @@ if ($term =~ /FAILED/){return &_error("Malformed XML;","");} return &_error("Malformed XML; may be missing required parameters objectType, Description, authURI or contactEmail",""); } - # push @{$relationships{$relationshipType}}, [$objectType, $articleName]; - # validate that the final ontology will be valid + # validate that the final ontology will be valid by testing against existing relationships and such while (my ($reltype, $obj) = each %{$relationships}){ my ($success, $message, $URI) = $RelOntologyServer->relationshipExists(term => $reltype, ontology => 'object'); # success = 1 if it does $success==0 && return &_error($message, $URI ); - } - while (my ($reltype, $obj) = each %{$relationships}){ foreach (@{$obj}){ my ($objectType, $articleName) = @{$_}; my ($success, $message, $URI) = $OntologyServer->objectExists(term => $objectType); # success = 1 if it does @@ -291,19 +288,12 @@ my ($success, $message, $deleteURI) = $OntologyServer->deleteObject(term => $term); # hopefully this situation will never happen! $success==0 && return &_error("object failed ISA and/or HASA connections, and subsequently failed deletion. This is a critical error, - and may indicate corruption of the MOBY Central registry", $deleteURI); + and may indicate corruption of the MOBY Central registry.", $deleteURI); return &_error("object failed to register due to failure during registration of ISA/HASA relationships".(join ",", (@failures))."\n", ""); } return &_success("Object $term registered successfully.", $URI); } - # - # ExistingObjectType - # ... - # ... - # - #... - #... sub _registerObjectPayload { my ($payload) = @_; @@ -863,13 +853,61 @@ =item * only Input Secondary articles are defined during registration; Output Secondary objects are entirely optional and may or may not be interpreted Client-side using their articleName tags. +=item * Service Categories: + +=over 3 + +=item * moby - for services that use the MOBY SOAP messaging format and object structure (i.e. the objects used in service transaction inherit from the root 'Object' Class in the MOBY Class ontology). + +=item * soap - for other SOAP services that do not use the MOBY messaging format. The other elements in the registration should be interpreted as follows: + +=over 2 + +=item * authURI - a URI representing your organization (e.g. yourdomain.com); no http-prefix, and no trailing path information is allowed. + +=item * serviceName - an arbitrary, but unique, name for your service within your authURI namespace + +=item * URL - the URL from which a WSDL document describing your service can be retrieved by an HTTP GET call. + +=item * Comments about Input and Output: + +=over 2 + +=item * in "moby" services, the input and output messaging structure is defined by the BioMOBY API, and the services use data Objects that are defined in the Class ontology as inheriting from the root "Object" Class. For "soap" services, there is additional flexibility: + +=over 2 + +=item * Similar to a "moby" service, your "soap" service must consume/produce ontologically valid named data-types in order to be discovered by registry searches. As such, you _must_ register a single unique name for any non-MOBY input or output data Classes, regardless of the actual complexity of the input/output message. + +=item * Do this using the registerObjectClass call of MOBY Central; To ensure uniqueness and LSID compatibilty of data class names, you must name your data using the following format: your.authURI:dataClassName + +=item * remember, you may use any MOBY Object as your input/output (i.e. any Class Ontology term that inherits from Object) so long as you follow the MOBY message structure for that input or output. + +=item * You may register, for example, a service that consumes a non-MOBY data Class and outputs a MOBY data class, so long as you follow the MOBY Messaging format for the output data + +=item * You may register, for example, a service that consumes a MOBY data Class and outputs a non-MOBY data class, so long as you follow the MOBY Messaging format for the ihput data + +=item * NOTE: Nether of the cases above are considred MOBY services, and are therefore described in the category of "soap" service + +=item * When registering a non-MOBY data Class name, it DOES NOT have any "Relationship" component (see registerObjectClass API) + +=item * non-MOBY inputs or outputs are described as a single Primary, Simple article of your new named type. + +=back + +=item * secondaryArticles - not applicable; should be left out of message. + +=back + +=back + =back Input XML : - moby + moby YourServiceNameHere TypeOntologyTerm your.URI.here @@ -1025,7 +1063,7 @@ return &_error("Category may take the (case sensitive) values 'moby', 'cgi', 'soap'\n","") unless (($Category eq "est") || ($Category eq "cgi") || ($Category eq "moby")); $debug && &_LOG("Entering switch with $Category method\n"); - return &_error("Service categories other than 'moby' are not yet implemented","") unless ($Category eq "moby"); + return &_error("Service categories other than 'moby' and 'soap' are not yet implemented","") unless ($Category eq "moby" || $Category eq "soap"); my @IN = @{$INPUTS}; my @OUT = @{$OUTPUTS}; my @SECS = @{$SECONDARY}; @@ -1050,6 +1088,8 @@ return &_error("$message","$URI") unless ($valid); # right, registration should be successful now! + # "soap" services may only have one input and one output + my $SVC = MOBY::service_instance->new( category => $Category, servicename => $serviceName, @@ -2259,22 +2299,22 @@ my $doc = $Parser->parse($payload); my $x = $doc->getElementsByTagName("relationshipType"); - my $l = $x->getLength; # might be a Collection object with multiple simples... + my $l = $x->getLength; my $exp = $doc->getElementsByTagName("expandRelationship"); - my $expl = $exp->getLength; # might be a Collection object with multiple simples... + my $expl = $exp->getLength; my $expand_relationship = &_nodeTextContent($doc, 'expandRelationship'); $expand_relationship =~ s/\s//g; $expand_relationship ||=0; - my @reltypes; + my %reltypes; for (my $n=0; $n < $l; ++$n){ my @child = $x->item($n)->getChildNodes; foreach (@child){ next unless ($_->getNodeType == TEXT_NODE); my $name .= $_->toString; $name =~ s/\s//g; - push @reltypes, $name; + $reltypes{$name} = 1; } } @@ -2286,13 +2326,20 @@ $ontology ||="service"; # if we have now succeeded and haven't already taken the ontology then it must be the service ontology &_LOG("Ontology was $ontology; Term was $term\n"); my $OS = MOBY::OntologyServer->new(ontology => $ontology); - my %rels = %{$OS->Relationships(term => $term, expand => $expand_relationship)}; + my %rels = %{$OS->Relationships(term => $term, expand => $expand_relationship)}; # %rels = $rels{relationship} = [lsid, lsid,lsid] my $response="\n"; my $OSrel = MOBY::OntologyServer->new(ontology => 'relationship'); + foreach (keys %reltypes){ # for each of our desired types + my $rellsid = $OSrel->getRelationshipURI($ontology, $_); # get the LSID + delete $reltypes{$_}; # remove the non-LSID version from the hash + $reltypes{$rellsid} = 1; # set the LSID as valid + } + # now for each of the relationship types that we were returned foreach (keys %rels){ my $rellsid = $OSrel->getRelationshipURI($ontology, $_); next unless $rellsid; + next unless $reltypes{$rellsid}; # next unless it is one ofthe relationship types we requested my $lsids = $rels{$rellsid}; next unless $lsids->[0]; $response .="\n"; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2003/09/15 02:44:40 1.28 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2003/11/24 17:25:49 1.29 @@ -785,7 +785,7 @@ if ($direction eq 'root'){ unless (defined $relationship){ $defs = $self->dbh->selectall_arrayref(" - select s2.${ontology}_lsid, relationship_type from + select distinct s2.${ontology}_lsid, relationship_type from ${ontology}_term2term as t2t, $ontology as s1, $ontology as s2 @@ -795,7 +795,7 @@ s1.${ontology}_lsid = ?", undef, $term); # ") } else { $defs = $self->dbh->selectall_arrayref(" - select s2.${ontology}_lsid, relationship_type from + select distinct s2.${ontology}_lsid, relationship_type from ${ontology}_term2term as t2t, $ontology as s1, $ontology as s2 @@ -808,7 +808,7 @@ } else { unless (defined $relationship){ $defs = $self->dbh->selectall_arrayref(" - select s2.${ontology}_lsid, relationship_type from + select distinct s2.${ontology}_lsid, relationship_type from ${ontology}_term2term as t2t, $ontology as s1, $ontology as s2 @@ -818,7 +818,7 @@ s2.${ontology}_lsid = ?", undef, $term); # ") } else { $defs = $self->dbh->selectall_arrayref(" - select s2.${ontology}_lsid, relationship_type from + select distinct s2.${ontology}_lsid, relationship_type from ${ontology}_term2term as t2t, $ontology as s1, $ontology as s2 From mwilkinson at pub.open-bio.org Mon Nov 24 13:06:45 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon Nov 24 13:07:56 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241806.hAOI6jwn015740@pub.open-bio.org> mwilkinson Mon Nov 24 13:06:45 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv15721/Perl/MOBY Modified Files: Central.pm Log Message: the default is supposed to return all, not nothing moby-live/Perl/MOBY Central.pm,1.112,1.113 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.112 retrieving revision 1.113 diff -u -r1.112 -r1.113 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2003/11/24 17:25:48 1.112 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2003/11/24 18:06:45 1.113 @@ -2339,7 +2339,9 @@ foreach (keys %rels){ my $rellsid = $OSrel->getRelationshipURI($ontology, $_); next unless $rellsid; - next unless $reltypes{$rellsid}; # next unless it is one ofthe relationship types we requested + if (keys %reltypes){ + next unless $reltypes{$rellsid}; # next unless it is one ofthe relationship types we requested + } my $lsids = $rels{$rellsid}; next unless $lsids->[0]; $response .="\n"; From senger at pub.open-bio.org Mon Nov 24 13:45:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Mon Nov 24 13:46:36 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241845.hAOIjPMX016047@pub.open-bio.org> senger Mon Nov 24 13:45:25 EST 2003 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv16028/docs Modified Files: ChangeLog Log Message: added relationships methods to Central.java moby-live/Java/docs ChangeLog,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/20 17:08:46 1.6 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/24 18:45:25 1.7 @@ -1,3 +1,8 @@ +2003-11-24 Martin Senger + + * Added several new methods to Central.java dealing with + relationships. Consequently MobyCmdLineClient got few new options. + 2003-11-20 Martin Senger * CentralImpl.call method can deal now with results of type byte[] From senger at pub.open-bio.org Mon Nov 24 13:45:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Mon Nov 24 13:46:37 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241845.hAOIjPnT016086@pub.open-bio.org> senger Mon Nov 24 13:45:25 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv16028/src/Clients/help Modified Files: MobyCmdLineClient_usage.txt Log Message: added relationships methods to Central.java moby-live/Java/src/Clients/help MobyCmdLineClient_usage.txt,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt 2003/10/17 13:13:34 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt 2003/11/24 18:45:25 1.3 @@ -33,6 +33,17 @@ -data print definition of given data type + To get ontological relationships of given entities: + + -ot + print all parents names of given service type + -od + print all relantionships (types and names) of given data type + -od2 ISA + -od2 HASA + -od2 HAS + print all relantionships of given type for given data type + To find services given by their attributes: -fn From senger at pub.open-bio.org Mon Nov 24 13:45:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Mon Nov 24 13:46:39 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241845.hAOIjP1g016131@pub.open-bio.org> senger Mon Nov 24 13:45:25 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv16028/src/main/org/biomoby/shared Modified Files: Central.java Log Message: added relationships methods to Central.java moby-live/Java/src/main/org/biomoby/shared Central.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2003/09/24 14:33:37 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2003/11/24 18:45:25 1.2 @@ -14,7 +14,6 @@ /** * An interface to the Moby Registry. *

        - * * The Moby Registry service (or Moby Central service) is used to do * various transactions, including registering new Data and Service * types, querying for these types, registering new Services, or @@ -34,12 +33,29 @@ * http://biomoby.org. *

        * + *

        Last changes (in backwards order)
        + *
          + *
        • New methods retrieving various types of relationships has been added: + * {@link #getDataTypeRelationships}, + * {@link #getServiceTypeRelationships} + *
        • Added constants defining recognizable relationship types + * ({@link #ISA}, {@link #HASA}, {@link #HAS}) + *
        + *

        * @author Martin Senger * @version $Id$ */ public interface Central { + /** A name for the relationship type "is a". */ + static final String ISA = "ISA"; + + /** A name for the relationship type "has a". */ + static final String HASA = "HASA"; + + /** A name for the relationship type "has". */ + static final String HAS = "HAS"; /************************************************************************** * Get a (redundant) list of all registered service names. @@ -71,6 +87,18 @@ throws MobyException; /************************************************************************** + * Get all ISA relationships of the given 'serviceTypeName'. + *

        + * @param serviceTypeName is an ontology term specifying whose + * relationships should be looked at + * @return an array of ontology terms defining all parents (direct + * or indirect) of the given 'serviceTypeName' + * @throws MobyException if communication with the Moby Registry fails + *************************************************************************/ + String[] getServiceTypeRelationships (String serviceTypeName) + throws MobyException; + + /************************************************************************** * Get the list of all registered namespaces. *

        * @return a hash table where keys are names of namespaces while @@ -99,6 +127,34 @@ MobyDataType getDataType (String dataTypeName) throws MobyException, NoSuccessException; + /************************************************************************** + * Get all relationships of the given 'dataTypeName'. + *

        + * @param dataTypeName is an ontology term specifying whose + * relationships should be looked at + * @return a Map of ontology terms defining all relationships of + * the given 'dataTypeName'. The keys (of type String) are from + * the set {@link #ISA}, {@link #HASA}, and {@link #HAS}. The + * values (of type String) are data type names. + * @throws MobyException if communication with the Moby Registry fails + *************************************************************************/ + Map getDataTypeRelationships (String dataTypeName) + throws MobyException; + + /************************************************************************** + * Get all relationships of type 'relationshipType' for the given + *'dataTypeName'.

        + * @param dataTypeName is an ontology term specifying whose + * relationships should be looked at + * @param relationshipType is one from the set {@link #ISA}, + * {@link #HASA}, and {@link #HAS}. + * @return an array of names specifying all related types (of the + * given type and for the given data type) + * @throws MobyException if communication with the Moby Registry fails + *************************************************************************/ + String[] getDataTypeRelationships (String dataTypeName, String relationshipType) + throws MobyException; + /************************************************************************* * Get XML Schema definition of the given data type. *

        From senger at pub.open-bio.org Mon Nov 24 13:45:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Mon Nov 24 13:46:40 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241845.hAOIjPpH016066@pub.open-bio.org> senger Mon Nov 24 13:45:25 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv16028/src/Clients Modified Files: MobyCmdLineClient.java Log Message: added relationships methods to Central.java moby-live/Java/src/Clients MobyCmdLineClient.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2003/09/24 12:33:50 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2003/11/24 18:45:25 1.2 @@ -172,6 +172,35 @@ param.substring (pos+1))); } + if ((param = cmd.getParam ("-ot")) != null ) { + decorationLn ("Service type '" + param + "' is-a:"); + decorationLn ("------------"); + System.out.println (StringUtils.join (worker.getServiceTypeRelationships (param), + "\n")); + } + + if ((param = cmd.getParam ("-od")) != null ) { + decorationLn ("Relationships of data type '" + param + "':"); + decorationLn ("--------------------------"); + Map types = worker.getDataTypeRelationships (param); + + for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + System.out.println (entry.getKey()); + System.out.println ("\t" + + StringUtils.join ((String[])entry.getValue(), + "\n\t")); + } + } + + String[] params = cmd.getParam ("-od2", 2); + if ((params != null && params[0] != null && params[1] != null)) { + decorationLn ("Relationships of data type '" + params[0] + "' of type '" + params[1] + "':"); + decorationLn ("--------------------------"); + System.out.println (StringUtils.join (worker.getDataTypeRelationships (params[0], params[1]), + "\n")); + } + // // registrations of various entities // @@ -468,7 +497,7 @@ // // call a raw method (for debugging) // - String[] params = null; + params = null; if ((params = cmd.getParam ("-call", 2)) != null ) { if (params[0] != null) { if (params[1] == null) { From senger at pub.open-bio.org Mon Nov 24 13:45:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Mon Nov 24 13:46:41 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241845.hAOIjPwp016108@pub.open-bio.org> senger Mon Nov 24 13:45:25 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv16028/src/main/org/biomoby/client Modified Files: CentralImpl.java Log Message: added relationships methods to Central.java moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/20 17:08:47 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/24 18:45:25 1.5 @@ -628,7 +628,7 @@ /************************************************************************** * The 'retrieveObjectDefinition' method returns something like this; * - * + * * urn:lsid:biomoby.org:objectclass:go_term * * http://www.illuminae.com @@ -640,7 +640,7 @@ * urn:lsid:biomoby.org:objectclass:string * urn:lsid:biomoby.org:objectclass:string * - * + * * *************************************************************************/ public MobyDataType getDataType (String dataTypeName) @@ -1083,4 +1083,139 @@ this.debug = debug; } + /************************************************************************** + * The 'Relationships' method returns something like this; + * + * + * + * urn:lsid:biomoby.org:servicetype:analysis + * urn:lsid:biomoby.org:servicetype:service + * + * + *************************************************************************/ + public String[] getServiceTypeRelationships (String serviceTypeName) + throws MobyException { + String result = + (String)doCall ("Relationships", + new Object[] { + "" + + "" + serviceTypeName + "" + + "" + Central.ISA + "" + + "1" + + "" + }); + + // parse returned XML + Vector v = new Vector(); + Document document = parser.parse (new StringReader (result)); + NodeList list = document.getElementsByTagName ("Relationship"); + for (int i = 0; i < list.getLength(); i++) { + Element elem = (Element)list.item (i); + NodeList children = elem.getChildNodes(); + for (int j = 0; j < children.getLength(); j++) { + if (children.item (j).getNodeName().equals ("serviceType")) { + v.addElement (children.item (j).getFirstChild().getNodeValue()); + } + } + } + String[] results = new String [v.size()]; + v.copyInto (results); + return results; + } + + /************************************************************************** + * The 'Relationships' method returns something like this; + * + * + * + * urn:lsid:biomoby.org:objectclass:virtualsequence + * urn:lsid:biomoby.org:objectclass:object + * + * + * urn:lsid:biomoby.org:objectclass:string + * urn:lsid:biomoby.org:objectclass:integer + * + * + * + *************************************************************************/ + public Map getDataTypeRelationships (String dataTypeName) + throws MobyException { + String result = + (String)doCall ("Relationships", + new Object[] { + "" + + "" + dataTypeName + "" + + "" + Central.ISA + "" + + "" + Central.HASA + "" + + "" + Central.HAS + "" + + "1" + + "" + }); + + // parse returned XML + Map results = new HashMap(); + Document document = parser.parse (new StringReader (result)); + NodeList list = document.getElementsByTagName ("Relationship"); + + for (int i = 0; i < list.getLength(); i++) { + Element elem = (Element)list.item (i); + String relType = elem.getAttribute ("relationshipType"); + NodeList children = elem.getChildNodes(); + Vector v = new Vector(); + for (int j = 0; j < children.getLength(); j++) { + if (children.item (j).getNodeName().equals ("objectType")) { + v.addElement (children.item (j).getFirstChild().getNodeValue()); + } + } + String[] names = new String [v.size()]; + v.copyInto (names); + results.put (relType, names); + } + return results; + } + + /************************************************************************** + * The 'Relationships' method returns something like this; + * + * + * + * urn:lsid:biomoby.org:objectclass:virtualsequence + * urn:lsid:biomoby.org:objectclass:object + * + * + * + *************************************************************************/ + public String[] getDataTypeRelationships (String dataTypeName, + String relationshipType) + throws MobyException { + String result = + (String)doCall ("Relationships", + new Object[] { + "" + + "" + dataTypeName + "" + + "" + relationshipType + "" + + "1" + + "" + }); + + // parse returned XML + Vector v = new Vector(); + Document document = parser.parse (new StringReader (result)); + NodeList list = document.getElementsByTagName ("Relationship"); + + // it should always be just one element in this list + for (int i = 0; i < list.getLength(); i++) { + Element elem = (Element)list.item (i); + NodeList children = elem.getChildNodes(); + for (int j = 0; j < children.getLength(); j++) { + if (children.item (j).getNodeName().equals ("objectType")) { + v.addElement (children.item (j).getFirstChild().getNodeValue()); + } + } + } + String[] results = new String [v.size()]; + v.copyInto (results); + return results; + } + } From senger at pub.open-bio.org Tue Nov 25 08:18:10 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue Nov 25 08:19:16 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIA1x019447@pub.open-bio.org> senger Tue Nov 25 08:18:10 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv19385/src/Clients Modified Files: MobyCmdLineClient.java MobyGraphs.java Log Message: added buglist for graphs; code cleaning moby-live/Java/src/Clients MobyCmdLineClient.java,1.2,1.3 MobyGraphs.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2003/11/24 18:45:25 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2003/11/25 13:18:10 1.3 @@ -175,7 +175,7 @@ if ((param = cmd.getParam ("-ot")) != null ) { decorationLn ("Service type '" + param + "' is-a:"); decorationLn ("------------"); - System.out.println (StringUtils.join (worker.getServiceTypeRelationships (param), + System.out.println (StringUtils.join (worker.getServiceTypeRelationships (param, true), "\n")); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2003/11/08 00:27:24 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2003/11/25 13:18:10 1.3 @@ -106,6 +106,38 @@ } // + // create a graph with service types + // + if (cmd.hasOption ("-t")) { + + // get all services types + v.clear(); + decorationLn ("Asking for all service types..."); + Map types = worker.getServiceTypes(); + for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String typeName = (String)entry.getKey(); + decorationLn ("Processing service type " + typeName + "..."); + MobyServiceType serviceType = new MobyServiceType (typeName); + serviceType.setDescription ((String)entry.getKey()); + serviceType.setParentNames (worker.getServiceTypeRelationships (typeName, false)); + v.addElement (serviceType); + } + decorationLn (""); + MobyServiceType[] serviceTypes = new MobyServiceType [v.size()]; + v.copyInto (serviceTypes); + decorationLn ("Creating a graph of the service types..."); + String graph = Graphviz.createServiceTypesGraph (serviceTypes, props); + param = cmd.getParam ("-ft"); + if (param == null) + param = cmd.getParam ("-f"); + if (param == null) + System.out.println (graph); + else + createFile (param, graph); + } + + // // create a graph with services // if (cmd.hasOption ("-s")) { From senger at pub.open-bio.org Tue Nov 25 08:18:11 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue Nov 25 08:19:18 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIBU5019525@pub.open-bio.org> senger Tue Nov 25 08:18:11 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv19385/src/main/org/biomoby/shared Modified Files: Central.java Utils.java Log Message: added buglist for graphs; code cleaning moby-live/Java/src/main/org/biomoby/shared Central.java,1.2,1.3 Utils.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2003/11/24 18:45:25 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2003/11/25 13:18:11 1.3 @@ -89,13 +89,16 @@ /************************************************************************** * Get all ISA relationships of the given 'serviceTypeName'. *

        - * @param serviceTypeName is an ontology term specifying whose + * @param serviceTypeName is a service type name whose * relationships should be looked at - * @return an array of ontology terms defining all parents (direct - * or indirect) of the given 'serviceTypeName' + * @param expand 'true' causes that all related type names are + * returned, 'false' means that only first-level neighbour is returned + * @return an array of service type names representing all parents + * (direct or indirect) of the given 'serviceTypeName' * @throws MobyException if communication with the Moby Registry fails *************************************************************************/ - String[] getServiceTypeRelationships (String serviceTypeName) + String[] getServiceTypeRelationships (String serviceTypeName, + boolean expand) throws MobyException; /************************************************************************** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java 2003/10/17 13:13:35 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java 2003/11/25 13:18:11 1.3 @@ -189,7 +189,7 @@ /************************************************************************* * Return just the last part of the LSID identifier. An example of - * an LSID identrifier as used by and returned from the Moby + * an LSID identifier as used by and returned from the Moby * registry is urn:lsid:biomoby.org:objectclass:object. *

        * From senger at pub.open-bio.org Tue Nov 25 08:18:11 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue Nov 25 08:19:20 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIBqA019496@pub.open-bio.org> senger Tue Nov 25 08:18:10 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv19385/src/main/org/biomoby/client Modified Files: CentralImpl.java GraphsServlet.java Graphviz.java Log Message: added buglist for graphs; code cleaning moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.5,1.6 GraphsServlet.java,1.3,1.4 Graphviz.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/24 18:45:25 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/25 13:18:10 1.6 @@ -1093,7 +1093,8 @@ * * *************************************************************************/ - public String[] getServiceTypeRelationships (String serviceTypeName) + public String[] getServiceTypeRelationships (String serviceTypeName, + boolean expand) throws MobyException { String result = (String)doCall ("Relationships", @@ -1101,7 +1102,7 @@ "" + "" + serviceTypeName + "" + "" + Central.ISA + "" + - "1" + + "" + (expand ? "1" : "0") + "" + "" }); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/09 01:52:28 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/25 13:18:10 1.4 @@ -21,7 +21,8 @@ /** - * A servlet making graphs of Moby services and Moby data types.

        + * A servlet making graphs of Moby service instances, Moby data types, + * and Moby service types.

        * * @author Martin Senger * @version $Id$ @@ -119,6 +120,7 @@ // these are filled in the static initializer static String[] supportedTypesForData; static String[] supportedTypesForServices; + static String[] supportedTypesForServiceTypes; static Hashtable contentTypes; static Hashtable displayNamesForTypes; @@ -137,6 +139,7 @@ boolean verbose = false; MobyDataType[] dataTypes; MobyService[] services; + MobyServiceType[] serviceTypes; long lastRead = -1; // in millis long refreshInterval = -1; // in millis @@ -166,6 +169,8 @@ T_PNG, T_GIF, T_JPG, T_PS, T_SVG, T_VRML, T_MIF, /* T_IMAP, T_CMAP, */ T_HPGL, T_PCL, T_FIG, T_DOT, T_CANON, T_PLAIN, T_RDF }; + supportedTypesForServiceTypes = supportedTypesForData; + displayNamesForTypes = new Hashtable(); displayNamesForTypes.put (T_PNG, "PNG - Portable Network Graphics"); displayNamesForTypes.put (T_GIF, "GIF Bitmap image"); @@ -298,8 +303,8 @@ worker.doGraphDataTypes (req, res); else if (exists (req, ACTION_JOB_SERVI)) worker.doGraphServices (req, res); -// else if (exists (req, ACTION_JOB_SERVT)) -// worker.doGraphServiceTypes (req, res); + else if (exists (req, ACTION_JOB_SERVT)) + worker.doGraphServiceTypes (req, res); else worker.doEntryPage (req, res); } @@ -543,6 +548,30 @@ h.submit (" Create Graph of Data Types ", ACTION_JOB_DATA))); out.println (h.end (BLOCKQUOTE)); + // --------------------------------------------- + out.println (h.gen (H3, "Graph of service types")); + // --------------------------------------------- + out.println (start (BLOCKQUOTE)); + + labels = null; + values = null; + synchronized (supportedTypesForServiceTypes) { + labels = new String [supportedTypesForServiceTypes.length]; + values = new String [supportedTypesForServiceTypes.length]; + for (int i = 0; i < supportedTypesForServiceTypes.length; i++) { + labels[i] = (String)displayNamesForTypes.get (supportedTypesForServiceTypes[i]); + values[i] = supportedTypesForServiceTypes[i]; + } + } + selected.clear(); + selected.put (T_PNG, "1"); + + out.println ("Select output type: "); + out.println (h.list (OUTPUT_TYPE_SERVT, labels, values, selected)); + out.println (h.gen (P, + h.submit (" Create Graph of Service Types ", ACTION_JOB_SERVT))); + out.println (h.end (BLOCKQUOTE)); + // ------------------------------------------------------------- out.println (h.gen (H3, "Additional visualization properties")); // ------------------------------------------------------------- @@ -657,39 +686,13 @@ } // create the real graphs (or an RDF representation) - String graph; if (wantedOutputType.equals (T_RDF)) { - graph = RDF.createServicesGraph (edges, props); + String graph = RDF.createServicesGraph (edges, props); cache.setContents (id, graph.getBytes()); } else { - graph = Graphviz.createServicesGraph (edges, props); - - // where is the 'dot' program - String dotProg = "dot"; - String dotPath = (String)initParams.get (DOT_PATH); - if (dotPath != null) - dotProg = dotPath + System.getProperty ("file.separator") + dotProg; - - // depending on the cache implementation we may ask - // 'dot' to produce output to its standard output, or - // to write to a file - if (cache.supportsFilenames()) { - - // note that this filename represents a not-yet-existing file - String filename = cache.getFilename (id); - - // call 'dot' to create a real graph in a 'filename' - executeDot (dotProg, graph, wantedOutputType, filename); - - } else { - - // call 'dot' to return a real graph as byte array - byte[] graphBytes = executeDot (dotProg, graph, wantedOutputType); - if (graphBytes == null || graphBytes.length == 0) - throw new MobyException ("An empty graph. Strange."); - cache.setContents (id, graphBytes); - } + createGraph (id, wantedOutputType, + Graphviz.createServicesGraph (edges, props)); } } res.sendRedirect (res.encodeRedirectURL (cache.getURL (id))); @@ -737,34 +740,56 @@ if (! cache.exists (id)) { // create a dot definition of the graph log ("Creating a graph of the data types...\n"); - String dotGraph = Graphviz.createDataTypesGraph (dataTypes, props); - - - // where is the 'dot' program - String dotProg = "dot"; - String dotPath = (String)initParams.get (DOT_PATH); - if (dotPath != null) - dotProg = dotPath + System.getProperty ("file.separator") + dotProg; - - // depending on the cache implementation we may ask - // 'dot' to produce output to its standard output, or - // to write to a file - if (cache.supportsFilenames()) { + createGraph (id, wantedOutputType, + Graphviz.createDataTypesGraph (dataTypes, props)); + } + res.sendRedirect (res.encodeRedirectURL (cache.getURL (id))); + + } catch (MobyException e) { + error (res, res.SC_SERVICE_UNAVAILABLE, e); + return; + } + } - // note that this filename represents a not-yet-existing file - String filename = cache.getFilename (id); + /************************************************************************* + * Create and return a graph of Moby service types. + *************************************************************************/ + protected void doGraphServiceTypes (HttpServletRequest req, HttpServletResponse res) + throws ServletException, IOException { - // call 'dot' to create a real graph in a 'filename' - executeDot (dotProg, dotGraph, wantedOutputType, filename); + // check if the output type is supported + String wantedOutputType = getString (req, OUTPUT_TYPE_SERVT); + if (wantedOutputType == null) + wantedOutputType = T_PNG; + boolean supported = false; + for (int i = 0; i < supportedTypesForServiceTypes.length; i++) { + if (supportedTypesForServiceTypes[i].equals (wantedOutputType)) { + supported = true; + break; + } + } + if (! supported) { + error (res, res.SC_SERVICE_UNAVAILABLE, + new MobyException ("Unrecognized output type '" + wantedOutputType + "'.")); + return; + } - } else { + // collect visualization properties + Properties props = new Properties(); + String rankdir = getString (req, RANKDIR); + if (rankdir != null) + props.put (Graphviz.PROP_RANKDIR, rankdir); - // call 'dot' to return a real graph as byte array - byte[] graph = executeDot (dotProg, dotGraph, wantedOutputType); - if (graph == null || graph.length == 0) - throw new MobyException ("An empty graph. Strange."); - cache.setContents (id, graph); - } + try { + // perhaps we have the same graph in the cache already + props.entrySet().toArray(); + String id = cache.createId (endpoint, GRAPH_SERVT, + wantedOutputType, lastRead, props); + if (! cache.exists (id)) { + // create a dot definition of the graph + log ("Creating a graph of the services types...\n"); + createGraph (id, wantedOutputType, + Graphviz.createServiceTypesGraph (serviceTypes, props)); } res.sendRedirect (res.encodeRedirectURL (cache.getURL (id))); @@ -777,9 +802,44 @@ /******************************************************************** * ********************************************************************/ + protected void createGraph (String id, + String wantedOutputType, + String graph) + throws MobyException, IOException { + + // where is the 'dot' program + String dotProg = "dot"; + String dotPath = (String)initParams.get (DOT_PATH); + if (! UUtils.isEmpty (dotPath)) + dotProg = dotPath + System.getProperty ("file.separator") + dotProg; + + // depending on the cache implementation we may ask + // 'dot' to produce output to its standard output, or + // to write to a file + if (cache.supportsFilenames()) { + + // note that this filename represents a not-yet-existing file + String filename = cache.getFilename (id); + + // call 'dot' to create a real graph in a 'filename' + executeDot (dotProg, graph, wantedOutputType, filename); + + } else { + + // call 'dot' to return a real graph as byte array + byte[] graphBytes = executeDot (dotProg, graph, wantedOutputType); + if (graphBytes == null || graphBytes.length == 0) + throw new MobyException ("An empty graph. Strange."); + cache.setContents (id, graphBytes); + } + } + + /******************************************************************** + * + ********************************************************************/ protected void readRegistryIfNeeded() throws MobyException { - if (dataTypes == null || services == null) { + if (dataTypes == null || services == null || serviceTypes == null) { readRegistry(); return; } @@ -827,6 +887,22 @@ dataTypes = new MobyDataType [v.size()]; v.copyInto (dataTypes); + // read all services types and their relationships + v.clear(); + log ("Asking for all service types...\n"); + types = registry.getServiceTypes(); + for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String typeName = (String)entry.getKey(); + log ("Processing service type " + typeName + "...\n"); + MobyServiceType serviceType = new MobyServiceType (typeName); + serviceType.setDescription ((String)entry.getKey()); + serviceType.setParentNames (registry.getServiceTypeRelationships (typeName, false)); + v.addElement (serviceType); + } + serviceTypes = new MobyServiceType [v.size()]; + v.copyInto (serviceTypes); + // read all services v.clear(); log ("Asking for all service names...\n"); @@ -1024,7 +1100,7 @@ h.gen (HR) + h.gen (DIV, ALIGN, "right", h.gen (FONT, SIZE, "-2", h.gen (ADDRESS, contact) + - "Last modified: " + UUtils.formatDate())); + "Page created: " + UUtils.formatDate())); } /************************************************************************* =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/Graphviz.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/Graphviz.java 2003/10/17 13:13:34 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/Graphviz.java 2003/11/25 13:18:10 1.2 @@ -157,6 +157,44 @@ } /************************************************************************* + * Creates a graph connecting 'serviceTypes' using their ISA + * relationship.

        + * + * @param servicesTypes represent nodes in the created graph + * @param props are some properties that can influence how the + * graph will look like; see the property names elswhere in this + * API what properties are understood + * + * @return a string with all definitions as understood by 'dot' + * program (from the graphviz package); this string can be saved + * in a '.dot' file that can be passed to a dot program to produce + * graphs in many available formats + * + *************************************************************************/ + static public String createServiceTypesGraph (MobyServiceType[] serviceTypes, + Properties props) { + + StringBuffer buf = new StringBuffer(); + buf.append ("digraph MobyServicesTypes {\n"); + buf.append ("\trankdir=" + props.getProperty (PROP_RANKDIR, "LR") + ";\n"); + buf.append ("\tedge [dir=back,arrowtail=empty];\n"); + for (int t = 0; t < serviceTypes.length; t++) { + MobyServiceType type = serviceTypes[t]; + String name = Utils.pureName (type.getName()); + String[] parents = type.getParentNames(); + for (int i = 0; i < parents.length; i++) { + buf.append ("\t"); + buf.append (trName (Utils.pureName (parents[i])).toLowerCase()); + buf.append (" -> "); + buf.append (trName (name).toLowerCase()); + buf.append (";\n"); + } + } + buf.append ("}\n"); + return new String (buf); + } + + /************************************************************************* * Append 'value' to 'buf'. If it is not the first value there, it * prefix it by a comma. *************************************************************************/ From senger at pub.open-bio.org Tue Nov 25 08:18:10 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue Nov 25 08:19:21 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIAXI019423@pub.open-bio.org> senger Tue Nov 25 08:18:10 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs In directory pub.open-bio.org:/tmp/cvs-serv19385/docs/graphs Modified Files: index.html Added Files: buglist.html Log Message: added buglist for graphs; code cleaning moby-live/Java/docs/graphs buglist.html,NONE,1.1 index.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/graphs/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/docs/graphs/index.html 2003/11/09 01:05:02 1.2 +++ /home/repository/moby/moby-live/Java/docs/graphs/index.html 2003/11/25 13:18:10 1.3 @@ -76,7 +76,7 @@

        The main features

          -
        • graphs of data types and service instances +
        • graphs of data types, service instances, and service types
        • selection on variety of output types (including common image formats, but also scalable vector graphics and RDF)
        • possibility to display only some services and some authorities, or to decide @@ -113,8 +113,10 @@
        • Add an option to "show only" or "do not show at all" the orphan services.
        • Add a better support for saving graphs into local files. -
        • Graphs of the service types - this can be done after BioMoby - registry makes this information accessible in its API. +
        • Add a graph showing pathes from input data-type to output data-type. +

          + +

        • And there is a Bug List to work on...

        @@ -126,7 +128,7 @@

        Suggestions, comments, and bug reports to:
        Martin Senger
        -Last modified: Sun Nov 9 00:21:16 2003 +Last modified: Tue Nov 25 12:56:31 2003
        From senger at pub.open-bio.org Tue Nov 25 08:18:10 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue Nov 25 10:03:50 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIAU3019404@pub.open-bio.org> senger Tue Nov 25 08:18:10 EST 2003 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv19385/docs Modified Files: ChangeLog Log Message: added buglist for graphs; code cleaning moby-live/Java/docs ChangeLog,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/24 18:45:25 1.7 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/25 13:18:10 1.8 @@ -1,5 +1,7 @@ 2003-11-24 Martin Senger + * Added graphs of service types. + * Added several new methods to Central.java dealing with relationships. Consequently MobyCmdLineClient got few new options. From senger at pub.open-bio.org Tue Nov 25 08:18:10 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue Nov 25 10:03:52 2003 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIAQU019467@pub.open-bio.org> senger Tue Nov 25 08:18:10 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv19385/src/Clients/help Modified Files: MobyGraphs_usage.txt Log Message: added buglist for graphs; code cleaning moby-live/Java/src/Clients/help MobyGraphs_usage.txt,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2003/11/08 00:27:24 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2003/11/25 13:18:10 1.3 @@ -5,8 +5,8 @@ -q ... quiet mode -d ... graph showing data types - -s ... graph showing services - -t ... reserved: for the graph of service types + -s ... graph showing service instances + -t ... graph showing service types output format: -dot ... (this is default) @@ -26,10 +26,12 @@ (makes sense only together with -d) -fs ... where to put the services graph (makes sense only together with -s) + -ft ... where to put the service types graph + (makes sense only together with -t) -f ... where to put (any) created graph - (makes sense only together with -d or -s, - but does not make sense if both -d and -s - are used) + (makes sense only together with -d, -s, + or -t, but does not make sense if two + or even all three of them are used) default: standard output graph properties: From f31dnvt at yahoo.com Wed Nov 26 02:37:56 2003 From: f31dnvt at yahoo.com (Queen Mccoy) Date: Tue Nov 25 11:35:33 2003 Subject: [MOBY-guts] re: FRee P-E-N-l-S PlLLZ WOW!! vo Message-ID: An HTML attachment was scrubbed... URL: http://portal.open-bio.org/pipermail/moby-guts/attachments/20031126/a3807d8f/attachment.htm From cherburtner at lauvabrum.hasmoved.com Tue Nov 4 10:59:34 2003 From: cherburtner at lauvabrum.hasmoved.com (Female Update) Date: Tue, 04 Nov 2003 14:59:34 -0100 Subject: [MOBY-guts] L|ps SO Plump - your friends will be envious! Message-ID: An HTML attachment was scrubbed... URL: http://biomoby.org/pipermail/moby-guts/attachments/20031104/dcbd6e93/attachment.html From sixtadenby at prorsus.prospectivebuyers.com Tue Nov 11 06:11:32 2003 From: sixtadenby at prorsus.prospectivebuyers.com (Beauty Secret) Date: Tue, 11 Nov 2003 04:11:32 -0700 Subject: [MOBY-guts] Get Plumper & Sexier L|ps Message-ID: An HTML attachment was scrubbed... URL: http://biomoby.org/pipermail/moby-guts/attachments/20031111/da65fcc0/attachment.html From senger at pub.open-bio.org Sat Nov 8 20:05:02 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Sat, 8 Nov 2003 20:05:02 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311090105.hA9152W9021554@pub.open-bio.org> senger Sat Nov 8 20:05:02 EST 2003 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv21510/docs Modified Files: ChangeLog Log Message: moby-live/Java/docs ChangeLog,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/08 00:27:24 1.4 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/09 01:05:02 1.5 @@ -1,3 +1,7 @@ +2003-11-09 Martin Senger + + * Added servlet properties for HTTP proxies and path to 'dot'. + 2003-11-07 Martin Senger * Added BioMoby Graphs (command-line client and a servlet-based From senger at pub.open-bio.org Sat Nov 8 20:52:28 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Sat, 8 Nov 2003 20:52:28 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311090152.hA91qSQj021795@pub.open-bio.org> senger Sat Nov 8 20:52:28 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv21776/src/main/org/biomoby/client Modified Files: GraphsServlet.java Log Message: moby-live/Java/src/main/org/biomoby/client GraphsServlet.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/09 01:05:02 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/09 01:52:28 1.3 @@ -667,9 +667,9 @@ // where is the 'dot' program String dotProg = "dot"; - String dotPath = getString (req, DOT_PATH); + String dotPath = (String)initParams.get (DOT_PATH); if (dotPath != null) - dotProg = dotPath + System.getProperty ("file.sparator") + dotProg; + dotProg = dotPath + System.getProperty ("file.separator") + dotProg; // depending on the cache implementation we may ask // 'dot' to produce output to its standard output, or @@ -742,9 +742,9 @@ // where is the 'dot' program String dotProg = "dot"; - String dotPath = getString (req, DOT_PATH); + String dotPath = (String)initParams.get (DOT_PATH); if (dotPath != null) - dotProg = dotPath + System.getProperty ("file.sparator") + dotProg; + dotProg = dotPath + System.getProperty ("file.separator") + dotProg; // depending on the cache implementation we may ask // 'dot' to produce output to its standard output, or From senger at pub.open-bio.org Fri Nov 7 19:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:27:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROes017330@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv17161/src/Clients/help Modified Files: MobyGraphs_usage.txt Log Message: added graphs for exploring biomoby registry moby-live/Java/src/Clients/help MobyGraphs_usage.txt,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2003/10/17 13:13:34 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2003/11/08 00:27:24 1.2 @@ -1,15 +1,27 @@ Usage: java MobyGraphs -h[elp] - java MobyGraphs [] + java MobyGraphs -q ... quiet mode - -debug ... print debug messages -d ... graph showing data types -s ... graph showing services -t ... reserved: for the graph of service types - outputs: + output format: + -dot ... (this is default) + -rdf ... (this works only for graph of services) + + output filter (what to be included, + only used for services): + -auth + -name + -depth ... an integer, how far to go from + given services (default is 1) + or + -path + + output destinations: -fd ... where to put the data types graph (makes sense only together with -d) -fs ... where to put the services graph From mwilkinson at pub.open-bio.org Wed Nov 12 11:08:52 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 11:08:52 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121608.hACG8qhe011391@pub.open-bio.org> mwilkinson Wed Nov 12 11:08:52 EST 2003 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv11376 Added Files: debug_a_service.pl Log Message: added a simple service debugging script moby-live/Perl/scripts debug_a_service.pl,NONE,1.1 From mwilkinson at pub.open-bio.org Wed Nov 12 11:12:47 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 11:12:47 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121612.hACGCl3K011506@pub.open-bio.org> mwilkinson Wed Nov 12 11:12:47 EST 2003 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv11491 Added Files: debugYourService Log Message: oops. Forgot to set the executable flag. Have to rename the file to get CVS to accept this kind of change moby-live/Perl/scripts debugYourService,NONE,1.1 From senger at pub.open-bio.org Sat Nov 8 20:05:02 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Sat, 8 Nov 2003 20:05:02 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311090105.hA9152Df021535@pub.open-bio.org> senger Sat Nov 8 20:05:02 EST 2003 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv21510 Modified Files: build.properties.template build.xml Log Message: moby-live/Java build.properties.template,1.1,1.2 build.xml,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.properties.template,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/build.properties.template 2003/11/08 00:27:23 1.1 +++ /home/repository/moby/moby-live/Java/build.properties.template 2003/11/09 01:05:02 1.2 @@ -7,6 +7,11 @@ build.compiler = jikes +#dot.path = /path/to/dot +#proxySet = true +#http.proxyHost = your proxy host +#http.proxyPort = your proxy port + # all other properties are used only if you wish to deploy jMoby # servlets into your Tomcat - the more verbose description of these # properties is in the deployment descriptor in =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/build.xml 2003/11/08 21:05:51 1.5 +++ /home/repository/moby/moby-live/Java/build.xml 2003/11/09 01:05:02 1.6 @@ -196,6 +196,18 @@ + + + + + + + + + + + + @@ -380,6 +392,10 @@ + + + + senger Sat Nov 8 20:05:02 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs In directory pub.open-bio.org:/tmp/cvs-serv21510/docs/graphs Modified Files: index.html Log Message: moby-live/Java/docs/graphs index.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/graphs/index.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/graphs/index.html 2003/11/08 00:27:24 1.1 +++ /home/repository/moby/moby-live/Java/docs/graphs/index.html 2003/11/09 01:05:02 1.2 @@ -27,7 +27,7 @@ The BioMoby Graphs are available:
          -
        • As an experimental +
        • As an experimental interactive service (implemented as a Java servlet).

        • The graphs can be also created from the command-line provided that @@ -49,7 +49,7 @@ Click on the thumbnail to see a graph of data types (notice that this is not a current graph - -for the current data go to the interactive service). +for the current data go to the interactive service).

          @@ -126,7 +126,7 @@

          Suggestions, comments, and bug reports to:
          Martin Senger
          -Last modified: Fri Nov 7 22:37:27 2003 +Last modified: Sun Nov 9 00:21:16 2003
          From senger at pub.open-bio.org Sat Nov 8 20:05:03 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Sat, 8 Nov 2003 20:05:03 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311090105.hA91533e021596@pub.open-bio.org> senger Sat Nov 8 20:05:02 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv21510/src/main/org/biomoby/client Modified Files: FileCache.java GraphsServlet.java Log Message: moby-live/Java/src/main/org/biomoby/client FileCache.java,1.1,1.2 GraphsServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/FileCache.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/FileCache.java 2003/11/08 00:27:24 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/FileCache.java 2003/11/09 01:05:02 1.2 @@ -128,7 +128,7 @@ parent.mkdirs(); if (parent.exists()) return filename; - throw new IOException ("Cannot create all needed directories."); + throw new IOException ("Cannot create all needed directories: '" + parent.toString() + "'."); } /************************************************************************** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/08 00:27:24 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/09 01:05:02 1.2 @@ -41,6 +41,10 @@ static final protected String CACHE_URL = "cache_url"; static final protected String DEFAULT_ENDPOINT = "default_endpoint"; static final protected String DEFAULT_NAMESPACE = "default_namespace"; + static final protected String PROXY_SET = "proxySet"; + static final protected String PROXY_PORT = "http.proxyPort"; + static final protected String PROXY_HOST = "http.proxyHost"; + static final protected String DOT_PATH = "dot_path"; // expected/known form's element names static final protected String VERBOSE = "verbose"; @@ -214,6 +218,19 @@ defaultNamespace = (String)initParams.get (DEFAULT_NAMESPACE); if (UUtils.isEmpty (defaultNamespace)) defaultNamespace = CentralImpl.DEFAULT_NAMESPACE; + + // set HTTP proxy - this is probably useless because (I guess) + // the proxy can be set in the Tomcat configuration file (and + // not to let each servlet to do it) - but it's here, anyway + String proxySet = (String)initParams.get (PROXY_SET); + if (! UUtils.isEmpty (proxySet)) + System.setProperty (PROXY_SET, proxySet); + String proxyPort = (String)initParams.get (PROXY_PORT); + if (! UUtils.isEmpty (proxyPort)) + System.setProperty (PROXY_PORT, proxyPort); + String proxyHost = (String)initParams.get (PROXY_HOST); + if (! UUtils.isEmpty (proxyHost)) + System.setProperty (PROXY_HOST, proxyHost); } /************************************************************************* @@ -648,6 +665,12 @@ } else { graph = Graphviz.createServicesGraph (edges, props); + // where is the 'dot' program + String dotProg = "dot"; + String dotPath = getString (req, DOT_PATH); + if (dotPath != null) + dotProg = dotPath + System.getProperty ("file.sparator") + dotProg; + // depending on the cache implementation we may ask // 'dot' to produce output to its standard output, or // to write to a file @@ -657,12 +680,12 @@ String filename = cache.getFilename (id); // call 'dot' to create a real graph in a 'filename' - executeDot (graph, wantedOutputType, filename); + executeDot (dotProg, graph, wantedOutputType, filename); } else { // call 'dot' to return a real graph as byte array - byte[] graphBytes = executeDot (graph, wantedOutputType); + byte[] graphBytes = executeDot (dotProg, graph, wantedOutputType); if (graphBytes == null || graphBytes.length == 0) throw new MobyException ("An empty graph. Strange."); cache.setContents (id, graphBytes); @@ -716,6 +739,13 @@ log ("Creating a graph of the data types...\n"); String dotGraph = Graphviz.createDataTypesGraph (dataTypes, props); + + // where is the 'dot' program + String dotProg = "dot"; + String dotPath = getString (req, DOT_PATH); + if (dotPath != null) + dotProg = dotPath + System.getProperty ("file.sparator") + dotProg; + // depending on the cache implementation we may ask // 'dot' to produce output to its standard output, or // to write to a file @@ -725,12 +755,12 @@ String filename = cache.getFilename (id); // call 'dot' to create a real graph in a 'filename' - executeDot (dotGraph, wantedOutputType, filename); + executeDot (dotProg, dotGraph, wantedOutputType, filename); } else { // call 'dot' to return a real graph as byte array - byte[] graph = executeDot (dotGraph, wantedOutputType); + byte[] graph = executeDot (dotProg, dotGraph, wantedOutputType); if (graph == null || graph.length == 0) throw new MobyException ("An empty graph. Strange."); cache.setContents (id, graph); @@ -821,17 +851,18 @@ } /******************************************************************** - * Execute 'dot' program with the given graph description in + * Execute 'dotProg' program with the given graph description in * 'dotGraph' in order to create a graph in 'outputType' * format. The graph is created in the given file 'filename'. ********************************************************************/ - protected void executeDot (String dotGraph, String outputType, String filename) + protected void executeDot (String dotProg, String dotGraph, + String outputType, String filename) throws MobyException { if (outputType.equals ("txt")) outputType = "plain-ext"; - String[] cmdLine = new String[] { "dot", "-T" + outputType, "-o" + filename }; + String[] cmdLine = new String[] { dotProg, "-T" + outputType, "-o" + filename }; String[] envArr = new String[] {}; // no environment try { // start an external process @@ -852,17 +883,17 @@ } /******************************************************************** - * Execute 'dot' program with the given graph description in + * Execute 'dotProg' program with the given graph description in * 'dotGraph' in order to create a graph in 'outputType' * format. The created graph is returned back as a byte array. ********************************************************************/ - protected byte[] executeDot (String dotGraph, String outputType) + protected byte[] executeDot (String dotProg, String dotGraph, String outputType) throws MobyException { if (outputType.equals ("txt")) outputType = "plain-ext"; - String[] cmdLine = new String[] { "dot", "-T" + outputType }; + String[] cmdLine = new String[] { dotProg, "-T" + outputType }; String[] envArr = new String[] {}; // no environment try { // start an external process From senger at pub.open-bio.org Sat Nov 8 20:05:03 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Sat, 8 Nov 2003 20:05:03 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311090105.hA91533F021615@pub.open-bio.org> senger Sat Nov 8 20:05:02 EST 2003 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv21510/src/webapps Modified Files: web.xml.template Log Message: moby-live/Java/src/webapps web.xml.template,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/webapps/web.xml.template,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/webapps/web.xml.template 2003/11/08 00:36:18 1.1 +++ /home/repository/moby/moby-live/Java/src/webapps/web.xml.template 2003/11/09 01:05:02 1.2 @@ -43,6 +43,7 @@ both the appeareance and the contents of these graphs. org.biomoby.client.GraphsServlet + refresh_interval @REFRESH_INTERVAL@ @@ -51,6 +52,7 @@ from the BioMoby registry - in minutes. An integer. + cache_dir @CACHE_DIR@ @@ -62,6 +64,7 @@ 'cache_url' parameter. + cache_url @CACHE_URL@ @@ -71,6 +74,7 @@ where 'cache_dir' (yet another parameter) ends. + default_endpoint @DEFAULT_ENDPOINT@ @@ -80,6 +84,7 @@ default an official BioMoby site in Canada. + default_namespace @DEFAULT_NAMESPACE@ @@ -90,6 +95,42 @@ registry in Canada). + + + dot_path + @DOT_PATH@ + + A full path to the 'dot' program (excluding the 'dot' itself + and the ending slash). Use this only if the 'dot' program + is not on the PATH used by Tomcat. + + + + + proxySet + @PROXY_SET@ + + Set to 'true' if your Tomcat needs to find an HTTP proxy + server, and if it does not have it set in its own configuration. + + + + + http.proxyHost + @PROXY_HOST@ + + The HTTP proxy hostname. + + + + + http.proxyPort + @PROXY_PORT@ + + The HTTP proxy port number. + + + - - - - + + + + + + + + + + + + + + @@ -25,16 +36,19 @@ - - - - - + + + + + + + + @@ -63,6 +77,8 @@ + + @@ -96,6 +112,9 @@ + + + @@ -115,6 +134,7 @@ + @@ -134,15 +154,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + description="Compile all source code (default)."> Missing one or more third-party libraries. Try to run build.sh or build.bat to fetch them from the net. @@ -157,6 +218,11 @@ excludes="${project.excludes}"> + + + @@ -165,7 +231,7 @@ - + + @@ -210,10 +277,11 @@ + description="Create a jar file with jMoby classes."> + @@ -223,8 +291,8 @@ - + @@ -237,10 +305,10 @@ - + - + @@ -262,12 +330,86 @@ + - + - + + + + + + + + + + + + + + Tomcat Catalina not found. + Please set environment variable CATALINA_HOME to point to it, or + create a file 'build.properties' and put there the line: + catalina.home = <location of your CATALINA> + (do not include '<' and '>' there) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -278,3 +420,4 @@ + From senger at pub.open-bio.org Fri Nov 7 19:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:27:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROMX017243@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/dist In directory pub.open-bio.org:/tmp/cvs-serv17161/docs/dist Modified Files: .cvsignore.template Added Files: _README_ Log Message: added graphs for exploring biomoby registry moby-live/Java/docs/dist _README_,NONE,1.1 .cvsignore.template,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/dist/.cvsignore.template,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/dist/.cvsignore.template 2003/09/25 02:10:27 1.1 +++ /home/repository/moby/moby-live/Java/docs/dist/.cvsignore.template 2003/11/08 00:27:24 1.2 @@ -3,3 +3,4 @@ *.zip *.tar.gz *.tgz +*.war From senger at pub.open-bio.org Fri Nov 7 19:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:27:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROiI017258@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs In directory pub.open-bio.org:/tmp/cvs-serv17161/docs/graphs Added Files: index.html Log Message: added graphs for exploring biomoby registry moby-live/Java/docs/graphs index.html,NONE,1.1 From senger at pub.open-bio.org Fri Nov 7 19:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:27:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROXc017273@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs/images In directory pub.open-bio.org:/tmp/cvs-serv17161/docs/graphs/images Added Files: example-data-types-small.jpg example-data-types.png example-services-small.jpg example-services.png legend.dot legend.png logo.png Log Message: added graphs for exploring biomoby registry moby-live/Java/docs/graphs/images example-data-types-small.jpg,NONE,1.1 example-data-types.png,NONE,1.1 example-services-small.jpg,NONE,1.1 example-services.png,NONE,1.1 legend.dot,NONE,1.1 legend.png,NONE,1.1 logo.png,NONE,1.1 From senger at pub.open-bio.org Fri Nov 7 19:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:27:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROKN017311@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv17161/src/Clients Modified Files: MobyGraphs.java Added Files: EchoClient.java EchoClient2.java Log Message: added graphs for exploring biomoby registry moby-live/Java/src/Clients EchoClient.java,NONE,1.1 EchoClient2.java,NONE,1.1 MobyGraphs.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2003/10/17 13:13:34 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2003/11/08 00:27:24 1.2 @@ -50,7 +50,7 @@ BaseCmdLine cmd = new BaseCmdLine (args, true); if (cmd.hasParam ("-help") || cmd.hasParam ("-h")) { - System.out.print (MobyCmdLineClient.getUsage()); + System.out.print (MobyGraphs.getUsage()); System.exit (0); } @@ -127,10 +127,41 @@ services = new MobyService [v.size()]; v.copyInto (services); - // create a graph + // create a set of graph edges decorationLn ("Creating a graph of the services..."); ServicesEdge[] edges = ServiceConnections.build (dataTypes, services); - String graph = Graphviz.createServicesGraph (edges, props); + + // filter edges + String[] authorities = null; + String[] serviceNames = null; + int depth = 1; + if ((param = cmd.getParam ("-auth")) != null ) + authorities = StringUtils.split (param, ","); + if ((param = cmd.getParam ("-name")) != null ) + serviceNames = StringUtils.split (param, ","); + param = cmd.getParam ("-depth"); + if (param != null) { + try { + depth = Integer.valueOf (param).intValue(); + } catch (java.lang.NumberFormatException e) {} + } + edges = FilterServices.filter (edges, authorities, serviceNames, depth); + + String[] pathEnds = cmd.getParam ("-path", 2); + if (pathEnds.length == 2) + edges = FilterServices.pathes (edges, pathEnds[0], pathEnds[1]); + if (edges == null) { + System.err.println ("No connection found between '" + + pathEnds[0] + "' and '" + pathEnds[1] + "'"); + System.exit(1); + } + + // create a graph (in whatever format) + String graph; + if (cmd.hasOption ("-rdf")) + graph = RDF.createServicesGraph (edges, props); + else + graph = Graphviz.createServicesGraph (edges, props); // output the graph param = cmd.getParam ("-fs"); From senger at pub.open-bio.org Fri Nov 7 19:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:27:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROWx017292@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/lib In directory pub.open-bio.org:/tmp/cvs-serv17161/lib Modified Files: README Log Message: added graphs for exploring biomoby registry moby-live/Java/lib README,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/README,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/lib/README 2003/09/24 12:33:48 1.3 +++ /home/repository/moby/moby-live/Java/lib/README 2003/11/08 00:27:24 1.4 @@ -39,6 +39,11 @@ wsdl4j.jar, axis.jar, log4j-1.2.4.jar, saaj.jar. Libraries from the Apache Axis project (a toolkit for the SOAP protocol). -* servlet.jar, activation.jar. +* servlet.jar, activation.jar Libraries dealing with servlets. They come from Apache Tomcat project. +* jena.jar, adenine.jar + Libraries from 'haystack' (IBM) for producing RDF files. + They can be fetched from here: + http://www.ai.mit.edu/people/dquan/adenine.jar + http://www.ai.mit.edu/people/dquan/jena.jar From senger at pub.open-bio.org Fri Nov 7 19:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:27:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80RO72017353@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv17161/src/main/org/biomoby/client Modified Files: CentralImpl.java ServicesEdge.java Added Files: FileCache.java FilterServices.java GraphsServlet.java RDF.java ServletFileCache.java SimpleCache.java Log Message: added graphs for exploring biomoby registry moby-live/Java/src/main/org/biomoby/client FileCache.java,NONE,1.1 FilterServices.java,NONE,1.1 GraphsServlet.java,NONE,1.1 RDF.java,NONE,1.1 ServletFileCache.java,NONE,1.1 SimpleCache.java,NONE,1.1 CentralImpl.java,1.2,1.3 ServicesEdge.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/10/17 13:13:34 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/08 00:27:24 1.3 @@ -625,7 +625,7 @@ /************************************************************************** * The 'retrieveObjectDefinition' method returns something like this; * - * + * * urn:lsid:biomoby.org:objectclass:go_term * * http://www.illuminae.com @@ -637,7 +637,7 @@ * urn:lsid:biomoby.org:objectclass:string * urn:lsid:biomoby.org:objectclass:string * - * + * * *************************************************************************/ public MobyDataType getDataType (String dataTypeName) @@ -652,7 +652,7 @@ // parse returned XML Document document = parser.parse (new StringReader (result)); - NodeList list = document.getElementsByTagName ("registerObjectClass"); + NodeList list = document.getElementsByTagName ("retrieveObjectDefinition"); if (list == null || list.getLength() == 0) throw new NoSuccessException ("Data Type name was not founnd.", dataTypeName); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServicesEdge.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServicesEdge.java 2003/10/17 13:13:34 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServicesEdge.java 2003/11/08 00:27:24 1.2 @@ -89,6 +89,26 @@ } /************************************************************************* + * Retrieves the source service. + * + * @return the source service + * + *************************************************************************/ + public MobyService getSourceService() { + return sourceService; + } + + /************************************************************************* + * Retrieves the target service. + * + * @return the target service + * + *************************************************************************/ + public MobyService getTargetService() { + return targetService; + } + + /************************************************************************* * Sets connector. * * @param connector is a string representing namespace and data From senger at pub.open-bio.org Fri Nov 7 19:27:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:27:25 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80RPtR017372@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/src/support In directory pub.open-bio.org:/tmp/cvs-serv17161/src/support Modified Files: README Added Files: run-any-client run-any-client.bat run-graphs-client run-graphs-client.bat Log Message: added graphs for exploring biomoby registry moby-live/Java/src/support run-any-client,NONE,1.1 run-any-client.bat,NONE,1.1 run-graphs-client,NONE,1.1 run-graphs-client.bat,NONE,1.1 README,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/support/README,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/support/README 2003/09/25 10:49:09 1.2 +++ /home/repository/moby/moby-live/Java/src/support/README 2003/11/08 00:27:24 1.3 @@ -10,6 +10,7 @@ sh ./run-cmdline-client -help sh ./run-testing-central + sh ./run-graphs-client -help Or, on Unix platforms, use chmod to make the scripts above executable and call them without 'sh' (note that this small inconvenience is due From senger at pub.open-bio.org Fri Nov 7 19:28:44 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:28:44 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080028.hA80SiSl017413@pub.open-bio.org> senger Fri Nov 7 19:28:44 EST 2003 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv17395/webapps Log Message: Directory /home/repository/moby/moby-live/Java/src/webapps added to the repository moby-live/Java/src/webapps - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/webapps/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/webapps/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/webapps/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Nov 7 19:31:36 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:31:36 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080031.hA80Vavo017459@pub.open-bio.org> senger Fri Nov 7 19:31:36 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services In directory pub.open-bio.org:/tmp/cvs-serv17441/Services Log Message: Directory /home/repository/moby/moby-live/Java/src/Services added to the repository moby-live/Java/src/Services - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Nov 7 19:33:03 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:33:03 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080033.hA80X3g1017542@pub.open-bio.org> senger Fri Nov 7 19:33:02 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org/biomoby In directory pub.open-bio.org:/tmp/cvs-serv17524/Services/org/biomoby Log Message: Directory /home/repository/moby/moby-live/Java/src/Services/org/biomoby added to the repository moby-live/Java/src/Services/org/biomoby - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Nov 7 19:32:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:32:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080032.hA80WOe0017500@pub.open-bio.org> senger Fri Nov 7 19:32:24 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org In directory pub.open-bio.org:/tmp/cvs-serv17482/Services/org Log Message: Directory /home/repository/moby/moby-live/Java/src/Services/org added to the repository moby-live/Java/src/Services/org - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Nov 7 19:33:49 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:33:49 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080033.hA80XnZO017583@pub.open-bio.org> senger Fri Nov 7 19:33:48 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service In directory pub.open-bio.org:/tmp/cvs-serv17565/Services/org/biomoby/service Log Message: Directory /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service added to the repository moby-live/Java/src/Services/org/biomoby/service - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Nov 7 19:36:18 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:36:18 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080036.hA80aImp017646@pub.open-bio.org> senger Fri Nov 7 19:36:18 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service In directory pub.open-bio.org:/tmp/cvs-serv17631/src/Services/org/biomoby/service Added Files: Echo.java EchoImpl.java EchoImplFromStubs.java README Log Message: added graphs for exploring biomoby registry moby-live/Java/src/Services/org/biomoby/service Echo.java,NONE,1.1 EchoImpl.java,NONE,1.1 EchoImplFromStubs.java,NONE,1.1 README,NONE,1.1 From senger at pub.open-bio.org Fri Nov 7 19:36:18 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:36:18 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080036.hA80aIGL017661@pub.open-bio.org> senger Fri Nov 7 19:36:18 EST 2003 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv17631/src/webapps Added Files: web.xml.template Log Message: added graphs for exploring biomoby registry moby-live/Java/src/webapps web.xml.template,NONE,1.1 From senger at pub.open-bio.org Fri Nov 7 19:49:07 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:49:07 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080049.hA80n79q017906@pub.open-bio.org> senger Fri Nov 7 19:49:06 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated In directory pub.open-bio.org:/tmp/cvs-serv17891/src/Services/org/biomoby/service/generated Added Files: Echo.java EchoService.java EchoServiceLocator.java EchoStringSoapBindingImpl.java EchoStringSoapBindingStub.java deploy.wsdd undeploy.wsdd Log Message: starting to play with services moby-live/Java/src/Services/org/biomoby/service/generated Echo.java,NONE,1.1 EchoService.java,NONE,1.1 EchoServiceLocator.java,NONE,1.1 EchoStringSoapBindingImpl.java,NONE,1.1 EchoStringSoapBindingStub.java,NONE,1.1 deploy.wsdd,NONE,1.1 undeploy.wsdd,NONE,1.1 From senger at pub.open-bio.org Fri Nov 7 18:14:34 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 18:14:34 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311072314.hA7NEYck016951@pub.open-bio.org> senger Fri Nov 7 18:14:34 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs In directory pub.open-bio.org:/tmp/cvs-serv16933/graphs Log Message: Directory /home/repository/moby/moby-live/Java/docs/graphs added to the repository moby-live/Java/docs/graphs - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Nov 7 18:15:22 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 18:15:22 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311072315.hA7NFMdE016995@pub.open-bio.org> senger Fri Nov 7 18:15:22 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs/images In directory pub.open-bio.org:/tmp/cvs-serv16977/graphs/images Log Message: Directory /home/repository/moby/moby-live/Java/docs/graphs/images added to the repository moby-live/Java/docs/graphs/images - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/images/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/images/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/images/RCS/directory,v: No such file or directory From mwilkinson at pub.open-bio.org Wed Nov 12 12:31:43 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 12:31:43 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121731.hACHVhWO012380@pub.open-bio.org> mwilkinson Wed Nov 12 12:31:43 EST 2003 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv12338/t Modified Files: Client-Central.t Log Message: Yay! We have a Makefile and test suite again! This is more simple than the one that Richard was working on at the Singapore hackathon (his was able to actually install and test local services), but this will at least install the modules and test the basic functionality of MOBY::Client::Central moby-live/Perl/t Client-Central.t,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Central.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/t/Client-Central.t 2003/02/19 21:23:16 1.1 +++ /home/repository/moby/moby-live/Perl/t/Client-Central.t 2003/11/12 17:31:42 1.2 @@ -5,187 +5,249 @@ # change 'tests => 1' to 'tests => last_test_to_print'; -use Test::More tests => 20; # perldoc Test::More for details +use Test::More tests => 12; # perldoc Test::More for details # Test 1 BEGIN { use_ok('MOBY::Client::Central') }; # Test 2 my $C = MOBY::Client::Central->new( - MOBY_server => "http://localhost/cgi-bin/MOBY-Central.pl", - MOBY_uri => "http://localhost/MOBY/Central" + #MOBY_server => "http://localhost/cgi-bin/MOBY-Central.pl", + #MOBY_uri => "http://localhost/MOBY/Central" ); isa_ok( $C,'MOBY::Client::Central',"Connected to test MOBY Central") or - die("Cannot Connect to test MOBY Central... cannot continue?"); + die("Cannot Connect to MOBY Central... cannot continue?"); my %TestRegistry ; # to keep track of registry id's for the various tests ################## MOBY Registration Tests ################# # Test 3 -$r = $C->registerObject( - objectType => "testObject", - description => "this is a test", - xsd => "", - ISA => ["Object"], - authURI => "http://www.illuminae.com", - clobber => 0, +$r = $C->registerObjectClass(objectType => "TotalCrap", + description => "a human-readable description of the object", + contactEmail => 'your at email.address', + authURI => "URI of the registrar of this object", + Relationships => { + ISA => [ + ['Object', 'article1'], + ['Object', 'articleName2']], + HASA => [ + ['Object', 'articleName3']]} ); -( ok(!$r->success,"Object registration successful") and - ($TestRegistry{'Object'} = $r->registration_id) -) or diag("Object registration failure: ".$r->error_message) ; +( ok($r->success,"Object registration successful") + or diag("Object registration failure: ".$r->message)); + # Test 4 -$r = $C->registerServiceType( - serviceType => "testService", - description => "this is a test", - ISA => ["Retrieve"], +$r = $C->deregisterObjectClass(objectType => "TotalCrap"); +( ok($r->success,"Object deregistration successful")) +or diag("Object deregistration failure: ".$r->message) ; + +# Test 5 (identical to #3 +$r = $C->registerObjectClass(objectType => "TotalCrap", + description => "a human-readable description of the object", + contactEmail => 'your at email.address', + authURI => "URI of the registrar of this object", + Relationships => { + ISA => [ + ['Object', 'article1'], + ['Object', 'articleName2']], + HASA => [ + ['Object', 'articleName3']]} ); -( ok(!$r->success,"Service type registration successful") and - ($TestRegistry{'ServiceType'} = $r->registration_id) -) or diag("Service type registration failure: ".$r->error_message) ; +( ok($r->success,"Object registration successful") + or diag("Object registration failure: ".$r->message)); + -# Test 5 +# Test 6 $r = $C->registerNamespace( - namespaceType => "testNamespace", - description => "this is a test", - authURI => "http://illuminae.com", - clobber => 0 + namespaceType =>'UglyNamespace', + authURI => 'your.authority.URI', + description => "human readable description of namespace", + contactEmail => 'your at address.here'); +( ok($r->success,"Name space registration successful") +) or diag("Name space registration failure: ".$r->message) ; + + +# Test 7 +$r = $C->registerServiceType(serviceType => "CrappyService", + description => "a human-readable description of the service", + contactEmail => 'your at email.address', + authURI => "URI of the registrar of this object", + Relationships => { + ISA => ['Retrieval']} ); -( ok(!$r->success,"Name space registration successful") and - ($TestRegistry{'NameSpace'} = $r->registration_id) -) or diag("Name space registration failure: ".$r->error_message) ; +( ok($r->success,"Service Type registration successful") +) or diag("Service Type registration failure: ".$r->message) ; -# Test 6 +# Test 8 $r = $C->registerService( - serviceName => "Servicetest2", - serviceType => "Retrieve", - authURI => "illuminae.com", - input => {"Object" => ["Genbank/GI"]}, - output => ["Object"], - URL => "http://www.illuminae.com/cgi-bin/services.cgi", - description => "this is a test", - ); -( ok(!$r->success,"Service registration successful") and - ($TestRegistry{'Service'} = $r->registration_id) -) or diag("Name space registration failure: ".$r->error_message) ; - -################## MOBY Central Search Tests ################# - -my @service ; - -# Tests 7,8: locateServiceByOutput with output 'Object' and full_objects + full_services - at service = $C->locateServiceByOutput( - objectType => "Object", - fullObjects => 1, - fullServices => 1, -) ; - -SKIP: { - skip "locateServiceByOutput w/full object & services". - "did not return any services?", 2 unless scalar(@service) ; - is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; - is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; -} ; - -# Tests 9,10: Testing locateServiceByOutput with output "Object" and full_services only - at service = $C->locateServiceByOutput( - objectType => "Object", - fullObjects => 0, - fullServices => 1, - ); -SKIP: { - skip "locateServiceByOutput w/ output 'Object' and full services only ". - "did not return any services?", 2 unless scalar(@service) ; - is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; - is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; -} ; - -# Tests 11,12: Testing locateServiceByInput with input -# 'Object' => Genbank/GI and full_objects + full_services - at service = $C->locateServiceByInput( - input => {"Sequence" => ["Genbank/GI"]}, - fullObjects => 1, - fullServices => 1, - ); -SKIP: { - skip "locateServiceByInput w/input 'Object' => Genbank/GI ". - "and full_objects + full_services ". - "did not return any services?", 2 unless scalar(@service) ; - is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; - is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; -} ; - -# Tests 13,14: Testing locateServiceByInput with input -# 'Object' => Genbank/GI and full_services only - at service = $C->locateServiceByInput( - input => {"Object" => ["Genbank/GI"]}, - fullObjects => 0, - fullServices => 1, - ); -SKIP: { - skip "locateServiceByInput w/input 'Object' => Genbank/GI ". - "and full_services ". - "did not return any services?", 2 unless scalar(@service) ; - is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; - is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; -} ; - -# Tests 15,16: Testing locateServiceByType with type 'Retrieve' + full_services - at service = $C->locateServiceByType( - serviceType => "Retrieve", - fullServices => 1, - ); -SKIP: { - skip "locateServiceByType w/type 'Retrieve' and full_services ". - "did not return any services?", 2 unless scalar(@service) ; - is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; - is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; -} ; - -################## MOBY Deregistration Tests ################# - -# Test 17 -SKIP: { - skip "Skipping test DeregisterService since service registration failed", - 1 unless(exists($TestRegistry{'Service'})) ; - - $r = $C->deregisterService( serviceID => $TestRegistry{'Service'} ); - ok(!$r->success,"Service ID#".$r->registration_id." deregistration successful") - or diag("Service ID#",$TestRegistry{'Service'}, - "deregistration failure: ".$r->error_message) ; -} - -# Test 18 -SKIP: { - skip "Skipping test DeregisterNamespace since name space registration failed", - 1 unless(exists($TestRegistry{'NameSpace'})) ; - - $r = $C->deregisterNamespace( namespaceAcc => $TestRegistry{'NameSpace'} ); - ok(!$r->success,"Name space ID#".$r->registration_id." deregistration successful") - or diag("Name space ID#",$TestRegistry{'NameSpace'}, - "deregistration failure: ".$r->error_message) ; -} - -# Test 19 -SKIP: { - skip "Skipping test DeregisterServiceType since service registration failed", - 1 unless(exists($TestRegistry{'ServiceType'})) ; - - $r = $C->deregisterServiceType( serviceID => $TestRegistry{'ServiceType'} ); - ok(!$r->success,"Service type ID#".$r->registration_id." deregistration successful") - or diag("Service type ID#",$TestRegistry{'ServiceType'}, - "deregistration failure: ".$r->error_message) ; -} - -# Test 20 -SKIP: { - skip "Skipping test DeregisterObject since initial object registration failed", - 1 unless(exists($TestRegistry{'Object'})) ; - - $r = $C->deregisterObject( serviceID => $TestRegistry{'Object'} ); - ok(!$r->success,"Object ID#".$r->registration_id." deregistration successful") - or diag("Object ID#",$TestRegistry{'Object'}, - "deregistration failure: ".$r->error_message) ; -} + serviceName => "myfirstservice", + serviceType => "Retrieval", + authURI => "www.illuminae.com", + contactEmail => 'your at mail.address', + description => "this is my first service", + category => "moby", + URL => "http://illuminae/cgi-bin/service.pl", + input =>[ + ['articleName1', [Object => ['UglyNamespace']]], # Simple + ], + output =>[ + ['articleName2', [String => ['UglyNamespace']]], # Simple + ], + secondary => { + parametername1 => { + datatype => 'Int', + default => 0, + max => 10, + min => -10, + enum => [-10, 10, 0]}}); + +( ok($r->success,"Service registration successful") +) or diag("Service registration failure: ".$r->message) ; + + +# Test 9 + +$r = $C->deregisterService( + serviceName => "myfirstservice", + authURI => "www.illuminae.com", + ); +( ok($r->success,"Service deregistration successful") +) or diag("Service deregistration failure: ".$r->message) ; + + +# Test 10 +$r = $C->deregisterObjectClass(objectType => "TotalCrap"); +( ok($r->success,"Object deregistration successful") +) or diag("Object deregistration failure: ".$r->message) ; + +# Test 11 +$r = $C->deregisterServiceType(serviceType => "CrappyService"); +( ok($r->success,"Service Type deregistration successful") +) or diag("Service Type deregistration failure: ".$r->message) ; + +# Test 12 +$r = $C->deregisterNamespace(namespaceType =>'UglyNamespace'); +( ok($r->success,"namespace deregistration successful") +) or diag("namespace deregistration failure: ".$r->message) ; + +################### MOBY Central Search Tests ################# +# +#my @service ; +# +## Tests 7,8: locateServiceByOutput with output 'Object' and full_objects + full_services +#@service = $C->locateServiceByOutput( +# objectType => "Object", +# fullObjects => 1, +# fullServices => 1, +#) ; +# +#SKIP: { +# skip "locateServiceByOutput w/full object & services". +# "did not return any services?", 2 unless scalar(@service) ; +# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; +# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; +#} ; +# +## Tests 9,10: Testing locateServiceByOutput with output "Object" and full_services only +#@service = $C->locateServiceByOutput( +# objectType => "Object", +# fullObjects => 0, +# fullServices => 1, +# ); +#SKIP: { +# skip "locateServiceByOutput w/ output 'Object' and full services only ". +# "did not return any services?", 2 unless scalar(@service) ; +# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; +# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; +#} ; +# +## Tests 11,12: Testing locateServiceByInput with input +## 'Object' => Genbank/GI and full_objects + full_services +#@service = $C->locateServiceByInput( +# input => {"Sequence" => ["Genbank/GI"]}, +# fullObjects => 1, +# fullServices => 1, +# ); +#SKIP: { +# skip "locateServiceByInput w/input 'Object' => Genbank/GI ". +# "and full_objects + full_services ". +# "did not return any services?", 2 unless scalar(@service) ; +# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; +# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; +#} ; +# +## Tests 13,14: Testing locateServiceByInput with input +## 'Object' => Genbank/GI and full_services only +#@service = $C->locateServiceByInput( +# input => {"Object" => ["Genbank/GI"]}, +# fullObjects => 0, +# fullServices => 1, +# ); +#SKIP: { +# skip "locateServiceByInput w/input 'Object' => Genbank/GI ". +# "and full_services ". +# "did not return any services?", 2 unless scalar(@service) ; +# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; +# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; +#} ; +# +## Tests 15,16: Testing locateServiceByType with type 'Retrieve' + full_services +#@service = $C->locateServiceByType( +# serviceType => "Retrieve", +# fullServices => 1, +# ); +#SKIP: { +# skip "locateServiceByType w/type 'Retrieve' and full_services ". +# "did not return any services?", 2 unless scalar(@service) ; +# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; +# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; +#} ; +# +################### MOBY Deregistration Tests ################# +# +## Test 17 +#SKIP: { +# skip "Skipping test DeregisterService since service registration failed", +# 1 unless(exists($TestRegistry{'Service'})) ; +# +# $r = $C->deregisterService( serviceID => $TestRegistry{'Service'} ); +# ok(!$r->success,"Service ID#".$r->registration_id." deregistration successful") +# or diag("Service ID#",$TestRegistry{'Service'}, +# "deregistration failure: ".$r->message) ; +#} +# +## Test 18 +#SKIP: { +# skip "Skipping test DeregisterNamespace since name space registration failed", +# 1 unless(exists($TestRegistry{'NameSpace'})) ; +# +# $r = $C->deregisterNamespace( namespaceAcc => $TestRegistry{'NameSpace'} ); +# ok(!$r->success,"Name space ID#".$r->registration_id." deregistration successful") +# or diag("Name space ID#",$TestRegistry{'NameSpace'}, +# "deregistration failure: ".$r->message) ; +#} +# +## Test 19 +#SKIP: { +# skip "Skipping test DeregisterServiceType since service registration failed", +# 1 unless(exists($TestRegistry{'ServiceType'})) ; +# +# $r = $C->deregisterServiceType( serviceID => $TestRegistry{'ServiceType'} ); +# ok(!$r->success,"Service type ID#".$r->registration_id." deregistration successful") +# or diag("Service type ID#",$TestRegistry{'ServiceType'}, +# "deregistration failure: ".$r->message) ; +#} +# +## Test 20 +#SKIP: { +# skip "Skipping test DeregisterObject since initial object registration failed", +# 1 unless(exists($TestRegistry{'Object'})) ; +# +# $r = $C->deregisterObject( serviceID => $TestRegistry{'Object'} ); +# ok(!$r->success,"Object ID#".$r->registration_id." deregistration successful") +# or diag("Object ID#",$TestRegistry{'Object'}, +# "deregistration failure: ".$r->message) ; +#} From senger at pub.open-bio.org Fri Nov 7 19:47:33 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:47:33 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080047.hA80lXjn017845@pub.open-bio.org> senger Fri Nov 7 19:47:32 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated In directory pub.open-bio.org:/tmp/cvs-serv17827/generated Log Message: Directory /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated added to the repository moby-live/Java/src/Services/org/biomoby/service/generated - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated/RCS/directory,v: No such file or directory From mwilkinson at pub.open-bio.org Sat Nov 8 12:21:32 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Sat, 8 Nov 2003 12:21:32 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311081721.hA8HLWGp020549@pub.open-bio.org> mwilkinson Sat Nov 8 12:21:31 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv20526/Perl/MOBY Modified Files: CommonSubs.pm CommonSubs.html Log Message: updated CommonSubs to handle new message format; also included a paradigmatic example of a service moby-live/Perl/MOBY CommonSubs.pm,1.26,1.27 CommonSubs.html,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/06 16:23:14 1.26 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/08 17:21:31 1.27 @@ -8,46 +8,125 @@ =cut +=head1 Client Side Paradigm -=head1 SYNOPSIS +=cut - use MOBY::CommonSubs qw(:all); - my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles); - my $ns = getSimpleArticleNamespaceURI($SimpleArticle); +=head2 Service-Side Paradigm -A COMPLETE EXAMPLE OF A SIMPLE MOBY SERVICE +The following is a generalized architecture for *all* +BioMOBY services showing how to parse incoming messages... sub myServiceName { - my ($caller, $query) = @_; # get the incoming MOBY query XML - my @queries = getInputArticles($query); # returns DOM nodes - my $MOBY_RESPONSE = ""; # set empty response + my ($caller, $message) = @_; # get the incoming MOBY query XML + + my @queries = getInputs($message); # returns XML::DOM nodes + my $MOBY_RESPONSE = ""; # set empty response - foreach (@queries){ - my @inputs = @{$_}; #(may be more than one Simple/Collection input per query) - foreach my $input(@inputs){ - @sequence = getNodeContentWithArticle($_, "String", "SequenceString"); - my $sequence = join "", @sequence; # join all lines of string - # print STDERR "Analyzing $sequence\n"; - my $result = &_AnalyzeString($sequence); # do your analysis - $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename"); + foreach my $query(@queries){ + + my $queryID = getInputID($query); # get the queryID attribute of the queryInput + + my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query + foreach my $input(@input_articles){ # input is a listref + + my ($articleName, $article) = @{$input}; # get the named article + + my $simple = isSimpleArticle($article); # articles may be simple or collection + my $collection = isCollectionArticle($article); + + if ($collection){ + + # do something wtih the collection... + # for example... + my @simples = getCollectedSimples($article); + # blah blah blah... + + } elsif ($simple){ + # maybe you just need the ID of the incoming query: + my ($id) = getSimpleArticleIDs('NCBI_gi', $article); # if you need the ID + + # or maybe you are going to do something with the content? + # for example, this will get the array of text lines + # for the moby:String object with the articleName 'SequenceString' + # that is in this $article + my @sequence = getNodeContentWithArticle($article, "String", "SequenceString"); + + # DO YOUR ANALYSIS HERE + my $result = ""; #whatever you analysis says + + $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename", $queryID); + } } } - return responseHeader . $MOBY_RESPONSE . responseFooter; + return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter; + } + +=cut + +=head1 EXAMPLE + + +A COMPLETE EXAMPLE OF AN EASY MOBY SERVICE + +This is a service that: + +CONSUMES: Object in the NCBI_Acc namespace +EXECUTES: Retrieval +PRODUCES: GenericSequence (in the NCBI_Acc namespace) + + + use Bio::Perl; + + # this subroutine is called from your dispatch_with line + # in your SOAP daemon + + sub myServiceName { + my ($caller, $message) = @_; # get the incoming MOBY query XML + + my @queries = getInputs($message); # returns XML::DOM nodes + my $MOBY_RESPONSE = ""; # set empty response + + foreach my $query(@queries){ + + my $queryID = getInputID($query); # get the queryID attribute of the queryInput + + my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query + foreach my $input(@input_articles){ # input is a listref + my ($articleName, $article) = @{$input}; # get the named article + next unless isSimpleArticle($article); # I only allow simple inputs in my service signature + my ($id) = getSimpleArticleIDs('NCBI_Acc', $article); # if you need the ID + my $seq; + eval {$seq = get_sequence('genbank',$id);} # suppress bioperl error messages + my $response = ""; + if ($seq){ + $length = length($seq); + $response = " + $length + $seq + "; + } + $MOBY_RESPONSE .= simpleResponse($response, '', $queryID); + } + } + } + return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter; } =head1 DESCRIPTION -Used to do various transactions with MOBY-Central registry, including registering -new Object and Service types, querying for these types, registering new -Servers/Services, or queryiong for available services given certain input/output -or service type constraints. +CommonSubs are used to do various manipulations of MOBY Messages. It is useful +both Client and Service side to construct and parse MOBY Messages, and ensure +that the message structure is valid as per the API. + +It DOES NOT connect to MOBY Central for any of its functions. =head1 AUTHORS -Mark Wilkinson (markw at illuminae.com) +Mark Wilkinson (markw at illuminae dot com) BioMOBY Project: http://www.biomoby.org @@ -63,6 +142,7 @@ require Exporter; use XML::DOM; use MOBY::CrossReference; +use MOBY::Client::OntologyServer; @ISA = qw(Exporter); @EXPORT_OK = qw( @@ -72,6 +152,10 @@ responseHeader responseFooter getInputArticles + getInputs + getInputID + getArticles + getCollectedSimples getNodeContentWithArticle collectionResponse validateNamespaces @@ -88,6 +172,10 @@ responseHeader responseFooter getInputArticles + getInputs + getInputID + getArticles + getCollectedSimples getNodeContentWithArticle collectionResponse validateNamespaces @@ -130,7 +218,9 @@ sub getSimpleArticleIDs { my ($desired_namespace, $input_nodes) = @_; return undef unless $input_nodes; + $input_nodes = [$input_nodes] unless ref($input_nodes) =~ /ARRAY/; # be flexible! return undef unless scalar @{$input_nodes}; + my @input_nodes = @{$input_nodes}; my $OS = MOBY::Client::OntologyServer->new; my ($s, $m); @@ -218,40 +308,38 @@ name : simpleResponse function : wraps a simple article in the appropriate queryResponse structure - usage : $resp .= &simpleResponse($object, 'MyArticleName', $queryInput); + usage : $resp .= &simpleResponse($object, 'MyArticleName', $queryID); args : (in order) $object - (optional) a MOBY Object as raw XML $article - (optional) an articeName for this article - $query - (optional, but strongly recommended) the queryInput block - to which you are responding, either as raw XML, - or an XML::DOM object + $query - (optional, but strongly recommended) the queryID value for the + queryInput block to which you are responding notes : as required by the API you must return a response for every input. If one of the inputs was invalid, you return a valid (empty) MOBY - response by calling &simpleResponse() with no arguments. + response by calling &simpleResponse(undef, undef, $queryID) with no arguments. =cut sub simpleResponse { - my ($data, $articleName, $query) = @_; # articleName optional - my $qID = ''; + my ($data, $articleName, $qID) = @_; # articleName optional $data ||=''; - $qID = &_getQueryID($query) if $query; + $qID = &_getQueryID($qID) if ref($qID) =~ /XML::DOM/; # in case they send the DOM instead of the ID if ($articleName) { return " - + $data "; } elsif($data) { return " - - $data + + $data "; } else { return " - + "; } } @@ -263,8 +351,9 @@ my $doc = $parser->parse($query); $query = $doc->getDocumentElement(); } - return '' unless $query->getTagName eq "queryInput"; + return '' unless $query->getTagName =~/queryInput/; my $id = $query->getAttribute('queryID'); + $id ||= $query->getAttribute('moby:queryID'); return $id; } @@ -273,26 +362,24 @@ name : collectionResponse function : wraps a set of articles in the appropriate queryResponse structure - usage : return responseHeader . &collectionResponse(\@objects, 'MyArticleName') . responseFooter; + usage : return responseHeader . &collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter; args : (in order) \@objects - (optional) a listref of MOBY Objects as raw XML $article - (optional) an articeName for this article - $query - (optional, but strongly recommended) the queryInput block - to which you are responding, either as raw XML, - or an XML::DOM object + $queryID - (optional, but strongly recommended) the queryInput ID + to which you are responding notes : as required by the API you must return a response for every input. If one of the inputs was invalid, you return a valid (empty) MOBY - response by calling &collectionResponse() with no arguments. + response by calling &collectionResponse(undef, undef, $queryID). =cut sub collectionResponse { - my ($data, $articleName, $query) = @_; # articleName optional + my ($data, $articleName, $qID) = @_; # articleName optional my $content = ""; - my $qID = ''; - $data ||=''; - $qID = &_getQueryID($query) if $query; + $data ||=[]; + $qID ||= ''; unless ((ref($data) =~ /array/i) && $data->[0]){ # we're expecting an arrayref as input data,and it must not be empty return ""; } @@ -319,7 +406,7 @@ } else { return " - $content + $content "; } @@ -394,9 +481,11 @@ my ($XML) = @_; - my $parser = new XML::DOM::Parser; - my $doc = $parser->parse($XML); - my $moby = $doc->getDocumentElement(); + unless (ref($XML) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($XML); + $moby = $doc->getDocumentElement(); + } my $x = $moby->getElementsByTagName('queryInput'); # get the queryInput block unless ($x->item(0)){ @@ -411,62 +500,118 @@ } +=head2 getInputID -=head2 get_queryInput_Articles + name : getInputID + function : get the value of the queryID element + usage : @queryInputs = getInputID($XML) + args : the raw XML or XML::DOM of a block + returns : integer, or '' + Note : queryInputs and queryResponses are coordinately enumerated! + The integer you get here is what you + pass as the third argument to the simpleResponse or collectionResponse + subroutine to associate the numbered input to the numbered response - name : get_queryInput_Articles - function : get the Simple/Collection articles for each queryInput, in order - usage : @queries = get_queryInput_Articles($XML) - args : XML of a or an XML::DOM::Node of the element - returns : a list of listrefs, each listref is the input to a single query. - Remember that the input to a single query may be one or more Simple - and/or Collection articles. These are provided as XML::DOM nodes. - - i.e.: @queries = ([$SIMPLE_DOM_NODE], [$SIMPLE_DOM_NODE2]) - or : @queries = ([$COLLECTION_DOM_NODE], [$COLLECTION_DOM_NODE2]) - - the former is generated from the following XML: +=cut + + +sub getInputID { + my ($XML) = @_; + unless (ref($XML) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($XML); + $XML = $doc->getDocumentElement(); + } + return '' unless $XML->getTagName =~ /queryInput/; + my $qid = $XML->getAttribute('queryID'); + return defined($qid)?$qid:''; +} + + + +=head2 getArticles + + name : getArticles + function : get the Simple/Collection articles for a single queryInput + or queryResponse node + usage : @articles = getArticles($XML) + args : raw XML or XML::DOM of a moby:queryInput or a moby:queryResponse block + returns : a list of listrefs; each listref is one component of the queryInput. + a single queryInput/Responsemay consist of one or more named or unnamed + simple or collection articles. The listref structure is thus [name, $ARTICLE]: - ... - + e.g.: @articles = ['name1', $SIMPLE_DOM] + or : @articles = ['name1', $COLLECTION_DOM], ['name2', $SIMPLE_DOM]... + + the former is generated from the following sample XML: + - + - + - - ... =cut -sub get_queryInput_Articles { +sub getArticles { - my ($XML) = @_; - my $parser = new XML::DOM::Parser; - my $doc = $parser->parse($XML); - my $moby = $doc->getDocumentElement(); + my ($moby) = @_; + unless (ref($moby) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($moby); + $moby = $doc->getDocumentElement(); + } - my $x = $moby->getElementsByTagName('queryInput'); # get the queryInput block - unless ($x->item(0)){ - $x = $moby->getElementsByTagName('moby:queryInput'); + return undef unless $moby->getNodeType == ELEMENT_NODE; + return undef unless ($moby->getTagName =~ /queryInput/ || $moby->getTagName =~ /queryResponse/); + my @articles; + foreach $child($moby->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them + next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace + next unless ($child->getTagName =~ /Simple/ || $child->getTagName =~ /Collection/); + my $articleName = $child->getAttribute('articleName'); + $articleName ||= $child->getAttribute('moby:articleName'); + push @articles, [$articleName, $child]; # take the child elements, which are or } + return @articles; # return them. +} - my @queries; - for (0..$x->getLength-1){ # there may be more than one queryInput per message - my @this_query; - foreach $child($x->item($_)->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them - next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace - push @this_query, $child; # take the child elements, which are or - } - push @queries, \@this_query; - } - return @queries; # return them in the order that they were discovered. + +=head2 getCollectedSimples + + name : getCollectedSimples + function : get the Simple articles collected in a moby:Collection block + usage : @Simples = getCollectedSimples($XML) + args : raw XML or XML::DOM of a moby:Collection block + returns : a list of XML::DOM nodes, each of which is a moby:Simple block + +=cut + + +sub getCollectedSimples { + + my ($moby) = @_; + unless (ref($moby) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($moby); + $moby = $doc->getDocumentElement(); + } + + return undef unless $moby->getNodeType == ELEMENT_NODE; + return undef unless ($moby->getTagName =~ /Collection/); + + my @articles; + foreach $child($moby->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them + next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace + next unless ($child->getTagName =~ /Simple/); + push @articles, $child; # take the child elements, which are or + } + return (@articles); # return them. } @@ -475,7 +620,7 @@ name : getInputArticles function : get the Simple/Collection articles for each input query, in order usage : @queries = getInputArticles($XML) - args : the raw XML of a query + args : the raw XML of a moby:MOBY query returns : a list of listrefs, each listref is the input to a single query. Remember that the input to a single query may be one or more Simple and/or Collection articles. These are provided as XML::DOM nodes. @@ -505,10 +650,12 @@ sub getInputArticles { - my ($XML) = @_; - my $parser = new XML::DOM::Parser; - my $doc = $parser->parse($XML); - my $moby = $doc->getDocumentElement(); + my ($moby) = @_; + unless (ref($moby) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($moby); + $moby = $doc->getDocumentElement(); + } my $x = $moby->getElementsByTagName('queryInput'); # get the queryInput block unless ($x->item(0)){ @@ -520,14 +667,7 @@ my @this_query; foreach $child($x->item($_)->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace -# if ($asObject){ -# my $obj; -# $obj = MOBY::Client::SimpleArticle->new(XML_DOM => $child) if (isSimpleArticle($child)); -# $obj = MOBY::Client::CollectionArticle->new(XML_DOM => $child) if (isCollectionArticle($child)); -# push @this_query, $child; -# } else { push @this_query, $child; # take the child elements, which are or -# } } push @queries, \@this_query; } @@ -554,7 +694,7 @@ $DOM = $doc->getDocumentElement(); } $DOM = $DOM->getDocumentElement if ($DOM->isa("XML::DOM::Document")); - return 1 if ($DOM->getTagName eq "Simple"); + return 1 if ($DOM->getTagName =~ /Simple/); return 0; } @@ -822,13 +962,13 @@ $ns = $xref->getAttributeNode('moby:namespace') unless $ns; return undef unless $ns; my $id = $xref->getAttributeNode('id'); - $id = $xref->getAttributeNode('moby:id') unless $ns; + $id = $xref->getAttributeNode('moby:id') unless $id; return undef unless $id; my $xr = $xref->getAttributeNode('xref_type'); - $xr = $xref->getAttributeNode('moby:namespace') unless $ns; + $xr = $xref->getAttributeNode('moby:xref_type') unless $xr; return undef unless $xr; my $ec = $xref->getAttributeNode('evidence_code'); - $ec = $xref->getAttributeNode('moby:namespace') unless $ns; + $ec = $xref->getAttributeNode('moby:evidence_code') unless $ec; return undef unless $ec; my $au = $xref->getAttributeNode('authURI'); $au = $xref->getAttributeNode('moby:authURI') unless $au; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html 2003/10/25 22:20:47 1.5 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html 2003/11/08 17:21:31 1.6 @@ -15,7 +15,13 @@
          • NAME
          • -
          • SYNOPSIS
          • +
          • Client Side Paradigm
          • + + +
          • EXAMPLE
          • DESCRIPTION
          • AUTHORS
          • METHODS
          • @@ -27,6 +33,10 @@
          • collectionResponse
          • responseHeader
          • responseFooter
          • +
          • getInputs
          • +
          • getInputID
          • +
          • getArticles
          • +
          • getCollectedSimples
          • getInputArticles
          • isSimpleArticle
          • isCollectionArticle
          • @@ -49,43 +59,116 @@


            -

            SYNOPSIS

            +

            Client Side Paradigm

            +

            +

            +

            Service-Side Paradigm

            +

            The following is a generalized architecture for *all* +BioMOBY services showing how to parse incoming messages...

            +
            + sub myServiceName {
            +   my ($caller, $message) = @_;  # get the incoming MOBY query XML
            +
            +   my @queries = getInputs($message);  # returns XML::DOM nodes
            +   my $MOBY_RESPONSE = "";           # set empty response
            + 
            +   foreach my $query(@queries){
            - use MOBY::CommonSubs qw(:all);
            - my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles);
            - my $ns = getSimpleArticleNamespaceURI($SimpleArticle);
            -

            A COMPLETE EXAMPLE OF A SIMPLE MOBY SERVICE

            + my $queryID = getInputID($query); # get the queryID attribute of the queryInput + + my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query + foreach my $input(@input_articles){ # input is a listref +
            +        my ($articleName, $article) = @{$input}; # get the named article
            +        
            +        my $simple = isSimpleArticle($article);  # articles may be simple or collection
            +        my $collection = isCollectionArticle($article);
            +
            +        if ($collection){
            +
            +            # do something wtih the collection...
            +            # for example...
            +            my @simples = getCollectedSimples($article);
            +            # blah blah blah...
            +            
            +        } elsif ($simple){
            +            # maybe you just need the ID of the incoming query:
            +            my ($id) = getSimpleArticleIDs('NCBI_gi', $article); # if you need the ID
            +
            +            # or maybe you are going to do something with the content?
            +            # for example, this will get the array of text lines
            +            # for the moby:String object with the articleName 'SequenceString'
            +            # that is in this $article
            +            my @sequence = getNodeContentWithArticle($article, "String", "SequenceString");
            +
            +            #  DO YOUR ANALYSIS HERE
            +            my $result = ""; #whatever you analysis says
            +            
            +            $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename", $queryID);
            +        }
            +     }
            +   }
            +   return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter;
            + }
            +

            +

            +
            +

            EXAMPLE

            +

            A COMPLETE EXAMPLE OF AN EASY MOBY SERVICE

            +

            This is a service that:

            +

            CONSUMES: Object in the NCBI_Acc namespace +EXECUTES: Retrieval +PRODUCES: GenericSequence (in the NCBI_Acc namespace)

            + use Bio::Perl;
            + 
            + # this subroutine is called from your dispatch_with line
            + # in your SOAP daemon
            + 
              sub myServiceName {
            -   my ($caller, $query) = @_;  # get the incoming MOBY query XML
            -   my @queries = getInputArticles($query);  # returns DOM nodes
            -   my $MOBY_RESPONSE = "";  # set empty response
            +   my ($caller, $message) = @_;  # get the incoming MOBY query XML
            +
            +   my @queries = getInputs($message);  # returns XML::DOM nodes
            +   my $MOBY_RESPONSE = "";           # set empty response
              
            -   foreach (@queries){
            -     my @inputs = @{$_}; #(may be more than one Simple/Collection input per query)
            -     foreach my $input(@inputs){
            -        @sequence = getNodeContentWithArticle($_, "String", "SequenceString");
            -        my $sequence = join "", @sequence; # join all lines of string
            -        # print STDERR "Analyzing $sequence\n"; 
            -        my $result = &_AnalyzeString($sequence);  # do your analysis
            -        $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename");
            +   foreach my $query(@queries){
            +
            +     my $queryID = getInputID($query);  # get the queryID attribute of the queryInput
            +     
            +     my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query
            +     foreach my $input(@input_articles){       # input is a listref
            +        my ($articleName, $article) = @{$input}; # get the named article
            +        next unless isSimpleArticle($article);   # I only allow simple inputs in my service signature
            +        my ($id) = getSimpleArticleIDs('NCBI_Acc', $article); # if you need the ID
            +        my $seq;
            +        eval {$seq = get_sequence('genbank',$id);} # suppress bioperl error messages
            +        my $response = "";
            +        if ($seq){
            +            $length = length($seq);
            +            $response = "<GenericSequence namespace='NCBI_Acc' id='$id'>
            +                           <Integer namespace='' id='' articleName='Length'>$length</Integer>
            +                           <String namespace='' id='' articleName='SequenceString'>$seq</String>
            +                         </GenericSequence>";
            +        }
            +            $MOBY_RESPONSE .= simpleResponse($response, '', $queryID);
            +        }
                  }
                }
            -   return responseHeader . $MOBY_RESPONSE . responseFooter;
            +   return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter;
              }


            DESCRIPTION

            -

            Used to do various transactions with MOBY-Central registry, including registering -new Object and Service types, querying for these types, registering new -Servers/Services, or queryiong for available services given certain input/output -or service type constraints.

            +

            CommonSubs are used to do various manipulations of MOBY Messages. It is useful +both Client and Service side to construct and parse MOBY Messages, and ensure +that the message structure is valid as per the API.

            +

            It DOES NOT connect to MOBY Central for any of its functions.


            AUTHORS

            -

            Mark Wilkinson (markw at illuminae.com)

            +

            Mark Wilkinson (markw at illuminae dot com)

            BioMOBY Project: http://www.biomoby.org

            @@ -127,33 +210,38 @@
              name     : simpleResponse
              function : wraps a simple article in the appropriate queryResponse structure
            - usage    : return responseHeader . &simpleResponse($object, 'MyArticleName') . responseFooter;
            + usage    : $resp .= &simpleResponse($object, 'MyArticleName', $queryID);
              args     : (in order)
                         $object   - (optional) a MOBY Object as raw XML
                         $article  - (optional) an articeName for this article
            +            $query    - (optional, but strongly recommended) the queryID value for the
            +                        queryInput block to which you are responding
              notes    : as required by the API you must return a response for every input.
                         If one of the inputs was invalid, you return a valid (empty) MOBY
            -            response by calling &simpleResponse() with no arguments.
            + response by calling &simpleResponse(undef, undef, $queryID) with no arguments.

            collectionResponse

              name     : collectionResponse
              function : wraps a set of articles in the appropriate queryResponse structure
            - usage    : return responseHeader . &collectionResponse(\@objects, 'MyArticleName') . responseFooter;
            + usage    : return responseHeader . &collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter;
              args     : (in order)
                         \@objects - (optional) a listref of MOBY Objects as raw XML
                         $article  - (optional) an articeName for this article
            +            $queryID  - (optional, but strongly recommended) the queryInput ID
            +                        to which you are responding
              notes    : as required by the API you must return a response for every input.
                         If one of the inputs was invalid, you return a valid (empty) MOBY
            -            response by calling &collectionResponse() with no arguments.
            + response by calling &collectionResponse(undef, undef, $queryID).

            responseHeader

            - name     : responseHeader
            + name     : responseHeader($auth)
              function : print the XML string of a MOBY response header
            - usage    : return responseHeader . $DATA . responseFooter;
            + usage    : return responseHeader('illuminae.com') . $DATA . responseFooter;
            + args     : a string representing the service providers authority URI
              caveat   : will soon be expanded to include service provision info
                         and additional namespace declarations
              notes    :  returns everything required up to the response articles themselves.
            @@ -167,7 +255,7 @@
             
              name     : responseFooter
              function : print the XML string of a MOBY response footer
            - usage    : return responseHeader . $DATA . responseFooter;
            + usage    : return responseHeader('illuminae.com') . $DATA . responseFooter;
              notes    :  returns everything required after the response articles themselves
                          i.e. something like:
               
            @@ -175,12 +263,74 @@
                  </moby:MOBY>

            +

            getInputs

            +
            + name     : getInputs
            + function : get the queryInput block(s) as XML::DOM nodes
            + usage    : @queryInputs = getInputArticles($XML)
            + args     : the raw XML of a <MOBY> query, or an XML::DOM document
            + returns  : a list of XML::DOM::Node's, each is a queryInput.
            + Note     : Remember that queryInputs are numbered!  This is what you
            +            pass as the third argument to the simpleResponse or collectionResponse
            +            subroutine to associate the numbered input to the numbered response
            +

            +

            +

            getInputID

            +
            + name     : getInputID
            + function : get the value of the queryID element
            + usage    : @queryInputs = getInputID($XML)
            + args     : the raw XML or XML::DOM of a <queryInput> block
            + returns  : integer, or ''
            + Note     : queryInputs and queryResponses are coordinately enumerated!
            +            The integer you get here is what you
            +            pass as the third argument to the simpleResponse or collectionResponse
            +            subroutine to associate the numbered input to the numbered response
            +

            +

            +

            getArticles

            +
            + name     : getArticles
            + function : get the Simple/Collection articles for a single queryInput
            +            or queryResponse node
            + usage    : @articles = getArticles($XML)
            + args     : raw XML or XML::DOM of a moby:queryInput or a moby:queryResponse block
            + returns  : a list of listrefs; each listref is one component of the queryInput.
            +            a single queryInput/Responsemay consist of one or more named or unnamed
            +            simple or collection articles.  The listref structure is thus [name, $ARTICLE]:
            +            
            +            e.g.:  @articles = ['name1', $SIMPLE_DOM]
            +            or  :  @articles = ['name1', $COLLECTION_DOM], ['name2', $SIMPLE_DOM]...
            +
            +            the former is generated from the following sample XML:
            +
            +                <queryInput>
            +                    <Simple articleName='name1'>
            +                      <Object namespace=blah id=blah/>
            +                    </Simple>
            +                </queryInput>
            +                <queryInput>
            +                    <Simple articleName='name1'>
            +                      <Object namespace=blah id=blah/>
            +                    </Simple>
            +                </queryInput>
            +

            +

            +

            getCollectedSimples

            +
            + name     : getCollectedSimples
            + function : get the Simple articles collected in a moby:Collection block
            + usage    : @Simples = getCollectedSimples($XML)
            + args     : raw XML or XML::DOM of a moby:Collection block
            + returns  : a list of XML::DOM nodes, each of which is a moby:Simple block
            +

            +

            getInputArticles

              name     : getInputArticles
              function : get the Simple/Collection articles for each input query, in order
              usage    : @queries = getInputArticles($XML)
            - args     : the raw XML of a <MOBY> query
            + args     : the raw XML of a moby:MOBY query
              returns  : a list of listrefs, each listref is the input to a single query.
                         Remember that the input to a single query may be one or more Simple
                         and/or Collection articles.  These are provided as XML::DOM nodes.
            @@ -203,11 +353,7 @@
                                 </Simple>
                             </queryInput>
                           </moby:Query>
            -                 ...
            - note     : This subroutine enforces valid message structure
            -            in that you may only have one Simple OR one Collection
            -            article per queryInput!  if you have more, only the first
            -            is read.
            + ...

            isSimpleArticle

            From mwilkinson at pub.open-bio.org Wed Nov 12 12:31:43 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 12:31:43 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121731.hACHVhx8012361@pub.open-bio.org> mwilkinson Wed Nov 12 12:31:42 EST 2003 Update of /home/repository/moby/moby-live/Perl In directory pub.open-bio.org:/tmp/cvs-serv12338 Modified Files: MANIFEST Added Files: Makefile.PL Log Message: Yay! We have a Makefile and test suite again! This is more simple than the one that Richard was working on at the Singapore hackathon (his was able to actually install and test local services), but this will at least install the modules and test the basic functionality of MOBY::Client::Central moby-live/Perl Makefile.PL,1.4,1.5 MANIFEST,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/Makefile.PL,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Perl/Makefile.PL 2003/10/09 16:49:22 1.4 +++ /home/repository/moby/moby-live/Perl/Makefile.PL 2003/11/12 17:31:42 1.5 @@ -1,100 +1,101 @@ use ExtUtils::MakeMaker; use FindBin '$Bin'; -#require 5.008; -my $VERSION = '0.04'; - -my $WWW_ROOT_PATH = "/usr/local/apache" ; -my $CGI_BIN = "cgi-bin" ; -my $WWW_USER = "www" ; -# -# RMB - Singapore biohackethon - Work in progress, to make a cleaner installation -# Welcome... -print STDERR "\n\nMOBY Installation (Perl Implementation)\n" ; -print STDERR "=======================================\n\n" ; - -my $line ; -print STDERR - "I need to know your web server path...\n", - "This is typically something like one of the following:\n\n", - "\tStandard Apache Unix location: '/usr/local/apache'\n", - "\tTypical location under Linux: '/var/www/'\n", - "\tLocation under Mac OS X: '/Library/WebServer'\n\n", - "Path to your WWW server root \[$WWW_ROOT_PATH\]? "; -chomp ($line = <>); -$WWW_ROOT_PATH=$line if ($line) ; -print STDERR "Setting WWW server root path to '$WWW_ROOT_PATH'\n\n" ; - -print STDERR - "I also need the name of your CGI script directory there:\n\n", - "\tMost of the time, this is 'cgi-bin'\n", - "\tbut Mac OS X uses 'CGI-Executables'\n\n", - "Name of your CGI directory \[$CGI_BIN\]? "; -chomp ($line = <>); -$CGI_BIN=$line if ($line) ; -my $CGI_BIN_PATH = "$WWW_ROOT_PATH/$CGI_BIN" ; -print STDERR "Setting CGI bin path to '$CGI_BIN_PATH'\n\n" ; - -print STDERR - "Your server runs under a specific user account.\n", - "\tUnder most installations, this is usually 'nobody' or 'www'\n", - "\tUnder Mac OS X, this is 'root'\n\n", - "Name of WWW server user account \[$WWW_USER\]? "; -chomp ($line = <>); -$WWW_USER=$line if ($line) ; -print STDERR "Setting WWW user to '$WWW_USER'\n\n" ; - -my $WWW_GROUP=$WWW_USER ; -print STDERR - "A UNIX group is also generally associated with the web directories.\n", - "\tThis may be the same as the above user account name, or\n", - "\tin be something else, like 'admin' in Mac OS X\n\n", - "Name of WWW server group \[$WWW_GROUP\]? "; -chomp($line = <>) ; -$WWW_GROUP=$line if($line) ; -print STDERR "Setting WWW group to '$WWW_GROUP'\n\n" ; -print STDERR "Press any key to continue...\n\n" ; -$line=<>; - -sub MY::post_initialize { - return <<"MAKE_FRAG"; -MOBY_WWW_ROOT_PATH = $WWW_ROOT_PATH -MOBY_CGI_BIN_PATH = $CGI_BIN_PATH -MOBY_WWW_USER = $WWW_USER -MOBY_WWW_GROUP = $WWW_GROUP -MAKE_FRAG -} +my $VERSION = '0.1'; +#my $WWW_ROOT_PATH = "/usr/local/apache" ; +#my $CGI_BIN = "cgi-bin" ; +#my $WWW_USER = "www" ; +## +## RMB - Singapore biohackethon - Work in progress, to make a cleaner installation +## Welcome... +#print STDERR "\n\nMOBY Installation (Perl Implementation)\n" ; +#print STDERR "=======================================\n\n" ; +# +#my $line ; +#print STDERR +# "I need to know your web server path...\n", +# "This is typically something like one of the following:\n\n", +# "\tStandard Apache Unix location: '/usr/local/apache'\n", +# "\tTypical location under Linux: '/var/www/'\n", +# "\tLocation under Mac OS X: '/Library/WebServer'\n\n", +# "Path to your WWW server root \[$WWW_ROOT_PATH\]? "; +#chomp ($line = <>); +#$WWW_ROOT_PATH=$line if ($line) ; +#print STDERR "Setting WWW server root path to '$WWW_ROOT_PATH'\n\n" ; +# +#print STDERR +# "I also need the name of your CGI script directory there:\n\n", +# "\tMost of the time, this is 'cgi-bin'\n", +# "\tbut Mac OS X uses 'CGI-Executables'\n\n", +# "Name of your CGI directory \[$CGI_BIN\]? "; +#chomp ($line = <>); +#$CGI_BIN=$line if ($line) ; +#my $CGI_BIN_PATH = "$WWW_ROOT_PATH/$CGI_BIN" ; +#print STDERR "Setting CGI bin path to '$CGI_BIN_PATH'\n\n" ; +# +#print STDERR +# "Your server runs under a specific user account.\n", +# "\tUnder most installations, this is usually 'nobody' or 'www'\n", +# "\tUnder Mac OS X, this is 'root'\n\n", +# "Name of WWW server user account \[$WWW_USER\]? "; +#chomp ($line = <>); +#$WWW_USER=$line if ($line) ; +#print STDERR "Setting WWW user to '$WWW_USER'\n\n" ; +# +#my $WWW_GROUP=$WWW_USER ; +#print STDERR +# "A UNIX group is also generally associated with the web directories.\n", +# "\tThis may be the same as the above user account name, or\n", +# "\tin be something else, like 'admin' in Mac OS X\n\n", +# "Name of WWW server group \[$WWW_GROUP\]? "; +#chomp($line = <>) ; +#$WWW_GROUP=$line if($line) ; +#print STDERR "Setting WWW group to '$WWW_GROUP'\n\n" ; +#print STDERR "Press any key to continue...\n\n" ; +#$line=<>; +# +#sub MY::post_initialize { +# return <<"MAKE_FRAG"; +#MOBY_WWW_ROOT_PATH = $WWW_ROOT_PATH +#MOBY_CGI_BIN_PATH = $CGI_BIN_PATH +#MOBY_WWW_USER = $WWW_USER +#MOBY_WWW_GROUP = $WWW_GROUP +#MAKE_FRAG +#} +# # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( - 'NAME' => 'MOBY', + 'NAME' => 'MOBY-S', 'VERSION' => $VERSION, 'PREREQ_PM' => { + 'SOAP::Lite' => 0.55, + 'XML::DOM' => 1.42, }, # e.g., Module::Name => 1.1 #'PM_FILTER' => "", ($] >= 5.005 ? ## Add these new keywords supported since 5.005 - (ABSTRACT => 'Perl module binding for MOBY', + (ABSTRACT => 'Perl module binding for MOBY-S', AUTHOR => 'Mark Wilkinson [markw at illuminae.com]') : ()), ); # # Insert additional MOBY specific Makefile targets # - -sub MY::postamble { - return <<"MAKE_FRAG"; -Central: - echo 'Make (local) MOBY Central stub' - -Server: - echo 'Make (local) MOBY Server stub' - -WWWClient: - echo 'Setting up MOBY WWW Client' - cp scripts/MOBY-Client.cgi \$(MOBY_CGI_BIN_PATH) - chown \$(MOBY_WWW_USER):\$(MOBY_WWW_GROUP) \$(MOBY_CGI_BIN_PATH)/MOBY-Client.cgi - -MAKE_FRAG -} +# +#sub MY::postamble { +# return <<"MAKE_FRAG"; +#Central: +# echo 'Make (local) MOBY Central stub' +# +#Server: +# echo 'Make (local) MOBY Server stub' +# +#WWWClient: +# echo 'Setting up MOBY WWW Client' +# cp scripts/MOBY-Client.cgi \$(MOBY_CGI_BIN_PATH) +# chown \$(MOBY_WWW_USER):\$(MOBY_WWW_GROUP) \$(MOBY_CGI_BIN_PATH)/MOBY-Client.cgi +# +#MAKE_FRAG +#} =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MANIFEST,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Perl/MANIFEST 2003/11/12 16:49:13 1.5 +++ /home/repository/moby/moby-live/Perl/MANIFEST 2003/11/12 17:31:42 1.6 @@ -22,12 +22,7 @@ MOBY/Client/SimpleArticle.pm MOBY/Client/SimpleInput.pm MOBY/Client/Service.pm -t/Central.t t/Client-Central.t -t/Registration.t -t/ServiceInstance.t -t/Service.t -t/BasicLocalServices.t scripts/debugYourService scripts/MOBY-Central.pl scripts/Services.cgi From mwilkinson at pub.open-bio.org Wed Nov 12 11:14:04 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 11:14:04 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121614.hACGE4aW011592@pub.open-bio.org> mwilkinson Wed Nov 12 11:14:04 EST 2003 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv11576 Removed Files: debug_a_service.pl Log Message: removing old moby-live/Perl/scripts debug_a_service.pl,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Perl/scripts/RCS/debug_a_service.pl,v: No such file or directory From mwilkinson at pub.open-bio.org Wed Nov 12 11:38:49 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 11:38:49 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121638.hACGcncD011745@pub.open-bio.org> mwilkinson Wed Nov 12 11:38:49 EST 2003 Update of /home/repository/moby/moby-live/Perl/scripts/Services In directory pub.open-bio.org:/tmp/cvs-serv11729/Services Added Files: HelloWorldService.pm Removed Files: PlanetLocalServices.pm Log Message: removed Rebecca's helloPlanet service and replaced it with a more generic helloWorld service that uses the correct new message structure and the CommonSubs routines to make it even easier. The helloWorld service simply echos back to you what you pass it. moby-live/Perl/scripts/Services HelloWorldService.pm,NONE,1.1 PlanetLocalServices.pm,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Perl/scripts/Services/RCS/PlanetLocalServices.pm,v: No such file or directory From mwilkinson at pub.open-bio.org Wed Nov 12 11:47:16 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 11:47:16 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121647.hACGlGus011866@pub.open-bio.org> mwilkinson Wed Nov 12 11:47:16 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv11847/MOBY Modified Files: CommonSubs.pm Log Message: added a somewhat useful subroutine to common subs that will extract the content of a request as a string moby-live/Perl/MOBY CommonSubs.pm,1.27,1.28 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/08 17:21:31 1.27 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/12 16:47:16 1.28 @@ -157,6 +157,7 @@ getArticles getCollectedSimples getNodeContentWithArticle + extractRawContent collectionResponse validateNamespaces isSimpleArticle @@ -177,6 +178,7 @@ getArticles getCollectedSimples getNodeContentWithArticle + extractRawContent collectionResponse validateNamespaces isSimpleArticle @@ -768,6 +770,31 @@ =cut +=head2 extractRawContent + + name : extractRawContent + function : pass me an article (Simple, or Collection) and I'll give you the + content AS A STRING - i.e. the raw XML of the contained MOBY Object(s) + usage : extractRawContent($simple) + input : the one element of the output from getArticles + returns : string + +=cut + + +sub extractRawContent { + my ($article) = @_; + return "" unless $article; + return "" unless ref($article) =~ /XML::DOM/; + my $response; + foreach ($article->getChildNodes){ + $response .= $_->toString; + } + return $response; + +} + + sub getNodeContentWithArticle{ # give me a DOM, a TagName, an articleName and I will return you the content # of that node **as a string** (beware if there are additional XML tags in there!) From mwilkinson at pub.open-bio.org Wed Nov 12 11:49:13 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 11:49:13 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121649.hACGnDMM011910@pub.open-bio.org> mwilkinson Wed Nov 12 11:49:13 EST 2003 Update of /home/repository/moby/moby-live/Perl In directory pub.open-bio.org:/tmp/cvs-serv11891 Modified Files: MANIFEST Log Message: updated MANIFEST in anticipation of releasing a Makefile (finally!) moby-live/Perl MANIFEST,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MANIFEST,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Perl/MANIFEST 2003/06/03 16:28:50 1.4 +++ /home/repository/moby/moby-live/Perl/MANIFEST 2003/11/12 16:49:13 1.5 @@ -1,36 +1,52 @@ MANIFEST README Changes -config/MOBYPatch.pl Makefile.PL -docs/INSTALL-Central.txt -docs/INSTALL-Client.txt -docs/INSTALL-Service_Provider.txt -docs/html/Central.html -MOBY.pm MOBY/authority.pm MOBY/central_db_connection.pm MOBY/mysql.pm MOBY/OntologyServer.pm +MOBY/CommonSubs.pm +MOBY/CrossReference.pm MOBY/service_instance.pm MOBY/service_type.pm MOBY/simple_input.pm MOBY/simple_output.pm MOBY/Central.pm -MOBY/Central_WSDL_SandR.wsdl MOBY/Client/Central.pm MOBY/Client/Registration.pm MOBY/Client/ServiceInstance.pm +MOBY/Client/CollectionArticle.pm +MOBY/Client/OntologyServer.pm +MOBY/Client/ServiceInstance.pm +MOBY/Client/SimpleArticle.pm +MOBY/Client/SimpleInput.pm MOBY/Client/Service.pm -MOBY/Services/BasicLocalServices.pm -MOBY/Services/Services.cgi t/Central.t t/Client-Central.t t/Registration.t t/ServiceInstance.t t/Service.t t/BasicLocalServices.t +scripts/debugYourService scripts/MOBY-Central.pl scripts/Services.cgi scripts/testMOBYCentral_v05.pl -scripts/testMOBYClientCentral_v05.pl \ No newline at end of file +scripts/testMOBYClientCentral_v05.pl +scripts/OntologyServer.cgi +scripts/Services/HelloWorldService.pm +scripts/Services/LocalServices.pm +lsid/authority/authority.pl +lsid/authority/ClassResolver.pm +lsid/authority/dbConfigure.pm.template +lsid/authority/dbConnect.pm +lsid/authority/Error.pm +lsid/authority/metadata.pl +lsid/authority/NamespaceResolver.pm +lsid/authority/PredicateResolver.pm +lsid/authority/RDFConfigure.pm +lsid/authority/RelationshipResolver.pm +lsid/authority/ServiceInstanceResolver.pm +lsid/authority/ServiceResolver.pm + + From mwilkinson at pub.open-bio.org Wed Nov 12 12:05:48 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 12:05:48 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121705.hACH5mTL012057@pub.open-bio.org> mwilkinson Wed Nov 12 12:05:48 EST 2003 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv12037 Removed Files: BasicLocalServices.t Central.t Registration.t Service.t ServiceInstance.t Log Message: removing outdated test files moby-live/Perl/t BasicLocalServices.t,1.1,NONE Central.t,1.1,NONE Registration.t,1.1,NONE Service.t,1.1,NONE ServiceInstance.t,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Perl/t/RCS/BasicLocalServices.t,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/t/RCS/Central.t,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/t/RCS/Registration.t,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/t/RCS/Service.t,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/t/RCS/ServiceInstance.t,v: No such file or directory From mwilkinson at pub.open-bio.org Wed Nov 12 17:33:09 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 17:33:09 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311122233.hACMX9sJ013630@pub.open-bio.org> mwilkinson Wed Nov 12 17:33:09 EST 2003 Update of /home/repository/moby/moby-live/Perl In directory pub.open-bio.org:/tmp/cvs-serv13611 Modified Files: Makefile.PL Log Message: okay, now we have a makefile that actually WORKS moby-live/Perl Makefile.PL,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/Makefile.PL,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Perl/Makefile.PL 2003/11/12 17:31:42 1.5 +++ /home/repository/moby/moby-live/Perl/Makefile.PL 2003/11/12 22:33:09 1.6 @@ -3,6 +3,10 @@ my $VERSION = '0.1'; +system "mkdir lib" unless (-e 'lib' && -d 'lib'); # put the files into the lib directory so that they will be properly installed +system "cp -rf MOBY lib"; + + #my $WWW_ROOT_PATH = "/usr/local/apache" ; #my $CGI_BIN = "cgi-bin" ; #my $WWW_USER = "www" ; From sipuijvl3 at msn.com Sun Nov 16 19:40:42 2003 From: sipuijvl3 at msn.com (Robbie Herndon) Date: Mon, 17 Nov 03 00:40:42 GMT Subject: [MOBY-guts] V 1 @ G R A ---> 75% Cheaper Today! wtxu e Message-ID: An HTML attachment was scrubbed... URL: http://biomoby.org/pipermail/moby-guts/attachments/20031117/a3384af9/attachment.html From azaleeriecke at caste.loanprime.net Tue Nov 18 05:51:12 2003 From: azaleeriecke at caste.loanprime.net (Woman Solutions) Date: Tue, 18 Nov 2003 09:51:12 -0100 Subject: [MOBY-guts] Be the envy of all your friends! Message-ID: An HTML attachment was scrubbed... URL: http://biomoby.org/pipermail/moby-guts/attachments/20031118/5fa5ecf8/attachment.html From senger at pub.open-bio.org Thu Nov 20 12:08:47 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu, 20 Nov 2003 12:08:47 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311201708.hAKH8loo023950@pub.open-bio.org> senger Thu Nov 20 12:08:47 EST 2003 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv23931/docs Modified Files: ChangeLog Log Message: SOAPAction header added moby-live/Java/docs ChangeLog,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/09 01:05:02 1.5 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/20 17:08:46 1.6 @@ -1,3 +1,14 @@ +2003-11-20 Martin Senger + + * CentralImpl.call method can deal now with results of type byte[] + (base64 in the SOAP terminology). + + * CentralImpl sets now SOAPAction header. It was not needed when + accessing the Moby Central (registry) but some users started to + use CentralImpl also for calling services (by using + CentralImp.call method) and that usually required a SOAPAction + header. + 2003-11-09 Martin Senger * Added servlet properties for HTTP proxies and path to 'dot'. From senger at pub.open-bio.org Thu Nov 20 12:08:47 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu, 20 Nov 2003 12:08:47 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311201708.hAKH8lHq023969@pub.open-bio.org> senger Thu Nov 20 12:08:47 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv23931/src/main/org/biomoby/client Modified Files: CentralImpl.java Log Message: SOAPAction header added moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/08 00:27:24 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/20 17:08:47 1.4 @@ -133,6 +133,9 @@ Service service = new Service(); call = (Call) service.createCall(); call.setTargetEndpointAddress (endpoint); + + call.setSOAPActionURI (uri + "#" + method); + if (debug) { System.err.println ("METHOD CALL: " + method); System.err.println ("------------"); @@ -1067,6 +1070,9 @@ buf.append (tmp[i]); return new String (buf); } + if (result instanceof byte[]) + return new String ((byte[])result); + throw new MobyException ("Unknown type of result: " + result.getClass().getName()); } From mwilkinson at pub.open-bio.org Fri Nov 21 19:08:10 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Fri, 21 Nov 2003 19:08:10 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311220008.hAM08AY6029239@pub.open-bio.org> mwilkinson Fri Nov 21 19:08:10 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv29220/Perl/MOBY/Client Modified Files: Central.pm Log Message: small fix to allow local registries moby-live/Perl/MOBY/Client Central.pm,1.61,1.62 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.61 retrieving revision 1.62 diff -u -r1.61 -r1.62 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2003/11/04 15:05:45 1.61 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2003/11/22 00:08:10 1.62 @@ -247,6 +247,7 @@ my $url = $acc->{URL}; my $uri = $acc->{URI}; my $type = $acc->{TYPE}; + $type ||='soap'; if (lc($type) eq "get"){ push @{$self->Connections}, [$name, $type, $url]; } else { From mwilkinson at pub.open-bio.org Mon Nov 24 12:25:49 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon, 24 Nov 2003 12:25:49 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241725.hAOHPn5n014476@pub.open-bio.org> mwilkinson Mon Nov 24 12:25:49 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14453/Perl/MOBY Modified Files: Central.pm OntologyServer.pm Log Message: fixed bug reported by Martin this AM. Relationships method should now return only the relationships that you asked for, and should not return duplicates... I hope... moby-live/Perl/MOBY Central.pm,1.111,1.112 OntologyServer.pm,1.28,1.29 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.111 retrieving revision 1.112 diff -u -r1.111 -r1.112 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2003/11/01 16:42:13 1.111 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2003/11/24 17:25:48 1.112 @@ -234,13 +234,10 @@ if ($term =~ /FAILED/){return &_error("Malformed XML;","");} return &_error("Malformed XML; may be missing required parameters objectType, Description, authURI or contactEmail",""); } - # push @{$relationships{$relationshipType}}, [$objectType, $articleName]; - # validate that the final ontology will be valid + # validate that the final ontology will be valid by testing against existing relationships and such while (my ($reltype, $obj) = each %{$relationships}){ my ($success, $message, $URI) = $RelOntologyServer->relationshipExists(term => $reltype, ontology => 'object'); # success = 1 if it does $success==0 && return &_error($message, $URI ); - } - while (my ($reltype, $obj) = each %{$relationships}){ foreach (@{$obj}){ my ($objectType, $articleName) = @{$_}; my ($success, $message, $URI) = $OntologyServer->objectExists(term => $objectType); # success = 1 if it does @@ -291,19 +288,12 @@ my ($success, $message, $deleteURI) = $OntologyServer->deleteObject(term => $term); # hopefully this situation will never happen! $success==0 && return &_error("object failed ISA and/or HASA connections, and subsequently failed deletion. This is a critical error, - and may indicate corruption of the MOBY Central registry", $deleteURI); + and may indicate corruption of the MOBY Central registry.", $deleteURI); return &_error("object failed to register due to failure during registration of ISA/HASA relationships".(join ",", (@failures))."\n", ""); } return &_success("Object $term registered successfully.", $URI); } - # - # ExistingObjectType - # ... - # ... - # - #... - #... sub _registerObjectPayload { my ($payload) = @_; @@ -863,13 +853,61 @@ =item * only Input Secondary articles are defined during registration; Output Secondary objects are entirely optional and may or may not be interpreted Client-side using their articleName tags. +=item * Service Categories: + +=over 3 + +=item * moby - for services that use the MOBY SOAP messaging format and object structure (i.e. the objects used in service transaction inherit from the root 'Object' Class in the MOBY Class ontology). + +=item * soap - for other SOAP services that do not use the MOBY messaging format. The other elements in the registration should be interpreted as follows: + +=over 2 + +=item * authURI - a URI representing your organization (e.g. yourdomain.com); no http-prefix, and no trailing path information is allowed. + +=item * serviceName - an arbitrary, but unique, name for your service within your authURI namespace + +=item * URL - the URL from which a WSDL document describing your service can be retrieved by an HTTP GET call. + +=item * Comments about Input and Output: + +=over 2 + +=item * in "moby" services, the input and output messaging structure is defined by the BioMOBY API, and the services use data Objects that are defined in the Class ontology as inheriting from the root "Object" Class. For "soap" services, there is additional flexibility: + +=over 2 + +=item * Similar to a "moby" service, your "soap" service must consume/produce ontologically valid named data-types in order to be discovered by registry searches. As such, you _must_ register a single unique name for any non-MOBY input or output data Classes, regardless of the actual complexity of the input/output message. + +=item * Do this using the registerObjectClass call of MOBY Central; To ensure uniqueness and LSID compatibilty of data class names, you must name your data using the following format: your.authURI:dataClassName + +=item * remember, you may use any MOBY Object as your input/output (i.e. any Class Ontology term that inherits from Object) so long as you follow the MOBY message structure for that input or output. + +=item * You may register, for example, a service that consumes a non-MOBY data Class and outputs a MOBY data class, so long as you follow the MOBY Messaging format for the output data + +=item * You may register, for example, a service that consumes a MOBY data Class and outputs a non-MOBY data class, so long as you follow the MOBY Messaging format for the ihput data + +=item * NOTE: Nether of the cases above are considred MOBY services, and are therefore described in the category of "soap" service + +=item * When registering a non-MOBY data Class name, it DOES NOT have any "Relationship" component (see registerObjectClass API) + +=item * non-MOBY inputs or outputs are described as a single Primary, Simple article of your new named type. + +=back + +=item * secondaryArticles - not applicable; should be left out of message. + +=back + +=back + =back Input XML : - moby + moby YourServiceNameHere TypeOntologyTerm your.URI.here @@ -1025,7 +1063,7 @@ return &_error("Category may take the (case sensitive) values 'moby', 'cgi', 'soap'\n","") unless (($Category eq "est") || ($Category eq "cgi") || ($Category eq "moby")); $debug && &_LOG("Entering switch with $Category method\n"); - return &_error("Service categories other than 'moby' are not yet implemented","") unless ($Category eq "moby"); + return &_error("Service categories other than 'moby' and 'soap' are not yet implemented","") unless ($Category eq "moby" || $Category eq "soap"); my @IN = @{$INPUTS}; my @OUT = @{$OUTPUTS}; my @SECS = @{$SECONDARY}; @@ -1050,6 +1088,8 @@ return &_error("$message","$URI") unless ($valid); # right, registration should be successful now! + # "soap" services may only have one input and one output + my $SVC = MOBY::service_instance->new( category => $Category, servicename => $serviceName, @@ -2259,22 +2299,22 @@ my $doc = $Parser->parse($payload); my $x = $doc->getElementsByTagName("relationshipType"); - my $l = $x->getLength; # might be a Collection object with multiple simples... + my $l = $x->getLength; my $exp = $doc->getElementsByTagName("expandRelationship"); - my $expl = $exp->getLength; # might be a Collection object with multiple simples... + my $expl = $exp->getLength; my $expand_relationship = &_nodeTextContent($doc, 'expandRelationship'); $expand_relationship =~ s/\s//g; $expand_relationship ||=0; - my @reltypes; + my %reltypes; for (my $n=0; $n < $l; ++$n){ my @child = $x->item($n)->getChildNodes; foreach (@child){ next unless ($_->getNodeType == TEXT_NODE); my $name .= $_->toString; $name =~ s/\s//g; - push @reltypes, $name; + $reltypes{$name} = 1; } } @@ -2286,13 +2326,20 @@ $ontology ||="service"; # if we have now succeeded and haven't already taken the ontology then it must be the service ontology &_LOG("Ontology was $ontology; Term was $term\n"); my $OS = MOBY::OntologyServer->new(ontology => $ontology); - my %rels = %{$OS->Relationships(term => $term, expand => $expand_relationship)}; + my %rels = %{$OS->Relationships(term => $term, expand => $expand_relationship)}; # %rels = $rels{relationship} = [lsid, lsid,lsid] my $response="\n"; my $OSrel = MOBY::OntologyServer->new(ontology => 'relationship'); + foreach (keys %reltypes){ # for each of our desired types + my $rellsid = $OSrel->getRelationshipURI($ontology, $_); # get the LSID + delete $reltypes{$_}; # remove the non-LSID version from the hash + $reltypes{$rellsid} = 1; # set the LSID as valid + } + # now for each of the relationship types that we were returned foreach (keys %rels){ my $rellsid = $OSrel->getRelationshipURI($ontology, $_); next unless $rellsid; + next unless $reltypes{$rellsid}; # next unless it is one ofthe relationship types we requested my $lsids = $rels{$rellsid}; next unless $lsids->[0]; $response .="\n"; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2003/09/15 02:44:40 1.28 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2003/11/24 17:25:49 1.29 @@ -785,7 +785,7 @@ if ($direction eq 'root'){ unless (defined $relationship){ $defs = $self->dbh->selectall_arrayref(" - select s2.${ontology}_lsid, relationship_type from + select distinct s2.${ontology}_lsid, relationship_type from ${ontology}_term2term as t2t, $ontology as s1, $ontology as s2 @@ -795,7 +795,7 @@ s1.${ontology}_lsid = ?", undef, $term); # ") } else { $defs = $self->dbh->selectall_arrayref(" - select s2.${ontology}_lsid, relationship_type from + select distinct s2.${ontology}_lsid, relationship_type from ${ontology}_term2term as t2t, $ontology as s1, $ontology as s2 @@ -808,7 +808,7 @@ } else { unless (defined $relationship){ $defs = $self->dbh->selectall_arrayref(" - select s2.${ontology}_lsid, relationship_type from + select distinct s2.${ontology}_lsid, relationship_type from ${ontology}_term2term as t2t, $ontology as s1, $ontology as s2 @@ -818,7 +818,7 @@ s2.${ontology}_lsid = ?", undef, $term); # ") } else { $defs = $self->dbh->selectall_arrayref(" - select s2.${ontology}_lsid, relationship_type from + select distinct s2.${ontology}_lsid, relationship_type from ${ontology}_term2term as t2t, $ontology as s1, $ontology as s2 From mwilkinson at pub.open-bio.org Mon Nov 24 13:06:45 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon, 24 Nov 2003 13:06:45 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241806.hAOI6jwn015740@pub.open-bio.org> mwilkinson Mon Nov 24 13:06:45 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv15721/Perl/MOBY Modified Files: Central.pm Log Message: the default is supposed to return all, not nothing moby-live/Perl/MOBY Central.pm,1.112,1.113 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.112 retrieving revision 1.113 diff -u -r1.112 -r1.113 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2003/11/24 17:25:48 1.112 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2003/11/24 18:06:45 1.113 @@ -2339,7 +2339,9 @@ foreach (keys %rels){ my $rellsid = $OSrel->getRelationshipURI($ontology, $_); next unless $rellsid; - next unless $reltypes{$rellsid}; # next unless it is one ofthe relationship types we requested + if (keys %reltypes){ + next unless $reltypes{$rellsid}; # next unless it is one ofthe relationship types we requested + } my $lsids = $rels{$rellsid}; next unless $lsids->[0]; $response .="\n"; From senger at pub.open-bio.org Mon Nov 24 13:45:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Mon, 24 Nov 2003 13:45:25 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241845.hAOIjPMX016047@pub.open-bio.org> senger Mon Nov 24 13:45:25 EST 2003 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv16028/docs Modified Files: ChangeLog Log Message: added relationships methods to Central.java moby-live/Java/docs ChangeLog,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/20 17:08:46 1.6 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/24 18:45:25 1.7 @@ -1,3 +1,8 @@ +2003-11-24 Martin Senger + + * Added several new methods to Central.java dealing with + relationships. Consequently MobyCmdLineClient got few new options. + 2003-11-20 Martin Senger * CentralImpl.call method can deal now with results of type byte[] From senger at pub.open-bio.org Mon Nov 24 13:45:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Mon, 24 Nov 2003 13:45:25 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241845.hAOIjPnT016086@pub.open-bio.org> senger Mon Nov 24 13:45:25 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv16028/src/Clients/help Modified Files: MobyCmdLineClient_usage.txt Log Message: added relationships methods to Central.java moby-live/Java/src/Clients/help MobyCmdLineClient_usage.txt,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt 2003/10/17 13:13:34 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt 2003/11/24 18:45:25 1.3 @@ -33,6 +33,17 @@ -data print definition of given data type + To get ontological relationships of given entities: + + -ot + print all parents names of given service type + -od + print all relantionships (types and names) of given data type + -od2 ISA + -od2 HASA + -od2 HAS + print all relantionships of given type for given data type + To find services given by their attributes: -fn From senger at pub.open-bio.org Mon Nov 24 13:45:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Mon, 24 Nov 2003 13:45:25 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241845.hAOIjP1g016131@pub.open-bio.org> senger Mon Nov 24 13:45:25 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv16028/src/main/org/biomoby/shared Modified Files: Central.java Log Message: added relationships methods to Central.java moby-live/Java/src/main/org/biomoby/shared Central.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2003/09/24 14:33:37 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2003/11/24 18:45:25 1.2 @@ -14,7 +14,6 @@ /** * An interface to the Moby Registry. *

            - * * The Moby Registry service (or Moby Central service) is used to do * various transactions, including registering new Data and Service * types, querying for these types, registering new Services, or @@ -34,12 +33,29 @@ * http://biomoby.org. *

            * + *

            Last changes (in backwards order)
            + *
              + *
            • New methods retrieving various types of relationships has been added: + * {@link #getDataTypeRelationships}, + * {@link #getServiceTypeRelationships} + *
            • Added constants defining recognizable relationship types + * ({@link #ISA}, {@link #HASA}, {@link #HAS}) + *
            + *

            * @author Martin Senger * @version $Id$ */ public interface Central { + /** A name for the relationship type "is a". */ + static final String ISA = "ISA"; + + /** A name for the relationship type "has a". */ + static final String HASA = "HASA"; + + /** A name for the relationship type "has". */ + static final String HAS = "HAS"; /************************************************************************** * Get a (redundant) list of all registered service names. @@ -71,6 +87,18 @@ throws MobyException; /************************************************************************** + * Get all ISA relationships of the given 'serviceTypeName'. + *

            + * @param serviceTypeName is an ontology term specifying whose + * relationships should be looked at + * @return an array of ontology terms defining all parents (direct + * or indirect) of the given 'serviceTypeName' + * @throws MobyException if communication with the Moby Registry fails + *************************************************************************/ + String[] getServiceTypeRelationships (String serviceTypeName) + throws MobyException; + + /************************************************************************** * Get the list of all registered namespaces. *

            * @return a hash table where keys are names of namespaces while @@ -99,6 +127,34 @@ MobyDataType getDataType (String dataTypeName) throws MobyException, NoSuccessException; + /************************************************************************** + * Get all relationships of the given 'dataTypeName'. + *

            + * @param dataTypeName is an ontology term specifying whose + * relationships should be looked at + * @return a Map of ontology terms defining all relationships of + * the given 'dataTypeName'. The keys (of type String) are from + * the set {@link #ISA}, {@link #HASA}, and {@link #HAS}. The + * values (of type String) are data type names. + * @throws MobyException if communication with the Moby Registry fails + *************************************************************************/ + Map getDataTypeRelationships (String dataTypeName) + throws MobyException; + + /************************************************************************** + * Get all relationships of type 'relationshipType' for the given + *'dataTypeName'.

            + * @param dataTypeName is an ontology term specifying whose + * relationships should be looked at + * @param relationshipType is one from the set {@link #ISA}, + * {@link #HASA}, and {@link #HAS}. + * @return an array of names specifying all related types (of the + * given type and for the given data type) + * @throws MobyException if communication with the Moby Registry fails + *************************************************************************/ + String[] getDataTypeRelationships (String dataTypeName, String relationshipType) + throws MobyException; + /************************************************************************* * Get XML Schema definition of the given data type. *

            From senger at pub.open-bio.org Mon Nov 24 13:45:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Mon, 24 Nov 2003 13:45:25 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241845.hAOIjPpH016066@pub.open-bio.org> senger Mon Nov 24 13:45:25 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv16028/src/Clients Modified Files: MobyCmdLineClient.java Log Message: added relationships methods to Central.java moby-live/Java/src/Clients MobyCmdLineClient.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2003/09/24 12:33:50 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2003/11/24 18:45:25 1.2 @@ -172,6 +172,35 @@ param.substring (pos+1))); } + if ((param = cmd.getParam ("-ot")) != null ) { + decorationLn ("Service type '" + param + "' is-a:"); + decorationLn ("------------"); + System.out.println (StringUtils.join (worker.getServiceTypeRelationships (param), + "\n")); + } + + if ((param = cmd.getParam ("-od")) != null ) { + decorationLn ("Relationships of data type '" + param + "':"); + decorationLn ("--------------------------"); + Map types = worker.getDataTypeRelationships (param); + + for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + System.out.println (entry.getKey()); + System.out.println ("\t" + + StringUtils.join ((String[])entry.getValue(), + "\n\t")); + } + } + + String[] params = cmd.getParam ("-od2", 2); + if ((params != null && params[0] != null && params[1] != null)) { + decorationLn ("Relationships of data type '" + params[0] + "' of type '" + params[1] + "':"); + decorationLn ("--------------------------"); + System.out.println (StringUtils.join (worker.getDataTypeRelationships (params[0], params[1]), + "\n")); + } + // // registrations of various entities // @@ -468,7 +497,7 @@ // // call a raw method (for debugging) // - String[] params = null; + params = null; if ((params = cmd.getParam ("-call", 2)) != null ) { if (params[0] != null) { if (params[1] == null) { From senger at pub.open-bio.org Mon Nov 24 13:45:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Mon, 24 Nov 2003 13:45:25 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241845.hAOIjPwp016108@pub.open-bio.org> senger Mon Nov 24 13:45:25 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv16028/src/main/org/biomoby/client Modified Files: CentralImpl.java Log Message: added relationships methods to Central.java moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/20 17:08:47 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/24 18:45:25 1.5 @@ -628,7 +628,7 @@ /************************************************************************** * The 'retrieveObjectDefinition' method returns something like this; * - * + * * urn:lsid:biomoby.org:objectclass:go_term * * http://www.illuminae.com @@ -640,7 +640,7 @@ * urn:lsid:biomoby.org:objectclass:string * urn:lsid:biomoby.org:objectclass:string * - * + * * *************************************************************************/ public MobyDataType getDataType (String dataTypeName) @@ -1083,4 +1083,139 @@ this.debug = debug; } + /************************************************************************** + * The 'Relationships' method returns something like this; + * + * + * + * urn:lsid:biomoby.org:servicetype:analysis + * urn:lsid:biomoby.org:servicetype:service + * + * + *************************************************************************/ + public String[] getServiceTypeRelationships (String serviceTypeName) + throws MobyException { + String result = + (String)doCall ("Relationships", + new Object[] { + "" + + "" + serviceTypeName + "" + + "" + Central.ISA + "" + + "1" + + "" + }); + + // parse returned XML + Vector v = new Vector(); + Document document = parser.parse (new StringReader (result)); + NodeList list = document.getElementsByTagName ("Relationship"); + for (int i = 0; i < list.getLength(); i++) { + Element elem = (Element)list.item (i); + NodeList children = elem.getChildNodes(); + for (int j = 0; j < children.getLength(); j++) { + if (children.item (j).getNodeName().equals ("serviceType")) { + v.addElement (children.item (j).getFirstChild().getNodeValue()); + } + } + } + String[] results = new String [v.size()]; + v.copyInto (results); + return results; + } + + /************************************************************************** + * The 'Relationships' method returns something like this; + * + * + * + * urn:lsid:biomoby.org:objectclass:virtualsequence + * urn:lsid:biomoby.org:objectclass:object + * + * + * urn:lsid:biomoby.org:objectclass:string + * urn:lsid:biomoby.org:objectclass:integer + * + * + * + *************************************************************************/ + public Map getDataTypeRelationships (String dataTypeName) + throws MobyException { + String result = + (String)doCall ("Relationships", + new Object[] { + "" + + "" + dataTypeName + "" + + "" + Central.ISA + "" + + "" + Central.HASA + "" + + "" + Central.HAS + "" + + "1" + + "" + }); + + // parse returned XML + Map results = new HashMap(); + Document document = parser.parse (new StringReader (result)); + NodeList list = document.getElementsByTagName ("Relationship"); + + for (int i = 0; i < list.getLength(); i++) { + Element elem = (Element)list.item (i); + String relType = elem.getAttribute ("relationshipType"); + NodeList children = elem.getChildNodes(); + Vector v = new Vector(); + for (int j = 0; j < children.getLength(); j++) { + if (children.item (j).getNodeName().equals ("objectType")) { + v.addElement (children.item (j).getFirstChild().getNodeValue()); + } + } + String[] names = new String [v.size()]; + v.copyInto (names); + results.put (relType, names); + } + return results; + } + + /************************************************************************** + * The 'Relationships' method returns something like this; + * + * + * + * urn:lsid:biomoby.org:objectclass:virtualsequence + * urn:lsid:biomoby.org:objectclass:object + * + * + * + *************************************************************************/ + public String[] getDataTypeRelationships (String dataTypeName, + String relationshipType) + throws MobyException { + String result = + (String)doCall ("Relationships", + new Object[] { + "" + + "" + dataTypeName + "" + + "" + relationshipType + "" + + "1" + + "" + }); + + // parse returned XML + Vector v = new Vector(); + Document document = parser.parse (new StringReader (result)); + NodeList list = document.getElementsByTagName ("Relationship"); + + // it should always be just one element in this list + for (int i = 0; i < list.getLength(); i++) { + Element elem = (Element)list.item (i); + NodeList children = elem.getChildNodes(); + for (int j = 0; j < children.getLength(); j++) { + if (children.item (j).getNodeName().equals ("objectType")) { + v.addElement (children.item (j).getFirstChild().getNodeValue()); + } + } + } + String[] results = new String [v.size()]; + v.copyInto (results); + return results; + } + } From senger at pub.open-bio.org Tue Nov 25 08:18:10 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue, 25 Nov 2003 08:18:10 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIA1x019447@pub.open-bio.org> senger Tue Nov 25 08:18:10 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv19385/src/Clients Modified Files: MobyCmdLineClient.java MobyGraphs.java Log Message: added buglist for graphs; code cleaning moby-live/Java/src/Clients MobyCmdLineClient.java,1.2,1.3 MobyGraphs.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2003/11/24 18:45:25 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2003/11/25 13:18:10 1.3 @@ -175,7 +175,7 @@ if ((param = cmd.getParam ("-ot")) != null ) { decorationLn ("Service type '" + param + "' is-a:"); decorationLn ("------------"); - System.out.println (StringUtils.join (worker.getServiceTypeRelationships (param), + System.out.println (StringUtils.join (worker.getServiceTypeRelationships (param, true), "\n")); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2003/11/08 00:27:24 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2003/11/25 13:18:10 1.3 @@ -106,6 +106,38 @@ } // + // create a graph with service types + // + if (cmd.hasOption ("-t")) { + + // get all services types + v.clear(); + decorationLn ("Asking for all service types..."); + Map types = worker.getServiceTypes(); + for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String typeName = (String)entry.getKey(); + decorationLn ("Processing service type " + typeName + "..."); + MobyServiceType serviceType = new MobyServiceType (typeName); + serviceType.setDescription ((String)entry.getKey()); + serviceType.setParentNames (worker.getServiceTypeRelationships (typeName, false)); + v.addElement (serviceType); + } + decorationLn (""); + MobyServiceType[] serviceTypes = new MobyServiceType [v.size()]; + v.copyInto (serviceTypes); + decorationLn ("Creating a graph of the service types..."); + String graph = Graphviz.createServiceTypesGraph (serviceTypes, props); + param = cmd.getParam ("-ft"); + if (param == null) + param = cmd.getParam ("-f"); + if (param == null) + System.out.println (graph); + else + createFile (param, graph); + } + + // // create a graph with services // if (cmd.hasOption ("-s")) { From senger at pub.open-bio.org Tue Nov 25 08:18:11 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue, 25 Nov 2003 08:18:11 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIBU5019525@pub.open-bio.org> senger Tue Nov 25 08:18:11 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv19385/src/main/org/biomoby/shared Modified Files: Central.java Utils.java Log Message: added buglist for graphs; code cleaning moby-live/Java/src/main/org/biomoby/shared Central.java,1.2,1.3 Utils.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2003/11/24 18:45:25 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2003/11/25 13:18:11 1.3 @@ -89,13 +89,16 @@ /************************************************************************** * Get all ISA relationships of the given 'serviceTypeName'. *

            - * @param serviceTypeName is an ontology term specifying whose + * @param serviceTypeName is a service type name whose * relationships should be looked at - * @return an array of ontology terms defining all parents (direct - * or indirect) of the given 'serviceTypeName' + * @param expand 'true' causes that all related type names are + * returned, 'false' means that only first-level neighbour is returned + * @return an array of service type names representing all parents + * (direct or indirect) of the given 'serviceTypeName' * @throws MobyException if communication with the Moby Registry fails *************************************************************************/ - String[] getServiceTypeRelationships (String serviceTypeName) + String[] getServiceTypeRelationships (String serviceTypeName, + boolean expand) throws MobyException; /************************************************************************** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java 2003/10/17 13:13:35 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java 2003/11/25 13:18:11 1.3 @@ -189,7 +189,7 @@ /************************************************************************* * Return just the last part of the LSID identifier. An example of - * an LSID identrifier as used by and returned from the Moby + * an LSID identifier as used by and returned from the Moby * registry is urn:lsid:biomoby.org:objectclass:object. *

            * From senger at pub.open-bio.org Tue Nov 25 08:18:11 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue, 25 Nov 2003 08:18:11 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIBqA019496@pub.open-bio.org> senger Tue Nov 25 08:18:10 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv19385/src/main/org/biomoby/client Modified Files: CentralImpl.java GraphsServlet.java Graphviz.java Log Message: added buglist for graphs; code cleaning moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.5,1.6 GraphsServlet.java,1.3,1.4 Graphviz.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/24 18:45:25 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/25 13:18:10 1.6 @@ -1093,7 +1093,8 @@ * * *************************************************************************/ - public String[] getServiceTypeRelationships (String serviceTypeName) + public String[] getServiceTypeRelationships (String serviceTypeName, + boolean expand) throws MobyException { String result = (String)doCall ("Relationships", @@ -1101,7 +1102,7 @@ "" + "" + serviceTypeName + "" + "" + Central.ISA + "" + - "1" + + "" + (expand ? "1" : "0") + "" + "" }); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/09 01:52:28 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/25 13:18:10 1.4 @@ -21,7 +21,8 @@ /** - * A servlet making graphs of Moby services and Moby data types.

            + * A servlet making graphs of Moby service instances, Moby data types, + * and Moby service types.

            * * @author Martin Senger * @version $Id$ @@ -119,6 +120,7 @@ // these are filled in the static initializer static String[] supportedTypesForData; static String[] supportedTypesForServices; + static String[] supportedTypesForServiceTypes; static Hashtable contentTypes; static Hashtable displayNamesForTypes; @@ -137,6 +139,7 @@ boolean verbose = false; MobyDataType[] dataTypes; MobyService[] services; + MobyServiceType[] serviceTypes; long lastRead = -1; // in millis long refreshInterval = -1; // in millis @@ -166,6 +169,8 @@ T_PNG, T_GIF, T_JPG, T_PS, T_SVG, T_VRML, T_MIF, /* T_IMAP, T_CMAP, */ T_HPGL, T_PCL, T_FIG, T_DOT, T_CANON, T_PLAIN, T_RDF }; + supportedTypesForServiceTypes = supportedTypesForData; + displayNamesForTypes = new Hashtable(); displayNamesForTypes.put (T_PNG, "PNG - Portable Network Graphics"); displayNamesForTypes.put (T_GIF, "GIF Bitmap image"); @@ -298,8 +303,8 @@ worker.doGraphDataTypes (req, res); else if (exists (req, ACTION_JOB_SERVI)) worker.doGraphServices (req, res); -// else if (exists (req, ACTION_JOB_SERVT)) -// worker.doGraphServiceTypes (req, res); + else if (exists (req, ACTION_JOB_SERVT)) + worker.doGraphServiceTypes (req, res); else worker.doEntryPage (req, res); } @@ -543,6 +548,30 @@ h.submit (" Create Graph of Data Types ", ACTION_JOB_DATA))); out.println (h.end (BLOCKQUOTE)); + // --------------------------------------------- + out.println (h.gen (H3, "Graph of service types")); + // --------------------------------------------- + out.println (start (BLOCKQUOTE)); + + labels = null; + values = null; + synchronized (supportedTypesForServiceTypes) { + labels = new String [supportedTypesForServiceTypes.length]; + values = new String [supportedTypesForServiceTypes.length]; + for (int i = 0; i < supportedTypesForServiceTypes.length; i++) { + labels[i] = (String)displayNamesForTypes.get (supportedTypesForServiceTypes[i]); + values[i] = supportedTypesForServiceTypes[i]; + } + } + selected.clear(); + selected.put (T_PNG, "1"); + + out.println ("Select output type: "); + out.println (h.list (OUTPUT_TYPE_SERVT, labels, values, selected)); + out.println (h.gen (P, + h.submit (" Create Graph of Service Types ", ACTION_JOB_SERVT))); + out.println (h.end (BLOCKQUOTE)); + // ------------------------------------------------------------- out.println (h.gen (H3, "Additional visualization properties")); // ------------------------------------------------------------- @@ -657,39 +686,13 @@ } // create the real graphs (or an RDF representation) - String graph; if (wantedOutputType.equals (T_RDF)) { - graph = RDF.createServicesGraph (edges, props); + String graph = RDF.createServicesGraph (edges, props); cache.setContents (id, graph.getBytes()); } else { - graph = Graphviz.createServicesGraph (edges, props); - - // where is the 'dot' program - String dotProg = "dot"; - String dotPath = (String)initParams.get (DOT_PATH); - if (dotPath != null) - dotProg = dotPath + System.getProperty ("file.separator") + dotProg; - - // depending on the cache implementation we may ask - // 'dot' to produce output to its standard output, or - // to write to a file - if (cache.supportsFilenames()) { - - // note that this filename represents a not-yet-existing file - String filename = cache.getFilename (id); - - // call 'dot' to create a real graph in a 'filename' - executeDot (dotProg, graph, wantedOutputType, filename); - - } else { - - // call 'dot' to return a real graph as byte array - byte[] graphBytes = executeDot (dotProg, graph, wantedOutputType); - if (graphBytes == null || graphBytes.length == 0) - throw new MobyException ("An empty graph. Strange."); - cache.setContents (id, graphBytes); - } + createGraph (id, wantedOutputType, + Graphviz.createServicesGraph (edges, props)); } } res.sendRedirect (res.encodeRedirectURL (cache.getURL (id))); @@ -737,34 +740,56 @@ if (! cache.exists (id)) { // create a dot definition of the graph log ("Creating a graph of the data types...\n"); - String dotGraph = Graphviz.createDataTypesGraph (dataTypes, props); - - - // where is the 'dot' program - String dotProg = "dot"; - String dotPath = (String)initParams.get (DOT_PATH); - if (dotPath != null) - dotProg = dotPath + System.getProperty ("file.separator") + dotProg; - - // depending on the cache implementation we may ask - // 'dot' to produce output to its standard output, or - // to write to a file - if (cache.supportsFilenames()) { + createGraph (id, wantedOutputType, + Graphviz.createDataTypesGraph (dataTypes, props)); + } + res.sendRedirect (res.encodeRedirectURL (cache.getURL (id))); + + } catch (MobyException e) { + error (res, res.SC_SERVICE_UNAVAILABLE, e); + return; + } + } - // note that this filename represents a not-yet-existing file - String filename = cache.getFilename (id); + /************************************************************************* + * Create and return a graph of Moby service types. + *************************************************************************/ + protected void doGraphServiceTypes (HttpServletRequest req, HttpServletResponse res) + throws ServletException, IOException { - // call 'dot' to create a real graph in a 'filename' - executeDot (dotProg, dotGraph, wantedOutputType, filename); + // check if the output type is supported + String wantedOutputType = getString (req, OUTPUT_TYPE_SERVT); + if (wantedOutputType == null) + wantedOutputType = T_PNG; + boolean supported = false; + for (int i = 0; i < supportedTypesForServiceTypes.length; i++) { + if (supportedTypesForServiceTypes[i].equals (wantedOutputType)) { + supported = true; + break; + } + } + if (! supported) { + error (res, res.SC_SERVICE_UNAVAILABLE, + new MobyException ("Unrecognized output type '" + wantedOutputType + "'.")); + return; + } - } else { + // collect visualization properties + Properties props = new Properties(); + String rankdir = getString (req, RANKDIR); + if (rankdir != null) + props.put (Graphviz.PROP_RANKDIR, rankdir); - // call 'dot' to return a real graph as byte array - byte[] graph = executeDot (dotProg, dotGraph, wantedOutputType); - if (graph == null || graph.length == 0) - throw new MobyException ("An empty graph. Strange."); - cache.setContents (id, graph); - } + try { + // perhaps we have the same graph in the cache already + props.entrySet().toArray(); + String id = cache.createId (endpoint, GRAPH_SERVT, + wantedOutputType, lastRead, props); + if (! cache.exists (id)) { + // create a dot definition of the graph + log ("Creating a graph of the services types...\n"); + createGraph (id, wantedOutputType, + Graphviz.createServiceTypesGraph (serviceTypes, props)); } res.sendRedirect (res.encodeRedirectURL (cache.getURL (id))); @@ -777,9 +802,44 @@ /******************************************************************** * ********************************************************************/ + protected void createGraph (String id, + String wantedOutputType, + String graph) + throws MobyException, IOException { + + // where is the 'dot' program + String dotProg = "dot"; + String dotPath = (String)initParams.get (DOT_PATH); + if (! UUtils.isEmpty (dotPath)) + dotProg = dotPath + System.getProperty ("file.separator") + dotProg; + + // depending on the cache implementation we may ask + // 'dot' to produce output to its standard output, or + // to write to a file + if (cache.supportsFilenames()) { + + // note that this filename represents a not-yet-existing file + String filename = cache.getFilename (id); + + // call 'dot' to create a real graph in a 'filename' + executeDot (dotProg, graph, wantedOutputType, filename); + + } else { + + // call 'dot' to return a real graph as byte array + byte[] graphBytes = executeDot (dotProg, graph, wantedOutputType); + if (graphBytes == null || graphBytes.length == 0) + throw new MobyException ("An empty graph. Strange."); + cache.setContents (id, graphBytes); + } + } + + /******************************************************************** + * + ********************************************************************/ protected void readRegistryIfNeeded() throws MobyException { - if (dataTypes == null || services == null) { + if (dataTypes == null || services == null || serviceTypes == null) { readRegistry(); return; } @@ -827,6 +887,22 @@ dataTypes = new MobyDataType [v.size()]; v.copyInto (dataTypes); + // read all services types and their relationships + v.clear(); + log ("Asking for all service types...\n"); + types = registry.getServiceTypes(); + for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String typeName = (String)entry.getKey(); + log ("Processing service type " + typeName + "...\n"); + MobyServiceType serviceType = new MobyServiceType (typeName); + serviceType.setDescription ((String)entry.getKey()); + serviceType.setParentNames (registry.getServiceTypeRelationships (typeName, false)); + v.addElement (serviceType); + } + serviceTypes = new MobyServiceType [v.size()]; + v.copyInto (serviceTypes); + // read all services v.clear(); log ("Asking for all service names...\n"); @@ -1024,7 +1100,7 @@ h.gen (HR) + h.gen (DIV, ALIGN, "right", h.gen (FONT, SIZE, "-2", h.gen (ADDRESS, contact) + - "Last modified: " + UUtils.formatDate())); + "Page created: " + UUtils.formatDate())); } /************************************************************************* =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/Graphviz.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/Graphviz.java 2003/10/17 13:13:34 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/Graphviz.java 2003/11/25 13:18:10 1.2 @@ -157,6 +157,44 @@ } /************************************************************************* + * Creates a graph connecting 'serviceTypes' using their ISA + * relationship.

            + * + * @param servicesTypes represent nodes in the created graph + * @param props are some properties that can influence how the + * graph will look like; see the property names elswhere in this + * API what properties are understood + * + * @return a string with all definitions as understood by 'dot' + * program (from the graphviz package); this string can be saved + * in a '.dot' file that can be passed to a dot program to produce + * graphs in many available formats + * + *************************************************************************/ + static public String createServiceTypesGraph (MobyServiceType[] serviceTypes, + Properties props) { + + StringBuffer buf = new StringBuffer(); + buf.append ("digraph MobyServicesTypes {\n"); + buf.append ("\trankdir=" + props.getProperty (PROP_RANKDIR, "LR") + ";\n"); + buf.append ("\tedge [dir=back,arrowtail=empty];\n"); + for (int t = 0; t < serviceTypes.length; t++) { + MobyServiceType type = serviceTypes[t]; + String name = Utils.pureName (type.getName()); + String[] parents = type.getParentNames(); + for (int i = 0; i < parents.length; i++) { + buf.append ("\t"); + buf.append (trName (Utils.pureName (parents[i])).toLowerCase()); + buf.append (" -> "); + buf.append (trName (name).toLowerCase()); + buf.append (";\n"); + } + } + buf.append ("}\n"); + return new String (buf); + } + + /************************************************************************* * Append 'value' to 'buf'. If it is not the first value there, it * prefix it by a comma. *************************************************************************/ From senger at pub.open-bio.org Tue Nov 25 08:18:10 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue, 25 Nov 2003 08:18:10 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIAXI019423@pub.open-bio.org> senger Tue Nov 25 08:18:10 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs In directory pub.open-bio.org:/tmp/cvs-serv19385/docs/graphs Modified Files: index.html Added Files: buglist.html Log Message: added buglist for graphs; code cleaning moby-live/Java/docs/graphs buglist.html,NONE,1.1 index.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/graphs/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/docs/graphs/index.html 2003/11/09 01:05:02 1.2 +++ /home/repository/moby/moby-live/Java/docs/graphs/index.html 2003/11/25 13:18:10 1.3 @@ -76,7 +76,7 @@

            The main features

              -
            • graphs of data types and service instances +
            • graphs of data types, service instances, and service types
            • selection on variety of output types (including common image formats, but also scalable vector graphics and RDF)
            • possibility to display only some services and some authorities, or to decide @@ -113,8 +113,10 @@
            • Add an option to "show only" or "do not show at all" the orphan services.
            • Add a better support for saving graphs into local files. -
            • Graphs of the service types - this can be done after BioMoby - registry makes this information accessible in its API. +
            • Add a graph showing pathes from input data-type to output data-type. +

              + +

            • And there is a Bug List to work on...

            @@ -126,7 +128,7 @@

            Suggestions, comments, and bug reports to:
            Martin Senger
            -Last modified: Sun Nov 9 00:21:16 2003 +Last modified: Tue Nov 25 12:56:31 2003
            From senger at pub.open-bio.org Tue Nov 25 08:18:10 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue, 25 Nov 2003 08:18:10 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIAU3019404@pub.open-bio.org> senger Tue Nov 25 08:18:10 EST 2003 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv19385/docs Modified Files: ChangeLog Log Message: added buglist for graphs; code cleaning moby-live/Java/docs ChangeLog,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/24 18:45:25 1.7 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/25 13:18:10 1.8 @@ -1,5 +1,7 @@ 2003-11-24 Martin Senger + * Added graphs of service types. + * Added several new methods to Central.java dealing with relationships. Consequently MobyCmdLineClient got few new options. From senger at pub.open-bio.org Tue Nov 25 08:18:10 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue, 25 Nov 2003 08:18:10 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIAQU019467@pub.open-bio.org> senger Tue Nov 25 08:18:10 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv19385/src/Clients/help Modified Files: MobyGraphs_usage.txt Log Message: added buglist for graphs; code cleaning moby-live/Java/src/Clients/help MobyGraphs_usage.txt,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2003/11/08 00:27:24 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2003/11/25 13:18:10 1.3 @@ -5,8 +5,8 @@ -q ... quiet mode -d ... graph showing data types - -s ... graph showing services - -t ... reserved: for the graph of service types + -s ... graph showing service instances + -t ... graph showing service types output format: -dot ... (this is default) @@ -26,10 +26,12 @@ (makes sense only together with -d) -fs ... where to put the services graph (makes sense only together with -s) + -ft ... where to put the service types graph + (makes sense only together with -t) -f ... where to put (any) created graph - (makes sense only together with -d or -s, - but does not make sense if both -d and -s - are used) + (makes sense only together with -d, -s, + or -t, but does not make sense if two + or even all three of them are used) default: standard output graph properties: From f31dnvt at yahoo.com Wed Nov 26 02:37:56 2003 From: f31dnvt at yahoo.com (Queen Mccoy) Date: Wed, 26 Nov 03 07:37:56 GMT Subject: [MOBY-guts] re: FRee P-E-N-l-S PlLLZ WOW!! vo Message-ID: An HTML attachment was scrubbed... URL: http://biomoby.org/pipermail/moby-guts/attachments/20031126/a3807d8f/attachment.html From cherburtner at lauvabrum.hasmoved.com Tue Nov 4 15:59:34 2003 From: cherburtner at lauvabrum.hasmoved.com (Female Update) Date: Tue, 04 Nov 2003 14:59:34 -0100 Subject: [MOBY-guts] L|ps SO Plump - your friends will be envious! Message-ID: An HTML attachment was scrubbed... URL: From sixtadenby at prorsus.prospectivebuyers.com Tue Nov 11 11:11:32 2003 From: sixtadenby at prorsus.prospectivebuyers.com (Beauty Secret) Date: Tue, 11 Nov 2003 04:11:32 -0700 Subject: [MOBY-guts] Get Plumper & Sexier L|ps Message-ID: An HTML attachment was scrubbed... URL: From senger at pub.open-bio.org Sun Nov 9 01:05:02 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Sat, 8 Nov 2003 20:05:02 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311090105.hA9152W9021554@pub.open-bio.org> senger Sat Nov 8 20:05:02 EST 2003 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv21510/docs Modified Files: ChangeLog Log Message: moby-live/Java/docs ChangeLog,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/08 00:27:24 1.4 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/09 01:05:02 1.5 @@ -1,3 +1,7 @@ +2003-11-09 Martin Senger + + * Added servlet properties for HTTP proxies and path to 'dot'. + 2003-11-07 Martin Senger * Added BioMoby Graphs (command-line client and a servlet-based From senger at pub.open-bio.org Sun Nov 9 01:52:28 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Sat, 8 Nov 2003 20:52:28 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311090152.hA91qSQj021795@pub.open-bio.org> senger Sat Nov 8 20:52:28 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv21776/src/main/org/biomoby/client Modified Files: GraphsServlet.java Log Message: moby-live/Java/src/main/org/biomoby/client GraphsServlet.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/09 01:05:02 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/09 01:52:28 1.3 @@ -667,9 +667,9 @@ // where is the 'dot' program String dotProg = "dot"; - String dotPath = getString (req, DOT_PATH); + String dotPath = (String)initParams.get (DOT_PATH); if (dotPath != null) - dotProg = dotPath + System.getProperty ("file.sparator") + dotProg; + dotProg = dotPath + System.getProperty ("file.separator") + dotProg; // depending on the cache implementation we may ask // 'dot' to produce output to its standard output, or @@ -742,9 +742,9 @@ // where is the 'dot' program String dotProg = "dot"; - String dotPath = getString (req, DOT_PATH); + String dotPath = (String)initParams.get (DOT_PATH); if (dotPath != null) - dotProg = dotPath + System.getProperty ("file.sparator") + dotProg; + dotProg = dotPath + System.getProperty ("file.separator") + dotProg; // depending on the cache implementation we may ask // 'dot' to produce output to its standard output, or From senger at pub.open-bio.org Sat Nov 8 00:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:27:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROes017330@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv17161/src/Clients/help Modified Files: MobyGraphs_usage.txt Log Message: added graphs for exploring biomoby registry moby-live/Java/src/Clients/help MobyGraphs_usage.txt,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2003/10/17 13:13:34 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2003/11/08 00:27:24 1.2 @@ -1,15 +1,27 @@ Usage: java MobyGraphs -h[elp] - java MobyGraphs [] + java MobyGraphs -q ... quiet mode - -debug ... print debug messages -d ... graph showing data types -s ... graph showing services -t ... reserved: for the graph of service types - outputs: + output format: + -dot ... (this is default) + -rdf ... (this works only for graph of services) + + output filter (what to be included, + only used for services): + -auth + -name + -depth ... an integer, how far to go from + given services (default is 1) + or + -path + + output destinations: -fd ... where to put the data types graph (makes sense only together with -d) -fs ... where to put the services graph From mwilkinson at pub.open-bio.org Wed Nov 12 16:08:52 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 11:08:52 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121608.hACG8qhe011391@pub.open-bio.org> mwilkinson Wed Nov 12 11:08:52 EST 2003 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv11376 Added Files: debug_a_service.pl Log Message: added a simple service debugging script moby-live/Perl/scripts debug_a_service.pl,NONE,1.1 From mwilkinson at pub.open-bio.org Wed Nov 12 16:12:47 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 11:12:47 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121612.hACGCl3K011506@pub.open-bio.org> mwilkinson Wed Nov 12 11:12:47 EST 2003 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv11491 Added Files: debugYourService Log Message: oops. Forgot to set the executable flag. Have to rename the file to get CVS to accept this kind of change moby-live/Perl/scripts debugYourService,NONE,1.1 From senger at pub.open-bio.org Sun Nov 9 01:05:02 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Sat, 8 Nov 2003 20:05:02 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311090105.hA9152Df021535@pub.open-bio.org> senger Sat Nov 8 20:05:02 EST 2003 Update of /home/repository/moby/moby-live/Java In directory pub.open-bio.org:/tmp/cvs-serv21510 Modified Files: build.properties.template build.xml Log Message: moby-live/Java build.properties.template,1.1,1.2 build.xml,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.properties.template,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/build.properties.template 2003/11/08 00:27:23 1.1 +++ /home/repository/moby/moby-live/Java/build.properties.template 2003/11/09 01:05:02 1.2 @@ -7,6 +7,11 @@ build.compiler = jikes +#dot.path = /path/to/dot +#proxySet = true +#http.proxyHost = your proxy host +#http.proxyPort = your proxy port + # all other properties are used only if you wish to deploy jMoby # servlets into your Tomcat - the more verbose description of these # properties is in the deployment descriptor in =================================================================== RCS file: /home/repository/moby/moby-live/Java/build.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/build.xml 2003/11/08 21:05:51 1.5 +++ /home/repository/moby/moby-live/Java/build.xml 2003/11/09 01:05:02 1.6 @@ -196,6 +196,18 @@ + + + + + + + + + + + + @@ -380,6 +392,10 @@ + + + + senger Sat Nov 8 20:05:02 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs In directory pub.open-bio.org:/tmp/cvs-serv21510/docs/graphs Modified Files: index.html Log Message: moby-live/Java/docs/graphs index.html,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/graphs/index.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/graphs/index.html 2003/11/08 00:27:24 1.1 +++ /home/repository/moby/moby-live/Java/docs/graphs/index.html 2003/11/09 01:05:02 1.2 @@ -27,7 +27,7 @@ The BioMoby Graphs are available:
              -
            • As an experimental +
            • As an experimental interactive service (implemented as a Java servlet).

            • The graphs can be also created from the command-line provided that @@ -49,7 +49,7 @@ Click on the thumbnail to see a graph of data types (notice that this is not a current graph - -for the current data go to the interactive service). +for the current data go to the interactive service).

              @@ -126,7 +126,7 @@

              Suggestions, comments, and bug reports to:
              Martin Senger
              -Last modified: Fri Nov 7 22:37:27 2003 +Last modified: Sun Nov 9 00:21:16 2003
              From senger at pub.open-bio.org Sun Nov 9 01:05:03 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Sat, 8 Nov 2003 20:05:03 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311090105.hA91533e021596@pub.open-bio.org> senger Sat Nov 8 20:05:02 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv21510/src/main/org/biomoby/client Modified Files: FileCache.java GraphsServlet.java Log Message: moby-live/Java/src/main/org/biomoby/client FileCache.java,1.1,1.2 GraphsServlet.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/FileCache.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/FileCache.java 2003/11/08 00:27:24 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/FileCache.java 2003/11/09 01:05:02 1.2 @@ -128,7 +128,7 @@ parent.mkdirs(); if (parent.exists()) return filename; - throw new IOException ("Cannot create all needed directories."); + throw new IOException ("Cannot create all needed directories: '" + parent.toString() + "'."); } /************************************************************************** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/08 00:27:24 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/09 01:05:02 1.2 @@ -41,6 +41,10 @@ static final protected String CACHE_URL = "cache_url"; static final protected String DEFAULT_ENDPOINT = "default_endpoint"; static final protected String DEFAULT_NAMESPACE = "default_namespace"; + static final protected String PROXY_SET = "proxySet"; + static final protected String PROXY_PORT = "http.proxyPort"; + static final protected String PROXY_HOST = "http.proxyHost"; + static final protected String DOT_PATH = "dot_path"; // expected/known form's element names static final protected String VERBOSE = "verbose"; @@ -214,6 +218,19 @@ defaultNamespace = (String)initParams.get (DEFAULT_NAMESPACE); if (UUtils.isEmpty (defaultNamespace)) defaultNamespace = CentralImpl.DEFAULT_NAMESPACE; + + // set HTTP proxy - this is probably useless because (I guess) + // the proxy can be set in the Tomcat configuration file (and + // not to let each servlet to do it) - but it's here, anyway + String proxySet = (String)initParams.get (PROXY_SET); + if (! UUtils.isEmpty (proxySet)) + System.setProperty (PROXY_SET, proxySet); + String proxyPort = (String)initParams.get (PROXY_PORT); + if (! UUtils.isEmpty (proxyPort)) + System.setProperty (PROXY_PORT, proxyPort); + String proxyHost = (String)initParams.get (PROXY_HOST); + if (! UUtils.isEmpty (proxyHost)) + System.setProperty (PROXY_HOST, proxyHost); } /************************************************************************* @@ -648,6 +665,12 @@ } else { graph = Graphviz.createServicesGraph (edges, props); + // where is the 'dot' program + String dotProg = "dot"; + String dotPath = getString (req, DOT_PATH); + if (dotPath != null) + dotProg = dotPath + System.getProperty ("file.sparator") + dotProg; + // depending on the cache implementation we may ask // 'dot' to produce output to its standard output, or // to write to a file @@ -657,12 +680,12 @@ String filename = cache.getFilename (id); // call 'dot' to create a real graph in a 'filename' - executeDot (graph, wantedOutputType, filename); + executeDot (dotProg, graph, wantedOutputType, filename); } else { // call 'dot' to return a real graph as byte array - byte[] graphBytes = executeDot (graph, wantedOutputType); + byte[] graphBytes = executeDot (dotProg, graph, wantedOutputType); if (graphBytes == null || graphBytes.length == 0) throw new MobyException ("An empty graph. Strange."); cache.setContents (id, graphBytes); @@ -716,6 +739,13 @@ log ("Creating a graph of the data types...\n"); String dotGraph = Graphviz.createDataTypesGraph (dataTypes, props); + + // where is the 'dot' program + String dotProg = "dot"; + String dotPath = getString (req, DOT_PATH); + if (dotPath != null) + dotProg = dotPath + System.getProperty ("file.sparator") + dotProg; + // depending on the cache implementation we may ask // 'dot' to produce output to its standard output, or // to write to a file @@ -725,12 +755,12 @@ String filename = cache.getFilename (id); // call 'dot' to create a real graph in a 'filename' - executeDot (dotGraph, wantedOutputType, filename); + executeDot (dotProg, dotGraph, wantedOutputType, filename); } else { // call 'dot' to return a real graph as byte array - byte[] graph = executeDot (dotGraph, wantedOutputType); + byte[] graph = executeDot (dotProg, dotGraph, wantedOutputType); if (graph == null || graph.length == 0) throw new MobyException ("An empty graph. Strange."); cache.setContents (id, graph); @@ -821,17 +851,18 @@ } /******************************************************************** - * Execute 'dot' program with the given graph description in + * Execute 'dotProg' program with the given graph description in * 'dotGraph' in order to create a graph in 'outputType' * format. The graph is created in the given file 'filename'. ********************************************************************/ - protected void executeDot (String dotGraph, String outputType, String filename) + protected void executeDot (String dotProg, String dotGraph, + String outputType, String filename) throws MobyException { if (outputType.equals ("txt")) outputType = "plain-ext"; - String[] cmdLine = new String[] { "dot", "-T" + outputType, "-o" + filename }; + String[] cmdLine = new String[] { dotProg, "-T" + outputType, "-o" + filename }; String[] envArr = new String[] {}; // no environment try { // start an external process @@ -852,17 +883,17 @@ } /******************************************************************** - * Execute 'dot' program with the given graph description in + * Execute 'dotProg' program with the given graph description in * 'dotGraph' in order to create a graph in 'outputType' * format. The created graph is returned back as a byte array. ********************************************************************/ - protected byte[] executeDot (String dotGraph, String outputType) + protected byte[] executeDot (String dotProg, String dotGraph, String outputType) throws MobyException { if (outputType.equals ("txt")) outputType = "plain-ext"; - String[] cmdLine = new String[] { "dot", "-T" + outputType }; + String[] cmdLine = new String[] { dotProg, "-T" + outputType }; String[] envArr = new String[] {}; // no environment try { // start an external process From senger at pub.open-bio.org Sun Nov 9 01:05:03 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Sat, 8 Nov 2003 20:05:03 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311090105.hA91533F021615@pub.open-bio.org> senger Sat Nov 8 20:05:02 EST 2003 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv21510/src/webapps Modified Files: web.xml.template Log Message: moby-live/Java/src/webapps web.xml.template,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/webapps/web.xml.template,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/webapps/web.xml.template 2003/11/08 00:36:18 1.1 +++ /home/repository/moby/moby-live/Java/src/webapps/web.xml.template 2003/11/09 01:05:02 1.2 @@ -43,6 +43,7 @@ both the appeareance and the contents of these graphs. org.biomoby.client.GraphsServlet + refresh_interval @REFRESH_INTERVAL@ @@ -51,6 +52,7 @@ from the BioMoby registry - in minutes. An integer. + cache_dir @CACHE_DIR@ @@ -62,6 +64,7 @@ 'cache_url' parameter. + cache_url @CACHE_URL@ @@ -71,6 +74,7 @@ where 'cache_dir' (yet another parameter) ends. + default_endpoint @DEFAULT_ENDPOINT@ @@ -80,6 +84,7 @@ default an official BioMoby site in Canada. + default_namespace @DEFAULT_NAMESPACE@ @@ -90,6 +95,42 @@ registry in Canada). + + + dot_path + @DOT_PATH@ + + A full path to the 'dot' program (excluding the 'dot' itself + and the ending slash). Use this only if the 'dot' program + is not on the PATH used by Tomcat. + + + + + proxySet + @PROXY_SET@ + + Set to 'true' if your Tomcat needs to find an HTTP proxy + server, and if it does not have it set in its own configuration. + + + + + http.proxyHost + @PROXY_HOST@ + + The HTTP proxy hostname. + + + + + http.proxyPort + @PROXY_PORT@ + + The HTTP proxy port number. + + + - - - - + + + + + + + + + + + + + + @@ -25,16 +36,19 @@ - - - - - + + + + + + + + @@ -63,6 +77,8 @@ + + @@ -96,6 +112,9 @@ + + + @@ -115,6 +134,7 @@ + @@ -134,15 +154,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + description="Compile all source code (default)."> Missing one or more third-party libraries. Try to run build.sh or build.bat to fetch them from the net. @@ -157,6 +218,11 @@ excludes="${project.excludes}"> + + + @@ -165,7 +231,7 @@ - + + @@ -210,10 +277,11 @@ + description="Create a jar file with jMoby classes."> + @@ -223,8 +291,8 @@ - + @@ -237,10 +305,10 @@ - + - + @@ -262,12 +330,86 @@ + - + - + + + + + + + + + + + + + + Tomcat Catalina not found. + Please set environment variable CATALINA_HOME to point to it, or + create a file 'build.properties' and put there the line: + catalina.home = <location of your CATALINA> + (do not include '<' and '>' there) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -278,3 +420,4 @@ + From senger at pub.open-bio.org Sat Nov 8 00:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:27:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROMX017243@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/dist In directory pub.open-bio.org:/tmp/cvs-serv17161/docs/dist Modified Files: .cvsignore.template Added Files: _README_ Log Message: added graphs for exploring biomoby registry moby-live/Java/docs/dist _README_,NONE,1.1 .cvsignore.template,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/dist/.cvsignore.template,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/docs/dist/.cvsignore.template 2003/09/25 02:10:27 1.1 +++ /home/repository/moby/moby-live/Java/docs/dist/.cvsignore.template 2003/11/08 00:27:24 1.2 @@ -3,3 +3,4 @@ *.zip *.tar.gz *.tgz +*.war From senger at pub.open-bio.org Sat Nov 8 00:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:27:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROiI017258@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs In directory pub.open-bio.org:/tmp/cvs-serv17161/docs/graphs Added Files: index.html Log Message: added graphs for exploring biomoby registry moby-live/Java/docs/graphs index.html,NONE,1.1 From senger at pub.open-bio.org Sat Nov 8 00:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:27:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROXc017273@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs/images In directory pub.open-bio.org:/tmp/cvs-serv17161/docs/graphs/images Added Files: example-data-types-small.jpg example-data-types.png example-services-small.jpg example-services.png legend.dot legend.png logo.png Log Message: added graphs for exploring biomoby registry moby-live/Java/docs/graphs/images example-data-types-small.jpg,NONE,1.1 example-data-types.png,NONE,1.1 example-services-small.jpg,NONE,1.1 example-services.png,NONE,1.1 legend.dot,NONE,1.1 legend.png,NONE,1.1 logo.png,NONE,1.1 From senger at pub.open-bio.org Sat Nov 8 00:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:27:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROKN017311@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv17161/src/Clients Modified Files: MobyGraphs.java Added Files: EchoClient.java EchoClient2.java Log Message: added graphs for exploring biomoby registry moby-live/Java/src/Clients EchoClient.java,NONE,1.1 EchoClient2.java,NONE,1.1 MobyGraphs.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2003/10/17 13:13:34 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2003/11/08 00:27:24 1.2 @@ -50,7 +50,7 @@ BaseCmdLine cmd = new BaseCmdLine (args, true); if (cmd.hasParam ("-help") || cmd.hasParam ("-h")) { - System.out.print (MobyCmdLineClient.getUsage()); + System.out.print (MobyGraphs.getUsage()); System.exit (0); } @@ -127,10 +127,41 @@ services = new MobyService [v.size()]; v.copyInto (services); - // create a graph + // create a set of graph edges decorationLn ("Creating a graph of the services..."); ServicesEdge[] edges = ServiceConnections.build (dataTypes, services); - String graph = Graphviz.createServicesGraph (edges, props); + + // filter edges + String[] authorities = null; + String[] serviceNames = null; + int depth = 1; + if ((param = cmd.getParam ("-auth")) != null ) + authorities = StringUtils.split (param, ","); + if ((param = cmd.getParam ("-name")) != null ) + serviceNames = StringUtils.split (param, ","); + param = cmd.getParam ("-depth"); + if (param != null) { + try { + depth = Integer.valueOf (param).intValue(); + } catch (java.lang.NumberFormatException e) {} + } + edges = FilterServices.filter (edges, authorities, serviceNames, depth); + + String[] pathEnds = cmd.getParam ("-path", 2); + if (pathEnds.length == 2) + edges = FilterServices.pathes (edges, pathEnds[0], pathEnds[1]); + if (edges == null) { + System.err.println ("No connection found between '" + + pathEnds[0] + "' and '" + pathEnds[1] + "'"); + System.exit(1); + } + + // create a graph (in whatever format) + String graph; + if (cmd.hasOption ("-rdf")) + graph = RDF.createServicesGraph (edges, props); + else + graph = Graphviz.createServicesGraph (edges, props); // output the graph param = cmd.getParam ("-fs"); From senger at pub.open-bio.org Sat Nov 8 00:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:27:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80ROWx017292@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/lib In directory pub.open-bio.org:/tmp/cvs-serv17161/lib Modified Files: README Log Message: added graphs for exploring biomoby registry moby-live/Java/lib README,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/lib/README,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/lib/README 2003/09/24 12:33:48 1.3 +++ /home/repository/moby/moby-live/Java/lib/README 2003/11/08 00:27:24 1.4 @@ -39,6 +39,11 @@ wsdl4j.jar, axis.jar, log4j-1.2.4.jar, saaj.jar. Libraries from the Apache Axis project (a toolkit for the SOAP protocol). -* servlet.jar, activation.jar. +* servlet.jar, activation.jar Libraries dealing with servlets. They come from Apache Tomcat project. +* jena.jar, adenine.jar + Libraries from 'haystack' (IBM) for producing RDF files. + They can be fetched from here: + http://www.ai.mit.edu/people/dquan/adenine.jar + http://www.ai.mit.edu/people/dquan/jena.jar From senger at pub.open-bio.org Sat Nov 8 00:27:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:27:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80RO72017353@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv17161/src/main/org/biomoby/client Modified Files: CentralImpl.java ServicesEdge.java Added Files: FileCache.java FilterServices.java GraphsServlet.java RDF.java ServletFileCache.java SimpleCache.java Log Message: added graphs for exploring biomoby registry moby-live/Java/src/main/org/biomoby/client FileCache.java,NONE,1.1 FilterServices.java,NONE,1.1 GraphsServlet.java,NONE,1.1 RDF.java,NONE,1.1 ServletFileCache.java,NONE,1.1 SimpleCache.java,NONE,1.1 CentralImpl.java,1.2,1.3 ServicesEdge.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/10/17 13:13:34 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/08 00:27:24 1.3 @@ -625,7 +625,7 @@ /************************************************************************** * The 'retrieveObjectDefinition' method returns something like this; * - * + * * urn:lsid:biomoby.org:objectclass:go_term * * http://www.illuminae.com @@ -637,7 +637,7 @@ * urn:lsid:biomoby.org:objectclass:string * urn:lsid:biomoby.org:objectclass:string * - * + * * *************************************************************************/ public MobyDataType getDataType (String dataTypeName) @@ -652,7 +652,7 @@ // parse returned XML Document document = parser.parse (new StringReader (result)); - NodeList list = document.getElementsByTagName ("registerObjectClass"); + NodeList list = document.getElementsByTagName ("retrieveObjectDefinition"); if (list == null || list.getLength() == 0) throw new NoSuccessException ("Data Type name was not founnd.", dataTypeName); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServicesEdge.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServicesEdge.java 2003/10/17 13:13:34 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/ServicesEdge.java 2003/11/08 00:27:24 1.2 @@ -89,6 +89,26 @@ } /************************************************************************* + * Retrieves the source service. + * + * @return the source service + * + *************************************************************************/ + public MobyService getSourceService() { + return sourceService; + } + + /************************************************************************* + * Retrieves the target service. + * + * @return the target service + * + *************************************************************************/ + public MobyService getTargetService() { + return targetService; + } + + /************************************************************************* * Sets connector. * * @param connector is a string representing namespace and data From senger at pub.open-bio.org Sat Nov 8 00:27:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:27:25 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080027.hA80RPtR017372@pub.open-bio.org> senger Fri Nov 7 19:27:24 EST 2003 Update of /home/repository/moby/moby-live/Java/src/support In directory pub.open-bio.org:/tmp/cvs-serv17161/src/support Modified Files: README Added Files: run-any-client run-any-client.bat run-graphs-client run-graphs-client.bat Log Message: added graphs for exploring biomoby registry moby-live/Java/src/support run-any-client,NONE,1.1 run-any-client.bat,NONE,1.1 run-graphs-client,NONE,1.1 run-graphs-client.bat,NONE,1.1 README,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/support/README,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/support/README 2003/09/25 10:49:09 1.2 +++ /home/repository/moby/moby-live/Java/src/support/README 2003/11/08 00:27:24 1.3 @@ -10,6 +10,7 @@ sh ./run-cmdline-client -help sh ./run-testing-central + sh ./run-graphs-client -help Or, on Unix platforms, use chmod to make the scripts above executable and call them without 'sh' (note that this small inconvenience is due From senger at pub.open-bio.org Sat Nov 8 00:28:44 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:28:44 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080028.hA80SiSl017413@pub.open-bio.org> senger Fri Nov 7 19:28:44 EST 2003 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv17395/webapps Log Message: Directory /home/repository/moby/moby-live/Java/src/webapps added to the repository moby-live/Java/src/webapps - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/webapps/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/webapps/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/webapps/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sat Nov 8 00:31:36 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:31:36 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080031.hA80Vavo017459@pub.open-bio.org> senger Fri Nov 7 19:31:36 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services In directory pub.open-bio.org:/tmp/cvs-serv17441/Services Log Message: Directory /home/repository/moby/moby-live/Java/src/Services added to the repository moby-live/Java/src/Services - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sat Nov 8 00:33:03 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:33:03 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080033.hA80X3g1017542@pub.open-bio.org> senger Fri Nov 7 19:33:02 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org/biomoby In directory pub.open-bio.org:/tmp/cvs-serv17524/Services/org/biomoby Log Message: Directory /home/repository/moby/moby-live/Java/src/Services/org/biomoby added to the repository moby-live/Java/src/Services/org/biomoby - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sat Nov 8 00:32:24 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:32:24 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080032.hA80WOe0017500@pub.open-bio.org> senger Fri Nov 7 19:32:24 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org In directory pub.open-bio.org:/tmp/cvs-serv17482/Services/org Log Message: Directory /home/repository/moby/moby-live/Java/src/Services/org added to the repository moby-live/Java/src/Services/org - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sat Nov 8 00:33:49 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:33:49 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080033.hA80XnZO017583@pub.open-bio.org> senger Fri Nov 7 19:33:48 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service In directory pub.open-bio.org:/tmp/cvs-serv17565/Services/org/biomoby/service Log Message: Directory /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service added to the repository moby-live/Java/src/Services/org/biomoby/service - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Sat Nov 8 00:36:18 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:36:18 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080036.hA80aImp017646@pub.open-bio.org> senger Fri Nov 7 19:36:18 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service In directory pub.open-bio.org:/tmp/cvs-serv17631/src/Services/org/biomoby/service Added Files: Echo.java EchoImpl.java EchoImplFromStubs.java README Log Message: added graphs for exploring biomoby registry moby-live/Java/src/Services/org/biomoby/service Echo.java,NONE,1.1 EchoImpl.java,NONE,1.1 EchoImplFromStubs.java,NONE,1.1 README,NONE,1.1 From senger at pub.open-bio.org Sat Nov 8 00:36:18 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:36:18 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080036.hA80aIGL017661@pub.open-bio.org> senger Fri Nov 7 19:36:18 EST 2003 Update of /home/repository/moby/moby-live/Java/src/webapps In directory pub.open-bio.org:/tmp/cvs-serv17631/src/webapps Added Files: web.xml.template Log Message: added graphs for exploring biomoby registry moby-live/Java/src/webapps web.xml.template,NONE,1.1 From senger at pub.open-bio.org Sat Nov 8 00:49:07 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:49:07 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080049.hA80n79q017906@pub.open-bio.org> senger Fri Nov 7 19:49:06 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated In directory pub.open-bio.org:/tmp/cvs-serv17891/src/Services/org/biomoby/service/generated Added Files: Echo.java EchoService.java EchoServiceLocator.java EchoStringSoapBindingImpl.java EchoStringSoapBindingStub.java deploy.wsdd undeploy.wsdd Log Message: starting to play with services moby-live/Java/src/Services/org/biomoby/service/generated Echo.java,NONE,1.1 EchoService.java,NONE,1.1 EchoServiceLocator.java,NONE,1.1 EchoStringSoapBindingImpl.java,NONE,1.1 EchoStringSoapBindingStub.java,NONE,1.1 deploy.wsdd,NONE,1.1 undeploy.wsdd,NONE,1.1 From senger at pub.open-bio.org Fri Nov 7 23:14:34 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 18:14:34 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311072314.hA7NEYck016951@pub.open-bio.org> senger Fri Nov 7 18:14:34 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs In directory pub.open-bio.org:/tmp/cvs-serv16933/graphs Log Message: Directory /home/repository/moby/moby-live/Java/docs/graphs added to the repository moby-live/Java/docs/graphs - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/RCS/directory,v: No such file or directory From senger at pub.open-bio.org Fri Nov 7 23:15:22 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 18:15:22 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311072315.hA7NFMdE016995@pub.open-bio.org> senger Fri Nov 7 18:15:22 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs/images In directory pub.open-bio.org:/tmp/cvs-serv16977/graphs/images Log Message: Directory /home/repository/moby/moby-live/Java/docs/graphs/images added to the repository moby-live/Java/docs/graphs/images - New directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/images/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/images/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/docs/graphs/images/RCS/directory,v: No such file or directory From mwilkinson at pub.open-bio.org Wed Nov 12 17:31:43 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 12:31:43 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121731.hACHVhWO012380@pub.open-bio.org> mwilkinson Wed Nov 12 12:31:43 EST 2003 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv12338/t Modified Files: Client-Central.t Log Message: Yay! We have a Makefile and test suite again! This is more simple than the one that Richard was working on at the Singapore hackathon (his was able to actually install and test local services), but this will at least install the modules and test the basic functionality of MOBY::Client::Central moby-live/Perl/t Client-Central.t,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/t/Client-Central.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Perl/t/Client-Central.t 2003/02/19 21:23:16 1.1 +++ /home/repository/moby/moby-live/Perl/t/Client-Central.t 2003/11/12 17:31:42 1.2 @@ -5,187 +5,249 @@ # change 'tests => 1' to 'tests => last_test_to_print'; -use Test::More tests => 20; # perldoc Test::More for details +use Test::More tests => 12; # perldoc Test::More for details # Test 1 BEGIN { use_ok('MOBY::Client::Central') }; # Test 2 my $C = MOBY::Client::Central->new( - MOBY_server => "http://localhost/cgi-bin/MOBY-Central.pl", - MOBY_uri => "http://localhost/MOBY/Central" + #MOBY_server => "http://localhost/cgi-bin/MOBY-Central.pl", + #MOBY_uri => "http://localhost/MOBY/Central" ); isa_ok( $C,'MOBY::Client::Central',"Connected to test MOBY Central") or - die("Cannot Connect to test MOBY Central... cannot continue?"); + die("Cannot Connect to MOBY Central... cannot continue?"); my %TestRegistry ; # to keep track of registry id's for the various tests ################## MOBY Registration Tests ################# # Test 3 -$r = $C->registerObject( - objectType => "testObject", - description => "this is a test", - xsd => "", - ISA => ["Object"], - authURI => "http://www.illuminae.com", - clobber => 0, +$r = $C->registerObjectClass(objectType => "TotalCrap", + description => "a human-readable description of the object", + contactEmail => 'your at email.address', + authURI => "URI of the registrar of this object", + Relationships => { + ISA => [ + ['Object', 'article1'], + ['Object', 'articleName2']], + HASA => [ + ['Object', 'articleName3']]} ); -( ok(!$r->success,"Object registration successful") and - ($TestRegistry{'Object'} = $r->registration_id) -) or diag("Object registration failure: ".$r->error_message) ; +( ok($r->success,"Object registration successful") + or diag("Object registration failure: ".$r->message)); + # Test 4 -$r = $C->registerServiceType( - serviceType => "testService", - description => "this is a test", - ISA => ["Retrieve"], +$r = $C->deregisterObjectClass(objectType => "TotalCrap"); +( ok($r->success,"Object deregistration successful")) +or diag("Object deregistration failure: ".$r->message) ; + +# Test 5 (identical to #3 +$r = $C->registerObjectClass(objectType => "TotalCrap", + description => "a human-readable description of the object", + contactEmail => 'your at email.address', + authURI => "URI of the registrar of this object", + Relationships => { + ISA => [ + ['Object', 'article1'], + ['Object', 'articleName2']], + HASA => [ + ['Object', 'articleName3']]} ); -( ok(!$r->success,"Service type registration successful") and - ($TestRegistry{'ServiceType'} = $r->registration_id) -) or diag("Service type registration failure: ".$r->error_message) ; +( ok($r->success,"Object registration successful") + or diag("Object registration failure: ".$r->message)); + -# Test 5 +# Test 6 $r = $C->registerNamespace( - namespaceType => "testNamespace", - description => "this is a test", - authURI => "http://illuminae.com", - clobber => 0 + namespaceType =>'UglyNamespace', + authURI => 'your.authority.URI', + description => "human readable description of namespace", + contactEmail => 'your at address.here'); +( ok($r->success,"Name space registration successful") +) or diag("Name space registration failure: ".$r->message) ; + + +# Test 7 +$r = $C->registerServiceType(serviceType => "CrappyService", + description => "a human-readable description of the service", + contactEmail => 'your at email.address', + authURI => "URI of the registrar of this object", + Relationships => { + ISA => ['Retrieval']} ); -( ok(!$r->success,"Name space registration successful") and - ($TestRegistry{'NameSpace'} = $r->registration_id) -) or diag("Name space registration failure: ".$r->error_message) ; +( ok($r->success,"Service Type registration successful") +) or diag("Service Type registration failure: ".$r->message) ; -# Test 6 +# Test 8 $r = $C->registerService( - serviceName => "Servicetest2", - serviceType => "Retrieve", - authURI => "illuminae.com", - input => {"Object" => ["Genbank/GI"]}, - output => ["Object"], - URL => "http://www.illuminae.com/cgi-bin/services.cgi", - description => "this is a test", - ); -( ok(!$r->success,"Service registration successful") and - ($TestRegistry{'Service'} = $r->registration_id) -) or diag("Name space registration failure: ".$r->error_message) ; - -################## MOBY Central Search Tests ################# - -my @service ; - -# Tests 7,8: locateServiceByOutput with output 'Object' and full_objects + full_services - at service = $C->locateServiceByOutput( - objectType => "Object", - fullObjects => 1, - fullServices => 1, -) ; - -SKIP: { - skip "locateServiceByOutput w/full object & services". - "did not return any services?", 2 unless scalar(@service) ; - is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; - is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; -} ; - -# Tests 9,10: Testing locateServiceByOutput with output "Object" and full_services only - at service = $C->locateServiceByOutput( - objectType => "Object", - fullObjects => 0, - fullServices => 1, - ); -SKIP: { - skip "locateServiceByOutput w/ output 'Object' and full services only ". - "did not return any services?", 2 unless scalar(@service) ; - is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; - is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; -} ; - -# Tests 11,12: Testing locateServiceByInput with input -# 'Object' => Genbank/GI and full_objects + full_services - at service = $C->locateServiceByInput( - input => {"Sequence" => ["Genbank/GI"]}, - fullObjects => 1, - fullServices => 1, - ); -SKIP: { - skip "locateServiceByInput w/input 'Object' => Genbank/GI ". - "and full_objects + full_services ". - "did not return any services?", 2 unless scalar(@service) ; - is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; - is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; -} ; - -# Tests 13,14: Testing locateServiceByInput with input -# 'Object' => Genbank/GI and full_services only - at service = $C->locateServiceByInput( - input => {"Object" => ["Genbank/GI"]}, - fullObjects => 0, - fullServices => 1, - ); -SKIP: { - skip "locateServiceByInput w/input 'Object' => Genbank/GI ". - "and full_services ". - "did not return any services?", 2 unless scalar(@service) ; - is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; - is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; -} ; - -# Tests 15,16: Testing locateServiceByType with type 'Retrieve' + full_services - at service = $C->locateServiceByType( - serviceType => "Retrieve", - fullServices => 1, - ); -SKIP: { - skip "locateServiceByType w/type 'Retrieve' and full_services ". - "did not return any services?", 2 unless scalar(@service) ; - is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; - is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; -} ; - -################## MOBY Deregistration Tests ################# - -# Test 17 -SKIP: { - skip "Skipping test DeregisterService since service registration failed", - 1 unless(exists($TestRegistry{'Service'})) ; - - $r = $C->deregisterService( serviceID => $TestRegistry{'Service'} ); - ok(!$r->success,"Service ID#".$r->registration_id." deregistration successful") - or diag("Service ID#",$TestRegistry{'Service'}, - "deregistration failure: ".$r->error_message) ; -} - -# Test 18 -SKIP: { - skip "Skipping test DeregisterNamespace since name space registration failed", - 1 unless(exists($TestRegistry{'NameSpace'})) ; - - $r = $C->deregisterNamespace( namespaceAcc => $TestRegistry{'NameSpace'} ); - ok(!$r->success,"Name space ID#".$r->registration_id." deregistration successful") - or diag("Name space ID#",$TestRegistry{'NameSpace'}, - "deregistration failure: ".$r->error_message) ; -} - -# Test 19 -SKIP: { - skip "Skipping test DeregisterServiceType since service registration failed", - 1 unless(exists($TestRegistry{'ServiceType'})) ; - - $r = $C->deregisterServiceType( serviceID => $TestRegistry{'ServiceType'} ); - ok(!$r->success,"Service type ID#".$r->registration_id." deregistration successful") - or diag("Service type ID#",$TestRegistry{'ServiceType'}, - "deregistration failure: ".$r->error_message) ; -} - -# Test 20 -SKIP: { - skip "Skipping test DeregisterObject since initial object registration failed", - 1 unless(exists($TestRegistry{'Object'})) ; - - $r = $C->deregisterObject( serviceID => $TestRegistry{'Object'} ); - ok(!$r->success,"Object ID#".$r->registration_id." deregistration successful") - or diag("Object ID#",$TestRegistry{'Object'}, - "deregistration failure: ".$r->error_message) ; -} + serviceName => "myfirstservice", + serviceType => "Retrieval", + authURI => "www.illuminae.com", + contactEmail => 'your at mail.address', + description => "this is my first service", + category => "moby", + URL => "http://illuminae/cgi-bin/service.pl", + input =>[ + ['articleName1', [Object => ['UglyNamespace']]], # Simple + ], + output =>[ + ['articleName2', [String => ['UglyNamespace']]], # Simple + ], + secondary => { + parametername1 => { + datatype => 'Int', + default => 0, + max => 10, + min => -10, + enum => [-10, 10, 0]}}); + +( ok($r->success,"Service registration successful") +) or diag("Service registration failure: ".$r->message) ; + + +# Test 9 + +$r = $C->deregisterService( + serviceName => "myfirstservice", + authURI => "www.illuminae.com", + ); +( ok($r->success,"Service deregistration successful") +) or diag("Service deregistration failure: ".$r->message) ; + + +# Test 10 +$r = $C->deregisterObjectClass(objectType => "TotalCrap"); +( ok($r->success,"Object deregistration successful") +) or diag("Object deregistration failure: ".$r->message) ; + +# Test 11 +$r = $C->deregisterServiceType(serviceType => "CrappyService"); +( ok($r->success,"Service Type deregistration successful") +) or diag("Service Type deregistration failure: ".$r->message) ; + +# Test 12 +$r = $C->deregisterNamespace(namespaceType =>'UglyNamespace'); +( ok($r->success,"namespace deregistration successful") +) or diag("namespace deregistration failure: ".$r->message) ; + +################### MOBY Central Search Tests ################# +# +#my @service ; +# +## Tests 7,8: locateServiceByOutput with output 'Object' and full_objects + full_services +#@service = $C->locateServiceByOutput( +# objectType => "Object", +# fullObjects => 1, +# fullServices => 1, +#) ; +# +#SKIP: { +# skip "locateServiceByOutput w/full object & services". +# "did not return any services?", 2 unless scalar(@service) ; +# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; +# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; +#} ; +# +## Tests 9,10: Testing locateServiceByOutput with output "Object" and full_services only +#@service = $C->locateServiceByOutput( +# objectType => "Object", +# fullObjects => 0, +# fullServices => 1, +# ); +#SKIP: { +# skip "locateServiceByOutput w/ output 'Object' and full services only ". +# "did not return any services?", 2 unless scalar(@service) ; +# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; +# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; +#} ; +# +## Tests 11,12: Testing locateServiceByInput with input +## 'Object' => Genbank/GI and full_objects + full_services +#@service = $C->locateServiceByInput( +# input => {"Sequence" => ["Genbank/GI"]}, +# fullObjects => 1, +# fullServices => 1, +# ); +#SKIP: { +# skip "locateServiceByInput w/input 'Object' => Genbank/GI ". +# "and full_objects + full_services ". +# "did not return any services?", 2 unless scalar(@service) ; +# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; +# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; +#} ; +# +## Tests 13,14: Testing locateServiceByInput with input +## 'Object' => Genbank/GI and full_services only +#@service = $C->locateServiceByInput( +# input => {"Object" => ["Genbank/GI"]}, +# fullObjects => 0, +# fullServices => 1, +# ); +#SKIP: { +# skip "locateServiceByInput w/input 'Object' => Genbank/GI ". +# "and full_services ". +# "did not return any services?", 2 unless scalar(@service) ; +# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; +# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; +#} ; +# +## Tests 15,16: Testing locateServiceByType with type 'Retrieve' + full_services +#@service = $C->locateServiceByType( +# serviceType => "Retrieve", +# fullServices => 1, +# ); +#SKIP: { +# skip "locateServiceByType w/type 'Retrieve' and full_services ". +# "did not return any services?", 2 unless scalar(@service) ; +# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ; +# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ; +#} ; +# +################### MOBY Deregistration Tests ################# +# +## Test 17 +#SKIP: { +# skip "Skipping test DeregisterService since service registration failed", +# 1 unless(exists($TestRegistry{'Service'})) ; +# +# $r = $C->deregisterService( serviceID => $TestRegistry{'Service'} ); +# ok(!$r->success,"Service ID#".$r->registration_id." deregistration successful") +# or diag("Service ID#",$TestRegistry{'Service'}, +# "deregistration failure: ".$r->message) ; +#} +# +## Test 18 +#SKIP: { +# skip "Skipping test DeregisterNamespace since name space registration failed", +# 1 unless(exists($TestRegistry{'NameSpace'})) ; +# +# $r = $C->deregisterNamespace( namespaceAcc => $TestRegistry{'NameSpace'} ); +# ok(!$r->success,"Name space ID#".$r->registration_id." deregistration successful") +# or diag("Name space ID#",$TestRegistry{'NameSpace'}, +# "deregistration failure: ".$r->message) ; +#} +# +## Test 19 +#SKIP: { +# skip "Skipping test DeregisterServiceType since service registration failed", +# 1 unless(exists($TestRegistry{'ServiceType'})) ; +# +# $r = $C->deregisterServiceType( serviceID => $TestRegistry{'ServiceType'} ); +# ok(!$r->success,"Service type ID#".$r->registration_id." deregistration successful") +# or diag("Service type ID#",$TestRegistry{'ServiceType'}, +# "deregistration failure: ".$r->message) ; +#} +# +## Test 20 +#SKIP: { +# skip "Skipping test DeregisterObject since initial object registration failed", +# 1 unless(exists($TestRegistry{'Object'})) ; +# +# $r = $C->deregisterObject( serviceID => $TestRegistry{'Object'} ); +# ok(!$r->success,"Object ID#".$r->registration_id." deregistration successful") +# or diag("Object ID#",$TestRegistry{'Object'}, +# "deregistration failure: ".$r->message) ; +#} From senger at pub.open-bio.org Sat Nov 8 00:47:33 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Fri, 7 Nov 2003 19:47:33 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311080047.hA80lXjn017845@pub.open-bio.org> senger Fri Nov 7 19:47:32 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated In directory pub.open-bio.org:/tmp/cvs-serv17827/generated Log Message: Directory /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated added to the repository moby-live/Java/src/Services/org/biomoby/service/generated - New directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated/RCS/-,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated/RCS/New,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Java/src/Services/org/biomoby/service/generated/RCS/directory,v: No such file or directory From mwilkinson at pub.open-bio.org Sat Nov 8 17:21:32 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Sat, 8 Nov 2003 12:21:32 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311081721.hA8HLWGp020549@pub.open-bio.org> mwilkinson Sat Nov 8 12:21:31 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv20526/Perl/MOBY Modified Files: CommonSubs.pm CommonSubs.html Log Message: updated CommonSubs to handle new message format; also included a paradigmatic example of a service moby-live/Perl/MOBY CommonSubs.pm,1.26,1.27 CommonSubs.html,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/06 16:23:14 1.26 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/08 17:21:31 1.27 @@ -8,46 +8,125 @@ =cut +=head1 Client Side Paradigm -=head1 SYNOPSIS +=cut - use MOBY::CommonSubs qw(:all); - my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles); - my $ns = getSimpleArticleNamespaceURI($SimpleArticle); +=head2 Service-Side Paradigm -A COMPLETE EXAMPLE OF A SIMPLE MOBY SERVICE +The following is a generalized architecture for *all* +BioMOBY services showing how to parse incoming messages... sub myServiceName { - my ($caller, $query) = @_; # get the incoming MOBY query XML - my @queries = getInputArticles($query); # returns DOM nodes - my $MOBY_RESPONSE = ""; # set empty response + my ($caller, $message) = @_; # get the incoming MOBY query XML + + my @queries = getInputs($message); # returns XML::DOM nodes + my $MOBY_RESPONSE = ""; # set empty response - foreach (@queries){ - my @inputs = @{$_}; #(may be more than one Simple/Collection input per query) - foreach my $input(@inputs){ - @sequence = getNodeContentWithArticle($_, "String", "SequenceString"); - my $sequence = join "", @sequence; # join all lines of string - # print STDERR "Analyzing $sequence\n"; - my $result = &_AnalyzeString($sequence); # do your analysis - $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename"); + foreach my $query(@queries){ + + my $queryID = getInputID($query); # get the queryID attribute of the queryInput + + my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query + foreach my $input(@input_articles){ # input is a listref + + my ($articleName, $article) = @{$input}; # get the named article + + my $simple = isSimpleArticle($article); # articles may be simple or collection + my $collection = isCollectionArticle($article); + + if ($collection){ + + # do something wtih the collection... + # for example... + my @simples = getCollectedSimples($article); + # blah blah blah... + + } elsif ($simple){ + # maybe you just need the ID of the incoming query: + my ($id) = getSimpleArticleIDs('NCBI_gi', $article); # if you need the ID + + # or maybe you are going to do something with the content? + # for example, this will get the array of text lines + # for the moby:String object with the articleName 'SequenceString' + # that is in this $article + my @sequence = getNodeContentWithArticle($article, "String", "SequenceString"); + + # DO YOUR ANALYSIS HERE + my $result = ""; #whatever you analysis says + + $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename", $queryID); + } } } - return responseHeader . $MOBY_RESPONSE . responseFooter; + return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter; + } + +=cut + +=head1 EXAMPLE + + +A COMPLETE EXAMPLE OF AN EASY MOBY SERVICE + +This is a service that: + +CONSUMES: Object in the NCBI_Acc namespace +EXECUTES: Retrieval +PRODUCES: GenericSequence (in the NCBI_Acc namespace) + + + use Bio::Perl; + + # this subroutine is called from your dispatch_with line + # in your SOAP daemon + + sub myServiceName { + my ($caller, $message) = @_; # get the incoming MOBY query XML + + my @queries = getInputs($message); # returns XML::DOM nodes + my $MOBY_RESPONSE = ""; # set empty response + + foreach my $query(@queries){ + + my $queryID = getInputID($query); # get the queryID attribute of the queryInput + + my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query + foreach my $input(@input_articles){ # input is a listref + my ($articleName, $article) = @{$input}; # get the named article + next unless isSimpleArticle($article); # I only allow simple inputs in my service signature + my ($id) = getSimpleArticleIDs('NCBI_Acc', $article); # if you need the ID + my $seq; + eval {$seq = get_sequence('genbank',$id);} # suppress bioperl error messages + my $response = ""; + if ($seq){ + $length = length($seq); + $response = " + $length + $seq + "; + } + $MOBY_RESPONSE .= simpleResponse($response, '', $queryID); + } + } + } + return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter; } =head1 DESCRIPTION -Used to do various transactions with MOBY-Central registry, including registering -new Object and Service types, querying for these types, registering new -Servers/Services, or queryiong for available services given certain input/output -or service type constraints. +CommonSubs are used to do various manipulations of MOBY Messages. It is useful +both Client and Service side to construct and parse MOBY Messages, and ensure +that the message structure is valid as per the API. + +It DOES NOT connect to MOBY Central for any of its functions. =head1 AUTHORS -Mark Wilkinson (markw at illuminae.com) +Mark Wilkinson (markw at illuminae dot com) BioMOBY Project: http://www.biomoby.org @@ -63,6 +142,7 @@ require Exporter; use XML::DOM; use MOBY::CrossReference; +use MOBY::Client::OntologyServer; @ISA = qw(Exporter); @EXPORT_OK = qw( @@ -72,6 +152,10 @@ responseHeader responseFooter getInputArticles + getInputs + getInputID + getArticles + getCollectedSimples getNodeContentWithArticle collectionResponse validateNamespaces @@ -88,6 +172,10 @@ responseHeader responseFooter getInputArticles + getInputs + getInputID + getArticles + getCollectedSimples getNodeContentWithArticle collectionResponse validateNamespaces @@ -130,7 +218,9 @@ sub getSimpleArticleIDs { my ($desired_namespace, $input_nodes) = @_; return undef unless $input_nodes; + $input_nodes = [$input_nodes] unless ref($input_nodes) =~ /ARRAY/; # be flexible! return undef unless scalar @{$input_nodes}; + my @input_nodes = @{$input_nodes}; my $OS = MOBY::Client::OntologyServer->new; my ($s, $m); @@ -218,40 +308,38 @@ name : simpleResponse function : wraps a simple article in the appropriate queryResponse structure - usage : $resp .= &simpleResponse($object, 'MyArticleName', $queryInput); + usage : $resp .= &simpleResponse($object, 'MyArticleName', $queryID); args : (in order) $object - (optional) a MOBY Object as raw XML $article - (optional) an articeName for this article - $query - (optional, but strongly recommended) the queryInput block - to which you are responding, either as raw XML, - or an XML::DOM object + $query - (optional, but strongly recommended) the queryID value for the + queryInput block to which you are responding notes : as required by the API you must return a response for every input. If one of the inputs was invalid, you return a valid (empty) MOBY - response by calling &simpleResponse() with no arguments. + response by calling &simpleResponse(undef, undef, $queryID) with no arguments. =cut sub simpleResponse { - my ($data, $articleName, $query) = @_; # articleName optional - my $qID = ''; + my ($data, $articleName, $qID) = @_; # articleName optional $data ||=''; - $qID = &_getQueryID($query) if $query; + $qID = &_getQueryID($qID) if ref($qID) =~ /XML::DOM/; # in case they send the DOM instead of the ID if ($articleName) { return " - + $data "; } elsif($data) { return " - - $data + + $data "; } else { return " - + "; } } @@ -263,8 +351,9 @@ my $doc = $parser->parse($query); $query = $doc->getDocumentElement(); } - return '' unless $query->getTagName eq "queryInput"; + return '' unless $query->getTagName =~/queryInput/; my $id = $query->getAttribute('queryID'); + $id ||= $query->getAttribute('moby:queryID'); return $id; } @@ -273,26 +362,24 @@ name : collectionResponse function : wraps a set of articles in the appropriate queryResponse structure - usage : return responseHeader . &collectionResponse(\@objects, 'MyArticleName') . responseFooter; + usage : return responseHeader . &collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter; args : (in order) \@objects - (optional) a listref of MOBY Objects as raw XML $article - (optional) an articeName for this article - $query - (optional, but strongly recommended) the queryInput block - to which you are responding, either as raw XML, - or an XML::DOM object + $queryID - (optional, but strongly recommended) the queryInput ID + to which you are responding notes : as required by the API you must return a response for every input. If one of the inputs was invalid, you return a valid (empty) MOBY - response by calling &collectionResponse() with no arguments. + response by calling &collectionResponse(undef, undef, $queryID). =cut sub collectionResponse { - my ($data, $articleName, $query) = @_; # articleName optional + my ($data, $articleName, $qID) = @_; # articleName optional my $content = ""; - my $qID = ''; - $data ||=''; - $qID = &_getQueryID($query) if $query; + $data ||=[]; + $qID ||= ''; unless ((ref($data) =~ /array/i) && $data->[0]){ # we're expecting an arrayref as input data,and it must not be empty return ""; } @@ -319,7 +406,7 @@ } else { return " - $content + $content "; } @@ -394,9 +481,11 @@ my ($XML) = @_; - my $parser = new XML::DOM::Parser; - my $doc = $parser->parse($XML); - my $moby = $doc->getDocumentElement(); + unless (ref($XML) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($XML); + $moby = $doc->getDocumentElement(); + } my $x = $moby->getElementsByTagName('queryInput'); # get the queryInput block unless ($x->item(0)){ @@ -411,62 +500,118 @@ } +=head2 getInputID -=head2 get_queryInput_Articles + name : getInputID + function : get the value of the queryID element + usage : @queryInputs = getInputID($XML) + args : the raw XML or XML::DOM of a block + returns : integer, or '' + Note : queryInputs and queryResponses are coordinately enumerated! + The integer you get here is what you + pass as the third argument to the simpleResponse or collectionResponse + subroutine to associate the numbered input to the numbered response - name : get_queryInput_Articles - function : get the Simple/Collection articles for each queryInput, in order - usage : @queries = get_queryInput_Articles($XML) - args : XML of a or an XML::DOM::Node of the element - returns : a list of listrefs, each listref is the input to a single query. - Remember that the input to a single query may be one or more Simple - and/or Collection articles. These are provided as XML::DOM nodes. - - i.e.: @queries = ([$SIMPLE_DOM_NODE], [$SIMPLE_DOM_NODE2]) - or : @queries = ([$COLLECTION_DOM_NODE], [$COLLECTION_DOM_NODE2]) - - the former is generated from the following XML: +=cut + + +sub getInputID { + my ($XML) = @_; + unless (ref($XML) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($XML); + $XML = $doc->getDocumentElement(); + } + return '' unless $XML->getTagName =~ /queryInput/; + my $qid = $XML->getAttribute('queryID'); + return defined($qid)?$qid:''; +} + + + +=head2 getArticles + + name : getArticles + function : get the Simple/Collection articles for a single queryInput + or queryResponse node + usage : @articles = getArticles($XML) + args : raw XML or XML::DOM of a moby:queryInput or a moby:queryResponse block + returns : a list of listrefs; each listref is one component of the queryInput. + a single queryInput/Responsemay consist of one or more named or unnamed + simple or collection articles. The listref structure is thus [name, $ARTICLE]: - ... - + e.g.: @articles = ['name1', $SIMPLE_DOM] + or : @articles = ['name1', $COLLECTION_DOM], ['name2', $SIMPLE_DOM]... + + the former is generated from the following sample XML: + - + - + - - ... =cut -sub get_queryInput_Articles { +sub getArticles { - my ($XML) = @_; - my $parser = new XML::DOM::Parser; - my $doc = $parser->parse($XML); - my $moby = $doc->getDocumentElement(); + my ($moby) = @_; + unless (ref($moby) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($moby); + $moby = $doc->getDocumentElement(); + } - my $x = $moby->getElementsByTagName('queryInput'); # get the queryInput block - unless ($x->item(0)){ - $x = $moby->getElementsByTagName('moby:queryInput'); + return undef unless $moby->getNodeType == ELEMENT_NODE; + return undef unless ($moby->getTagName =~ /queryInput/ || $moby->getTagName =~ /queryResponse/); + my @articles; + foreach $child($moby->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them + next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace + next unless ($child->getTagName =~ /Simple/ || $child->getTagName =~ /Collection/); + my $articleName = $child->getAttribute('articleName'); + $articleName ||= $child->getAttribute('moby:articleName'); + push @articles, [$articleName, $child]; # take the child elements, which are or } + return @articles; # return them. +} - my @queries; - for (0..$x->getLength-1){ # there may be more than one queryInput per message - my @this_query; - foreach $child($x->item($_)->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them - next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace - push @this_query, $child; # take the child elements, which are or - } - push @queries, \@this_query; - } - return @queries; # return them in the order that they were discovered. + +=head2 getCollectedSimples + + name : getCollectedSimples + function : get the Simple articles collected in a moby:Collection block + usage : @Simples = getCollectedSimples($XML) + args : raw XML or XML::DOM of a moby:Collection block + returns : a list of XML::DOM nodes, each of which is a moby:Simple block + +=cut + + +sub getCollectedSimples { + + my ($moby) = @_; + unless (ref($moby) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($moby); + $moby = $doc->getDocumentElement(); + } + + return undef unless $moby->getNodeType == ELEMENT_NODE; + return undef unless ($moby->getTagName =~ /Collection/); + + my @articles; + foreach $child($moby->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them + next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace + next unless ($child->getTagName =~ /Simple/); + push @articles, $child; # take the child elements, which are or + } + return (@articles); # return them. } @@ -475,7 +620,7 @@ name : getInputArticles function : get the Simple/Collection articles for each input query, in order usage : @queries = getInputArticles($XML) - args : the raw XML of a query + args : the raw XML of a moby:MOBY query returns : a list of listrefs, each listref is the input to a single query. Remember that the input to a single query may be one or more Simple and/or Collection articles. These are provided as XML::DOM nodes. @@ -505,10 +650,12 @@ sub getInputArticles { - my ($XML) = @_; - my $parser = new XML::DOM::Parser; - my $doc = $parser->parse($XML); - my $moby = $doc->getDocumentElement(); + my ($moby) = @_; + unless (ref($moby) =~ /XML\:\:DOM/){ + my $parser = new XML::DOM::Parser; + my $doc = $parser->parse($moby); + $moby = $doc->getDocumentElement(); + } my $x = $moby->getElementsByTagName('queryInput'); # get the queryInput block unless ($x->item(0)){ @@ -520,14 +667,7 @@ my @this_query; foreach $child($x->item($_)->getChildNodes){ # there may be more than one Simple/Collection per input; iterate over them next unless $child->getNodeType == ELEMENT_NODE; # ignore whitespace -# if ($asObject){ -# my $obj; -# $obj = MOBY::Client::SimpleArticle->new(XML_DOM => $child) if (isSimpleArticle($child)); -# $obj = MOBY::Client::CollectionArticle->new(XML_DOM => $child) if (isCollectionArticle($child)); -# push @this_query, $child; -# } else { push @this_query, $child; # take the child elements, which are or -# } } push @queries, \@this_query; } @@ -554,7 +694,7 @@ $DOM = $doc->getDocumentElement(); } $DOM = $DOM->getDocumentElement if ($DOM->isa("XML::DOM::Document")); - return 1 if ($DOM->getTagName eq "Simple"); + return 1 if ($DOM->getTagName =~ /Simple/); return 0; } @@ -822,13 +962,13 @@ $ns = $xref->getAttributeNode('moby:namespace') unless $ns; return undef unless $ns; my $id = $xref->getAttributeNode('id'); - $id = $xref->getAttributeNode('moby:id') unless $ns; + $id = $xref->getAttributeNode('moby:id') unless $id; return undef unless $id; my $xr = $xref->getAttributeNode('xref_type'); - $xr = $xref->getAttributeNode('moby:namespace') unless $ns; + $xr = $xref->getAttributeNode('moby:xref_type') unless $xr; return undef unless $xr; my $ec = $xref->getAttributeNode('evidence_code'); - $ec = $xref->getAttributeNode('moby:namespace') unless $ns; + $ec = $xref->getAttributeNode('moby:evidence_code') unless $ec; return undef unless $ec; my $au = $xref->getAttributeNode('authURI'); $au = $xref->getAttributeNode('moby:authURI') unless $au; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html 2003/10/25 22:20:47 1.5 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.html 2003/11/08 17:21:31 1.6 @@ -15,7 +15,13 @@
              • NAME
              • -
              • SYNOPSIS
              • +
              • Client Side Paradigm
              • + + +
              • EXAMPLE
              • DESCRIPTION
              • AUTHORS
              • METHODS
              • @@ -27,6 +33,10 @@
              • collectionResponse
              • responseHeader
              • responseFooter
              • +
              • getInputs
              • +
              • getInputID
              • +
              • getArticles
              • +
              • getCollectedSimples
              • getInputArticles
              • isSimpleArticle
              • isCollectionArticle
              • @@ -49,43 +59,116 @@


                -

                SYNOPSIS

                +

                Client Side Paradigm

                +

                +

                +

                Service-Side Paradigm

                +

                The following is a generalized architecture for *all* +BioMOBY services showing how to parse incoming messages...

                +
                + sub myServiceName {
                +   my ($caller, $message) = @_;  # get the incoming MOBY query XML
                +
                +   my @queries = getInputs($message);  # returns XML::DOM nodes
                +   my $MOBY_RESPONSE = "";           # set empty response
                + 
                +   foreach my $query(@queries){
                - use MOBY::CommonSubs qw(:all);
                - my @ids = getSimpleArticleIDs("NCBI_gi", \@SimpleArticles);
                - my $ns = getSimpleArticleNamespaceURI($SimpleArticle);
                -

                A COMPLETE EXAMPLE OF A SIMPLE MOBY SERVICE

                + my $queryID = getInputID($query); # get the queryID attribute of the queryInput + + my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query + foreach my $input(@input_articles){ # input is a listref +
                +        my ($articleName, $article) = @{$input}; # get the named article
                +        
                +        my $simple = isSimpleArticle($article);  # articles may be simple or collection
                +        my $collection = isCollectionArticle($article);
                +
                +        if ($collection){
                +
                +            # do something wtih the collection...
                +            # for example...
                +            my @simples = getCollectedSimples($article);
                +            # blah blah blah...
                +            
                +        } elsif ($simple){
                +            # maybe you just need the ID of the incoming query:
                +            my ($id) = getSimpleArticleIDs('NCBI_gi', $article); # if you need the ID
                +
                +            # or maybe you are going to do something with the content?
                +            # for example, this will get the array of text lines
                +            # for the moby:String object with the articleName 'SequenceString'
                +            # that is in this $article
                +            my @sequence = getNodeContentWithArticle($article, "String", "SequenceString");
                +
                +            #  DO YOUR ANALYSIS HERE
                +            my $result = ""; #whatever you analysis says
                +            
                +            $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename", $queryID);
                +        }
                +     }
                +   }
                +   return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter;
                + }
                +

                +

                +
                +

                EXAMPLE

                +

                A COMPLETE EXAMPLE OF AN EASY MOBY SERVICE

                +

                This is a service that:

                +

                CONSUMES: Object in the NCBI_Acc namespace +EXECUTES: Retrieval +PRODUCES: GenericSequence (in the NCBI_Acc namespace)

                + use Bio::Perl;
                + 
                + # this subroutine is called from your dispatch_with line
                + # in your SOAP daemon
                + 
                  sub myServiceName {
                -   my ($caller, $query) = @_;  # get the incoming MOBY query XML
                -   my @queries = getInputArticles($query);  # returns DOM nodes
                -   my $MOBY_RESPONSE = "";  # set empty response
                +   my ($caller, $message) = @_;  # get the incoming MOBY query XML
                +
                +   my @queries = getInputs($message);  # returns XML::DOM nodes
                +   my $MOBY_RESPONSE = "";           # set empty response
                  
                -   foreach (@queries){
                -     my @inputs = @{$_}; #(may be more than one Simple/Collection input per query)
                -     foreach my $input(@inputs){
                -        @sequence = getNodeContentWithArticle($_, "String", "SequenceString");
                -        my $sequence = join "", @sequence; # join all lines of string
                -        # print STDERR "Analyzing $sequence\n"; 
                -        my $result = &_AnalyzeString($sequence);  # do your analysis
                -        $MOBY_RESPONSE .= simpleResponse($result, "outputArticlename");
                +   foreach my $query(@queries){
                +
                +     my $queryID = getInputID($query);  # get the queryID attribute of the queryInput
                +     
                +     my @input_articles = getArticles($query); # get the Simple/Collection articles making up this query
                +     foreach my $input(@input_articles){       # input is a listref
                +        my ($articleName, $article) = @{$input}; # get the named article
                +        next unless isSimpleArticle($article);   # I only allow simple inputs in my service signature
                +        my ($id) = getSimpleArticleIDs('NCBI_Acc', $article); # if you need the ID
                +        my $seq;
                +        eval {$seq = get_sequence('genbank',$id);} # suppress bioperl error messages
                +        my $response = "";
                +        if ($seq){
                +            $length = length($seq);
                +            $response = "<GenericSequence namespace='NCBI_Acc' id='$id'>
                +                           <Integer namespace='' id='' articleName='Length'>$length</Integer>
                +                           <String namespace='' id='' articleName='SequenceString'>$seq</String>
                +                         </GenericSequence>";
                +        }
                +            $MOBY_RESPONSE .= simpleResponse($response, '', $queryID);
                +        }
                      }
                    }
                -   return responseHeader . $MOBY_RESPONSE . responseFooter;
                +   return responseHeader("my.authURI.com") . $MOBY_RESPONSE . responseFooter;
                  }


                DESCRIPTION

                -

                Used to do various transactions with MOBY-Central registry, including registering -new Object and Service types, querying for these types, registering new -Servers/Services, or queryiong for available services given certain input/output -or service type constraints.

                +

                CommonSubs are used to do various manipulations of MOBY Messages. It is useful +both Client and Service side to construct and parse MOBY Messages, and ensure +that the message structure is valid as per the API.

                +

                It DOES NOT connect to MOBY Central for any of its functions.


                AUTHORS

                -

                Mark Wilkinson (markw at illuminae.com)

                +

                Mark Wilkinson (markw at illuminae dot com)

                BioMOBY Project: http://www.biomoby.org

                @@ -127,33 +210,38 @@
                  name     : simpleResponse
                  function : wraps a simple article in the appropriate queryResponse structure
                - usage    : return responseHeader . &simpleResponse($object, 'MyArticleName') . responseFooter;
                + usage    : $resp .= &simpleResponse($object, 'MyArticleName', $queryID);
                  args     : (in order)
                             $object   - (optional) a MOBY Object as raw XML
                             $article  - (optional) an articeName for this article
                +            $query    - (optional, but strongly recommended) the queryID value for the
                +                        queryInput block to which you are responding
                  notes    : as required by the API you must return a response for every input.
                             If one of the inputs was invalid, you return a valid (empty) MOBY
                -            response by calling &simpleResponse() with no arguments.
                + response by calling &simpleResponse(undef, undef, $queryID) with no arguments.

                collectionResponse

                  name     : collectionResponse
                  function : wraps a set of articles in the appropriate queryResponse structure
                - usage    : return responseHeader . &collectionResponse(\@objects, 'MyArticleName') . responseFooter;
                + usage    : return responseHeader . &collectionResponse(\@objects, 'MyArticleName', $queryID) . responseFooter;
                  args     : (in order)
                             \@objects - (optional) a listref of MOBY Objects as raw XML
                             $article  - (optional) an articeName for this article
                +            $queryID  - (optional, but strongly recommended) the queryInput ID
                +                        to which you are responding
                  notes    : as required by the API you must return a response for every input.
                             If one of the inputs was invalid, you return a valid (empty) MOBY
                -            response by calling &collectionResponse() with no arguments.
                + response by calling &collectionResponse(undef, undef, $queryID).

                responseHeader

                - name     : responseHeader
                + name     : responseHeader($auth)
                  function : print the XML string of a MOBY response header
                - usage    : return responseHeader . $DATA . responseFooter;
                + usage    : return responseHeader('illuminae.com') . $DATA . responseFooter;
                + args     : a string representing the service providers authority URI
                  caveat   : will soon be expanded to include service provision info
                             and additional namespace declarations
                  notes    :  returns everything required up to the response articles themselves.
                @@ -167,7 +255,7 @@
                 
                  name     : responseFooter
                  function : print the XML string of a MOBY response footer
                - usage    : return responseHeader . $DATA . responseFooter;
                + usage    : return responseHeader('illuminae.com') . $DATA . responseFooter;
                  notes    :  returns everything required after the response articles themselves
                              i.e. something like:
                   
                @@ -175,12 +263,74 @@
                      </moby:MOBY>

                +

                getInputs

                +
                + name     : getInputs
                + function : get the queryInput block(s) as XML::DOM nodes
                + usage    : @queryInputs = getInputArticles($XML)
                + args     : the raw XML of a <MOBY> query, or an XML::DOM document
                + returns  : a list of XML::DOM::Node's, each is a queryInput.
                + Note     : Remember that queryInputs are numbered!  This is what you
                +            pass as the third argument to the simpleResponse or collectionResponse
                +            subroutine to associate the numbered input to the numbered response
                +

                +

                +

                getInputID

                +
                + name     : getInputID
                + function : get the value of the queryID element
                + usage    : @queryInputs = getInputID($XML)
                + args     : the raw XML or XML::DOM of a <queryInput> block
                + returns  : integer, or ''
                + Note     : queryInputs and queryResponses are coordinately enumerated!
                +            The integer you get here is what you
                +            pass as the third argument to the simpleResponse or collectionResponse
                +            subroutine to associate the numbered input to the numbered response
                +

                +

                +

                getArticles

                +
                + name     : getArticles
                + function : get the Simple/Collection articles for a single queryInput
                +            or queryResponse node
                + usage    : @articles = getArticles($XML)
                + args     : raw XML or XML::DOM of a moby:queryInput or a moby:queryResponse block
                + returns  : a list of listrefs; each listref is one component of the queryInput.
                +            a single queryInput/Responsemay consist of one or more named or unnamed
                +            simple or collection articles.  The listref structure is thus [name, $ARTICLE]:
                +            
                +            e.g.:  @articles = ['name1', $SIMPLE_DOM]
                +            or  :  @articles = ['name1', $COLLECTION_DOM], ['name2', $SIMPLE_DOM]...
                +
                +            the former is generated from the following sample XML:
                +
                +                <queryInput>
                +                    <Simple articleName='name1'>
                +                      <Object namespace=blah id=blah/>
                +                    </Simple>
                +                </queryInput>
                +                <queryInput>
                +                    <Simple articleName='name1'>
                +                      <Object namespace=blah id=blah/>
                +                    </Simple>
                +                </queryInput>
                +

                +

                +

                getCollectedSimples

                +
                + name     : getCollectedSimples
                + function : get the Simple articles collected in a moby:Collection block
                + usage    : @Simples = getCollectedSimples($XML)
                + args     : raw XML or XML::DOM of a moby:Collection block
                + returns  : a list of XML::DOM nodes, each of which is a moby:Simple block
                +

                +

                getInputArticles

                  name     : getInputArticles
                  function : get the Simple/Collection articles for each input query, in order
                  usage    : @queries = getInputArticles($XML)
                - args     : the raw XML of a <MOBY> query
                + args     : the raw XML of a moby:MOBY query
                  returns  : a list of listrefs, each listref is the input to a single query.
                             Remember that the input to a single query may be one or more Simple
                             and/or Collection articles.  These are provided as XML::DOM nodes.
                @@ -203,11 +353,7 @@
                                     </Simple>
                                 </queryInput>
                               </moby:Query>
                -                 ...
                - note     : This subroutine enforces valid message structure
                -            in that you may only have one Simple OR one Collection
                -            article per queryInput!  if you have more, only the first
                -            is read.
                + ...

                isSimpleArticle

                From mwilkinson at pub.open-bio.org Wed Nov 12 17:31:43 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 12:31:43 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121731.hACHVhx8012361@pub.open-bio.org> mwilkinson Wed Nov 12 12:31:42 EST 2003 Update of /home/repository/moby/moby-live/Perl In directory pub.open-bio.org:/tmp/cvs-serv12338 Modified Files: MANIFEST Added Files: Makefile.PL Log Message: Yay! We have a Makefile and test suite again! This is more simple than the one that Richard was working on at the Singapore hackathon (his was able to actually install and test local services), but this will at least install the modules and test the basic functionality of MOBY::Client::Central moby-live/Perl Makefile.PL,1.4,1.5 MANIFEST,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/Makefile.PL,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Perl/Makefile.PL 2003/10/09 16:49:22 1.4 +++ /home/repository/moby/moby-live/Perl/Makefile.PL 2003/11/12 17:31:42 1.5 @@ -1,100 +1,101 @@ use ExtUtils::MakeMaker; use FindBin '$Bin'; -#require 5.008; -my $VERSION = '0.04'; - -my $WWW_ROOT_PATH = "/usr/local/apache" ; -my $CGI_BIN = "cgi-bin" ; -my $WWW_USER = "www" ; -# -# RMB - Singapore biohackethon - Work in progress, to make a cleaner installation -# Welcome... -print STDERR "\n\nMOBY Installation (Perl Implementation)\n" ; -print STDERR "=======================================\n\n" ; - -my $line ; -print STDERR - "I need to know your web server path...\n", - "This is typically something like one of the following:\n\n", - "\tStandard Apache Unix location: '/usr/local/apache'\n", - "\tTypical location under Linux: '/var/www/'\n", - "\tLocation under Mac OS X: '/Library/WebServer'\n\n", - "Path to your WWW server root \[$WWW_ROOT_PATH\]? "; -chomp ($line = <>); -$WWW_ROOT_PATH=$line if ($line) ; -print STDERR "Setting WWW server root path to '$WWW_ROOT_PATH'\n\n" ; - -print STDERR - "I also need the name of your CGI script directory there:\n\n", - "\tMost of the time, this is 'cgi-bin'\n", - "\tbut Mac OS X uses 'CGI-Executables'\n\n", - "Name of your CGI directory \[$CGI_BIN\]? "; -chomp ($line = <>); -$CGI_BIN=$line if ($line) ; -my $CGI_BIN_PATH = "$WWW_ROOT_PATH/$CGI_BIN" ; -print STDERR "Setting CGI bin path to '$CGI_BIN_PATH'\n\n" ; - -print STDERR - "Your server runs under a specific user account.\n", - "\tUnder most installations, this is usually 'nobody' or 'www'\n", - "\tUnder Mac OS X, this is 'root'\n\n", - "Name of WWW server user account \[$WWW_USER\]? "; -chomp ($line = <>); -$WWW_USER=$line if ($line) ; -print STDERR "Setting WWW user to '$WWW_USER'\n\n" ; - -my $WWW_GROUP=$WWW_USER ; -print STDERR - "A UNIX group is also generally associated with the web directories.\n", - "\tThis may be the same as the above user account name, or\n", - "\tin be something else, like 'admin' in Mac OS X\n\n", - "Name of WWW server group \[$WWW_GROUP\]? "; -chomp($line = <>) ; -$WWW_GROUP=$line if($line) ; -print STDERR "Setting WWW group to '$WWW_GROUP'\n\n" ; -print STDERR "Press any key to continue...\n\n" ; -$line=<>; - -sub MY::post_initialize { - return <<"MAKE_FRAG"; -MOBY_WWW_ROOT_PATH = $WWW_ROOT_PATH -MOBY_CGI_BIN_PATH = $CGI_BIN_PATH -MOBY_WWW_USER = $WWW_USER -MOBY_WWW_GROUP = $WWW_GROUP -MAKE_FRAG -} +my $VERSION = '0.1'; +#my $WWW_ROOT_PATH = "/usr/local/apache" ; +#my $CGI_BIN = "cgi-bin" ; +#my $WWW_USER = "www" ; +## +## RMB - Singapore biohackethon - Work in progress, to make a cleaner installation +## Welcome... +#print STDERR "\n\nMOBY Installation (Perl Implementation)\n" ; +#print STDERR "=======================================\n\n" ; +# +#my $line ; +#print STDERR +# "I need to know your web server path...\n", +# "This is typically something like one of the following:\n\n", +# "\tStandard Apache Unix location: '/usr/local/apache'\n", +# "\tTypical location under Linux: '/var/www/'\n", +# "\tLocation under Mac OS X: '/Library/WebServer'\n\n", +# "Path to your WWW server root \[$WWW_ROOT_PATH\]? "; +#chomp ($line = <>); +#$WWW_ROOT_PATH=$line if ($line) ; +#print STDERR "Setting WWW server root path to '$WWW_ROOT_PATH'\n\n" ; +# +#print STDERR +# "I also need the name of your CGI script directory there:\n\n", +# "\tMost of the time, this is 'cgi-bin'\n", +# "\tbut Mac OS X uses 'CGI-Executables'\n\n", +# "Name of your CGI directory \[$CGI_BIN\]? "; +#chomp ($line = <>); +#$CGI_BIN=$line if ($line) ; +#my $CGI_BIN_PATH = "$WWW_ROOT_PATH/$CGI_BIN" ; +#print STDERR "Setting CGI bin path to '$CGI_BIN_PATH'\n\n" ; +# +#print STDERR +# "Your server runs under a specific user account.\n", +# "\tUnder most installations, this is usually 'nobody' or 'www'\n", +# "\tUnder Mac OS X, this is 'root'\n\n", +# "Name of WWW server user account \[$WWW_USER\]? "; +#chomp ($line = <>); +#$WWW_USER=$line if ($line) ; +#print STDERR "Setting WWW user to '$WWW_USER'\n\n" ; +# +#my $WWW_GROUP=$WWW_USER ; +#print STDERR +# "A UNIX group is also generally associated with the web directories.\n", +# "\tThis may be the same as the above user account name, or\n", +# "\tin be something else, like 'admin' in Mac OS X\n\n", +# "Name of WWW server group \[$WWW_GROUP\]? "; +#chomp($line = <>) ; +#$WWW_GROUP=$line if($line) ; +#print STDERR "Setting WWW group to '$WWW_GROUP'\n\n" ; +#print STDERR "Press any key to continue...\n\n" ; +#$line=<>; +# +#sub MY::post_initialize { +# return <<"MAKE_FRAG"; +#MOBY_WWW_ROOT_PATH = $WWW_ROOT_PATH +#MOBY_CGI_BIN_PATH = $CGI_BIN_PATH +#MOBY_WWW_USER = $WWW_USER +#MOBY_WWW_GROUP = $WWW_GROUP +#MAKE_FRAG +#} +# # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( - 'NAME' => 'MOBY', + 'NAME' => 'MOBY-S', 'VERSION' => $VERSION, 'PREREQ_PM' => { + 'SOAP::Lite' => 0.55, + 'XML::DOM' => 1.42, }, # e.g., Module::Name => 1.1 #'PM_FILTER' => "", ($] >= 5.005 ? ## Add these new keywords supported since 5.005 - (ABSTRACT => 'Perl module binding for MOBY', + (ABSTRACT => 'Perl module binding for MOBY-S', AUTHOR => 'Mark Wilkinson [markw at illuminae.com]') : ()), ); # # Insert additional MOBY specific Makefile targets # - -sub MY::postamble { - return <<"MAKE_FRAG"; -Central: - echo 'Make (local) MOBY Central stub' - -Server: - echo 'Make (local) MOBY Server stub' - -WWWClient: - echo 'Setting up MOBY WWW Client' - cp scripts/MOBY-Client.cgi \$(MOBY_CGI_BIN_PATH) - chown \$(MOBY_WWW_USER):\$(MOBY_WWW_GROUP) \$(MOBY_CGI_BIN_PATH)/MOBY-Client.cgi - -MAKE_FRAG -} +# +#sub MY::postamble { +# return <<"MAKE_FRAG"; +#Central: +# echo 'Make (local) MOBY Central stub' +# +#Server: +# echo 'Make (local) MOBY Server stub' +# +#WWWClient: +# echo 'Setting up MOBY WWW Client' +# cp scripts/MOBY-Client.cgi \$(MOBY_CGI_BIN_PATH) +# chown \$(MOBY_WWW_USER):\$(MOBY_WWW_GROUP) \$(MOBY_CGI_BIN_PATH)/MOBY-Client.cgi +# +#MAKE_FRAG +#} =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MANIFEST,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Perl/MANIFEST 2003/11/12 16:49:13 1.5 +++ /home/repository/moby/moby-live/Perl/MANIFEST 2003/11/12 17:31:42 1.6 @@ -22,12 +22,7 @@ MOBY/Client/SimpleArticle.pm MOBY/Client/SimpleInput.pm MOBY/Client/Service.pm -t/Central.t t/Client-Central.t -t/Registration.t -t/ServiceInstance.t -t/Service.t -t/BasicLocalServices.t scripts/debugYourService scripts/MOBY-Central.pl scripts/Services.cgi From mwilkinson at pub.open-bio.org Wed Nov 12 16:14:04 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 11:14:04 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121614.hACGE4aW011592@pub.open-bio.org> mwilkinson Wed Nov 12 11:14:04 EST 2003 Update of /home/repository/moby/moby-live/Perl/scripts In directory pub.open-bio.org:/tmp/cvs-serv11576 Removed Files: debug_a_service.pl Log Message: removing old moby-live/Perl/scripts debug_a_service.pl,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Perl/scripts/RCS/debug_a_service.pl,v: No such file or directory From mwilkinson at pub.open-bio.org Wed Nov 12 16:38:49 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 11:38:49 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121638.hACGcncD011745@pub.open-bio.org> mwilkinson Wed Nov 12 11:38:49 EST 2003 Update of /home/repository/moby/moby-live/Perl/scripts/Services In directory pub.open-bio.org:/tmp/cvs-serv11729/Services Added Files: HelloWorldService.pm Removed Files: PlanetLocalServices.pm Log Message: removed Rebecca's helloPlanet service and replaced it with a more generic helloWorld service that uses the correct new message structure and the CommonSubs routines to make it even easier. The helloWorld service simply echos back to you what you pass it. moby-live/Perl/scripts/Services HelloWorldService.pm,NONE,1.1 PlanetLocalServices.pm,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Perl/scripts/Services/RCS/PlanetLocalServices.pm,v: No such file or directory From mwilkinson at pub.open-bio.org Wed Nov 12 16:47:16 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 11:47:16 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121647.hACGlGus011866@pub.open-bio.org> mwilkinson Wed Nov 12 11:47:16 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv11847/MOBY Modified Files: CommonSubs.pm Log Message: added a somewhat useful subroutine to common subs that will extract the content of a request as a string moby-live/Perl/MOBY CommonSubs.pm,1.27,1.28 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/08 17:21:31 1.27 +++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm 2003/11/12 16:47:16 1.28 @@ -157,6 +157,7 @@ getArticles getCollectedSimples getNodeContentWithArticle + extractRawContent collectionResponse validateNamespaces isSimpleArticle @@ -177,6 +178,7 @@ getArticles getCollectedSimples getNodeContentWithArticle + extractRawContent collectionResponse validateNamespaces isSimpleArticle @@ -768,6 +770,31 @@ =cut +=head2 extractRawContent + + name : extractRawContent + function : pass me an article (Simple, or Collection) and I'll give you the + content AS A STRING - i.e. the raw XML of the contained MOBY Object(s) + usage : extractRawContent($simple) + input : the one element of the output from getArticles + returns : string + +=cut + + +sub extractRawContent { + my ($article) = @_; + return "" unless $article; + return "" unless ref($article) =~ /XML::DOM/; + my $response; + foreach ($article->getChildNodes){ + $response .= $_->toString; + } + return $response; + +} + + sub getNodeContentWithArticle{ # give me a DOM, a TagName, an articleName and I will return you the content # of that node **as a string** (beware if there are additional XML tags in there!) From mwilkinson at pub.open-bio.org Wed Nov 12 16:49:13 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 11:49:13 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121649.hACGnDMM011910@pub.open-bio.org> mwilkinson Wed Nov 12 11:49:13 EST 2003 Update of /home/repository/moby/moby-live/Perl In directory pub.open-bio.org:/tmp/cvs-serv11891 Modified Files: MANIFEST Log Message: updated MANIFEST in anticipation of releasing a Makefile (finally!) moby-live/Perl MANIFEST,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MANIFEST,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Perl/MANIFEST 2003/06/03 16:28:50 1.4 +++ /home/repository/moby/moby-live/Perl/MANIFEST 2003/11/12 16:49:13 1.5 @@ -1,36 +1,52 @@ MANIFEST README Changes -config/MOBYPatch.pl Makefile.PL -docs/INSTALL-Central.txt -docs/INSTALL-Client.txt -docs/INSTALL-Service_Provider.txt -docs/html/Central.html -MOBY.pm MOBY/authority.pm MOBY/central_db_connection.pm MOBY/mysql.pm MOBY/OntologyServer.pm +MOBY/CommonSubs.pm +MOBY/CrossReference.pm MOBY/service_instance.pm MOBY/service_type.pm MOBY/simple_input.pm MOBY/simple_output.pm MOBY/Central.pm -MOBY/Central_WSDL_SandR.wsdl MOBY/Client/Central.pm MOBY/Client/Registration.pm MOBY/Client/ServiceInstance.pm +MOBY/Client/CollectionArticle.pm +MOBY/Client/OntologyServer.pm +MOBY/Client/ServiceInstance.pm +MOBY/Client/SimpleArticle.pm +MOBY/Client/SimpleInput.pm MOBY/Client/Service.pm -MOBY/Services/BasicLocalServices.pm -MOBY/Services/Services.cgi t/Central.t t/Client-Central.t t/Registration.t t/ServiceInstance.t t/Service.t t/BasicLocalServices.t +scripts/debugYourService scripts/MOBY-Central.pl scripts/Services.cgi scripts/testMOBYCentral_v05.pl -scripts/testMOBYClientCentral_v05.pl \ No newline at end of file +scripts/testMOBYClientCentral_v05.pl +scripts/OntologyServer.cgi +scripts/Services/HelloWorldService.pm +scripts/Services/LocalServices.pm +lsid/authority/authority.pl +lsid/authority/ClassResolver.pm +lsid/authority/dbConfigure.pm.template +lsid/authority/dbConnect.pm +lsid/authority/Error.pm +lsid/authority/metadata.pl +lsid/authority/NamespaceResolver.pm +lsid/authority/PredicateResolver.pm +lsid/authority/RDFConfigure.pm +lsid/authority/RelationshipResolver.pm +lsid/authority/ServiceInstanceResolver.pm +lsid/authority/ServiceResolver.pm + + From mwilkinson at pub.open-bio.org Wed Nov 12 17:05:48 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 12:05:48 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311121705.hACH5mTL012057@pub.open-bio.org> mwilkinson Wed Nov 12 12:05:48 EST 2003 Update of /home/repository/moby/moby-live/Perl/t In directory pub.open-bio.org:/tmp/cvs-serv12037 Removed Files: BasicLocalServices.t Central.t Registration.t Service.t ServiceInstance.t Log Message: removing outdated test files moby-live/Perl/t BasicLocalServices.t,1.1,NONE Central.t,1.1,NONE Registration.t,1.1,NONE Service.t,1.1,NONE ServiceInstance.t,1.1,NONE rcsdiff: /home/repository/moby/moby-live/Perl/t/RCS/BasicLocalServices.t,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/t/RCS/Central.t,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/t/RCS/Registration.t,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/t/RCS/Service.t,v: No such file or directory rcsdiff: /home/repository/moby/moby-live/Perl/t/RCS/ServiceInstance.t,v: No such file or directory From mwilkinson at pub.open-bio.org Wed Nov 12 22:33:09 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Wed, 12 Nov 2003 17:33:09 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311122233.hACMX9sJ013630@pub.open-bio.org> mwilkinson Wed Nov 12 17:33:09 EST 2003 Update of /home/repository/moby/moby-live/Perl In directory pub.open-bio.org:/tmp/cvs-serv13611 Modified Files: Makefile.PL Log Message: okay, now we have a makefile that actually WORKS moby-live/Perl Makefile.PL,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/Makefile.PL,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Perl/Makefile.PL 2003/11/12 17:31:42 1.5 +++ /home/repository/moby/moby-live/Perl/Makefile.PL 2003/11/12 22:33:09 1.6 @@ -3,6 +3,10 @@ my $VERSION = '0.1'; +system "mkdir lib" unless (-e 'lib' && -d 'lib'); # put the files into the lib directory so that they will be properly installed +system "cp -rf MOBY lib"; + + #my $WWW_ROOT_PATH = "/usr/local/apache" ; #my $CGI_BIN = "cgi-bin" ; #my $WWW_USER = "www" ; From sipuijvl3 at msn.com Mon Nov 17 00:40:42 2003 From: sipuijvl3 at msn.com (Robbie Herndon) Date: Mon, 17 Nov 03 00:40:42 GMT Subject: [MOBY-guts] V 1 @ G R A ---> 75% Cheaper Today! wtxu e Message-ID: An HTML attachment was scrubbed... URL: From azaleeriecke at caste.loanprime.net Tue Nov 18 10:51:12 2003 From: azaleeriecke at caste.loanprime.net (Woman Solutions) Date: Tue, 18 Nov 2003 09:51:12 -0100 Subject: [MOBY-guts] Be the envy of all your friends! Message-ID: An HTML attachment was scrubbed... URL: From senger at pub.open-bio.org Thu Nov 20 17:08:47 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu, 20 Nov 2003 12:08:47 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311201708.hAKH8loo023950@pub.open-bio.org> senger Thu Nov 20 12:08:47 EST 2003 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv23931/docs Modified Files: ChangeLog Log Message: SOAPAction header added moby-live/Java/docs ChangeLog,1.5,1.6 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/09 01:05:02 1.5 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/20 17:08:46 1.6 @@ -1,3 +1,14 @@ +2003-11-20 Martin Senger + + * CentralImpl.call method can deal now with results of type byte[] + (base64 in the SOAP terminology). + + * CentralImpl sets now SOAPAction header. It was not needed when + accessing the Moby Central (registry) but some users started to + use CentralImpl also for calling services (by using + CentralImp.call method) and that usually required a SOAPAction + header. + 2003-11-09 Martin Senger * Added servlet properties for HTTP proxies and path to 'dot'. From senger at pub.open-bio.org Thu Nov 20 17:08:47 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Thu, 20 Nov 2003 12:08:47 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311201708.hAKH8lHq023969@pub.open-bio.org> senger Thu Nov 20 12:08:47 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv23931/src/main/org/biomoby/client Modified Files: CentralImpl.java Log Message: SOAPAction header added moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.3,1.4 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/08 00:27:24 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/20 17:08:47 1.4 @@ -133,6 +133,9 @@ Service service = new Service(); call = (Call) service.createCall(); call.setTargetEndpointAddress (endpoint); + + call.setSOAPActionURI (uri + "#" + method); + if (debug) { System.err.println ("METHOD CALL: " + method); System.err.println ("------------"); @@ -1067,6 +1070,9 @@ buf.append (tmp[i]); return new String (buf); } + if (result instanceof byte[]) + return new String ((byte[])result); + throw new MobyException ("Unknown type of result: " + result.getClass().getName()); } From mwilkinson at pub.open-bio.org Sat Nov 22 00:08:10 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Fri, 21 Nov 2003 19:08:10 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311220008.hAM08AY6029239@pub.open-bio.org> mwilkinson Fri Nov 21 19:08:10 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY/Client In directory pub.open-bio.org:/tmp/cvs-serv29220/Perl/MOBY/Client Modified Files: Central.pm Log Message: small fix to allow local registries moby-live/Perl/MOBY/Client Central.pm,1.61,1.62 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v retrieving revision 1.61 retrieving revision 1.62 diff -u -r1.61 -r1.62 --- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2003/11/04 15:05:45 1.61 +++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm 2003/11/22 00:08:10 1.62 @@ -247,6 +247,7 @@ my $url = $acc->{URL}; my $uri = $acc->{URI}; my $type = $acc->{TYPE}; + $type ||='soap'; if (lc($type) eq "get"){ push @{$self->Connections}, [$name, $type, $url]; } else { From mwilkinson at pub.open-bio.org Mon Nov 24 17:25:49 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon, 24 Nov 2003 12:25:49 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241725.hAOHPn5n014476@pub.open-bio.org> mwilkinson Mon Nov 24 12:25:49 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv14453/Perl/MOBY Modified Files: Central.pm OntologyServer.pm Log Message: fixed bug reported by Martin this AM. Relationships method should now return only the relationships that you asked for, and should not return duplicates... I hope... moby-live/Perl/MOBY Central.pm,1.111,1.112 OntologyServer.pm,1.28,1.29 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.111 retrieving revision 1.112 diff -u -r1.111 -r1.112 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2003/11/01 16:42:13 1.111 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2003/11/24 17:25:48 1.112 @@ -234,13 +234,10 @@ if ($term =~ /FAILED/){return &_error("Malformed XML;","");} return &_error("Malformed XML; may be missing required parameters objectType, Description, authURI or contactEmail",""); } - # push @{$relationships{$relationshipType}}, [$objectType, $articleName]; - # validate that the final ontology will be valid + # validate that the final ontology will be valid by testing against existing relationships and such while (my ($reltype, $obj) = each %{$relationships}){ my ($success, $message, $URI) = $RelOntologyServer->relationshipExists(term => $reltype, ontology => 'object'); # success = 1 if it does $success==0 && return &_error($message, $URI ); - } - while (my ($reltype, $obj) = each %{$relationships}){ foreach (@{$obj}){ my ($objectType, $articleName) = @{$_}; my ($success, $message, $URI) = $OntologyServer->objectExists(term => $objectType); # success = 1 if it does @@ -291,19 +288,12 @@ my ($success, $message, $deleteURI) = $OntologyServer->deleteObject(term => $term); # hopefully this situation will never happen! $success==0 && return &_error("object failed ISA and/or HASA connections, and subsequently failed deletion. This is a critical error, - and may indicate corruption of the MOBY Central registry", $deleteURI); + and may indicate corruption of the MOBY Central registry.", $deleteURI); return &_error("object failed to register due to failure during registration of ISA/HASA relationships".(join ",", (@failures))."\n", ""); } return &_success("Object $term registered successfully.", $URI); } - # - # ExistingObjectType - # ... - # ... - # - #... - #... sub _registerObjectPayload { my ($payload) = @_; @@ -863,13 +853,61 @@ =item * only Input Secondary articles are defined during registration; Output Secondary objects are entirely optional and may or may not be interpreted Client-side using their articleName tags. +=item * Service Categories: + +=over 3 + +=item * moby - for services that use the MOBY SOAP messaging format and object structure (i.e. the objects used in service transaction inherit from the root 'Object' Class in the MOBY Class ontology). + +=item * soap - for other SOAP services that do not use the MOBY messaging format. The other elements in the registration should be interpreted as follows: + +=over 2 + +=item * authURI - a URI representing your organization (e.g. yourdomain.com); no http-prefix, and no trailing path information is allowed. + +=item * serviceName - an arbitrary, but unique, name for your service within your authURI namespace + +=item * URL - the URL from which a WSDL document describing your service can be retrieved by an HTTP GET call. + +=item * Comments about Input and Output: + +=over 2 + +=item * in "moby" services, the input and output messaging structure is defined by the BioMOBY API, and the services use data Objects that are defined in the Class ontology as inheriting from the root "Object" Class. For "soap" services, there is additional flexibility: + +=over 2 + +=item * Similar to a "moby" service, your "soap" service must consume/produce ontologically valid named data-types in order to be discovered by registry searches. As such, you _must_ register a single unique name for any non-MOBY input or output data Classes, regardless of the actual complexity of the input/output message. + +=item * Do this using the registerObjectClass call of MOBY Central; To ensure uniqueness and LSID compatibilty of data class names, you must name your data using the following format: your.authURI:dataClassName + +=item * remember, you may use any MOBY Object as your input/output (i.e. any Class Ontology term that inherits from Object) so long as you follow the MOBY message structure for that input or output. + +=item * You may register, for example, a service that consumes a non-MOBY data Class and outputs a MOBY data class, so long as you follow the MOBY Messaging format for the output data + +=item * You may register, for example, a service that consumes a MOBY data Class and outputs a non-MOBY data class, so long as you follow the MOBY Messaging format for the ihput data + +=item * NOTE: Nether of the cases above are considred MOBY services, and are therefore described in the category of "soap" service + +=item * When registering a non-MOBY data Class name, it DOES NOT have any "Relationship" component (see registerObjectClass API) + +=item * non-MOBY inputs or outputs are described as a single Primary, Simple article of your new named type. + +=back + +=item * secondaryArticles - not applicable; should be left out of message. + +=back + +=back + =back Input XML : - moby + moby YourServiceNameHere TypeOntologyTerm your.URI.here @@ -1025,7 +1063,7 @@ return &_error("Category may take the (case sensitive) values 'moby', 'cgi', 'soap'\n","") unless (($Category eq "est") || ($Category eq "cgi") || ($Category eq "moby")); $debug && &_LOG("Entering switch with $Category method\n"); - return &_error("Service categories other than 'moby' are not yet implemented","") unless ($Category eq "moby"); + return &_error("Service categories other than 'moby' and 'soap' are not yet implemented","") unless ($Category eq "moby" || $Category eq "soap"); my @IN = @{$INPUTS}; my @OUT = @{$OUTPUTS}; my @SECS = @{$SECONDARY}; @@ -1050,6 +1088,8 @@ return &_error("$message","$URI") unless ($valid); # right, registration should be successful now! + # "soap" services may only have one input and one output + my $SVC = MOBY::service_instance->new( category => $Category, servicename => $serviceName, @@ -2259,22 +2299,22 @@ my $doc = $Parser->parse($payload); my $x = $doc->getElementsByTagName("relationshipType"); - my $l = $x->getLength; # might be a Collection object with multiple simples... + my $l = $x->getLength; my $exp = $doc->getElementsByTagName("expandRelationship"); - my $expl = $exp->getLength; # might be a Collection object with multiple simples... + my $expl = $exp->getLength; my $expand_relationship = &_nodeTextContent($doc, 'expandRelationship'); $expand_relationship =~ s/\s//g; $expand_relationship ||=0; - my @reltypes; + my %reltypes; for (my $n=0; $n < $l; ++$n){ my @child = $x->item($n)->getChildNodes; foreach (@child){ next unless ($_->getNodeType == TEXT_NODE); my $name .= $_->toString; $name =~ s/\s//g; - push @reltypes, $name; + $reltypes{$name} = 1; } } @@ -2286,13 +2326,20 @@ $ontology ||="service"; # if we have now succeeded and haven't already taken the ontology then it must be the service ontology &_LOG("Ontology was $ontology; Term was $term\n"); my $OS = MOBY::OntologyServer->new(ontology => $ontology); - my %rels = %{$OS->Relationships(term => $term, expand => $expand_relationship)}; + my %rels = %{$OS->Relationships(term => $term, expand => $expand_relationship)}; # %rels = $rels{relationship} = [lsid, lsid,lsid] my $response="\n"; my $OSrel = MOBY::OntologyServer->new(ontology => 'relationship'); + foreach (keys %reltypes){ # for each of our desired types + my $rellsid = $OSrel->getRelationshipURI($ontology, $_); # get the LSID + delete $reltypes{$_}; # remove the non-LSID version from the hash + $reltypes{$rellsid} = 1; # set the LSID as valid + } + # now for each of the relationship types that we were returned foreach (keys %rels){ my $rellsid = $OSrel->getRelationshipURI($ontology, $_); next unless $rellsid; + next unless $reltypes{$rellsid}; # next unless it is one ofthe relationship types we requested my $lsids = $rels{$rellsid}; next unless $lsids->[0]; $response .="\n"; =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2003/09/15 02:44:40 1.28 +++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2003/11/24 17:25:49 1.29 @@ -785,7 +785,7 @@ if ($direction eq 'root'){ unless (defined $relationship){ $defs = $self->dbh->selectall_arrayref(" - select s2.${ontology}_lsid, relationship_type from + select distinct s2.${ontology}_lsid, relationship_type from ${ontology}_term2term as t2t, $ontology as s1, $ontology as s2 @@ -795,7 +795,7 @@ s1.${ontology}_lsid = ?", undef, $term); # ") } else { $defs = $self->dbh->selectall_arrayref(" - select s2.${ontology}_lsid, relationship_type from + select distinct s2.${ontology}_lsid, relationship_type from ${ontology}_term2term as t2t, $ontology as s1, $ontology as s2 @@ -808,7 +808,7 @@ } else { unless (defined $relationship){ $defs = $self->dbh->selectall_arrayref(" - select s2.${ontology}_lsid, relationship_type from + select distinct s2.${ontology}_lsid, relationship_type from ${ontology}_term2term as t2t, $ontology as s1, $ontology as s2 @@ -818,7 +818,7 @@ s2.${ontology}_lsid = ?", undef, $term); # ") } else { $defs = $self->dbh->selectall_arrayref(" - select s2.${ontology}_lsid, relationship_type from + select distinct s2.${ontology}_lsid, relationship_type from ${ontology}_term2term as t2t, $ontology as s1, $ontology as s2 From mwilkinson at pub.open-bio.org Mon Nov 24 18:06:45 2003 From: mwilkinson at pub.open-bio.org (Mark Wilkinson) Date: Mon, 24 Nov 2003 13:06:45 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241806.hAOI6jwn015740@pub.open-bio.org> mwilkinson Mon Nov 24 13:06:45 EST 2003 Update of /home/repository/moby/moby-live/Perl/MOBY In directory pub.open-bio.org:/tmp/cvs-serv15721/Perl/MOBY Modified Files: Central.pm Log Message: the default is supposed to return all, not nothing moby-live/Perl/MOBY Central.pm,1.112,1.113 =================================================================== RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v retrieving revision 1.112 retrieving revision 1.113 diff -u -r1.112 -r1.113 --- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2003/11/24 17:25:48 1.112 +++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2003/11/24 18:06:45 1.113 @@ -2339,7 +2339,9 @@ foreach (keys %rels){ my $rellsid = $OSrel->getRelationshipURI($ontology, $_); next unless $rellsid; - next unless $reltypes{$rellsid}; # next unless it is one ofthe relationship types we requested + if (keys %reltypes){ + next unless $reltypes{$rellsid}; # next unless it is one ofthe relationship types we requested + } my $lsids = $rels{$rellsid}; next unless $lsids->[0]; $response .="\n"; From senger at pub.open-bio.org Mon Nov 24 18:45:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Mon, 24 Nov 2003 13:45:25 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241845.hAOIjPMX016047@pub.open-bio.org> senger Mon Nov 24 13:45:25 EST 2003 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv16028/docs Modified Files: ChangeLog Log Message: added relationships methods to Central.java moby-live/Java/docs ChangeLog,1.6,1.7 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/20 17:08:46 1.6 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/24 18:45:25 1.7 @@ -1,3 +1,8 @@ +2003-11-24 Martin Senger + + * Added several new methods to Central.java dealing with + relationships. Consequently MobyCmdLineClient got few new options. + 2003-11-20 Martin Senger * CentralImpl.call method can deal now with results of type byte[] From senger at pub.open-bio.org Mon Nov 24 18:45:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Mon, 24 Nov 2003 13:45:25 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241845.hAOIjPnT016086@pub.open-bio.org> senger Mon Nov 24 13:45:25 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv16028/src/Clients/help Modified Files: MobyCmdLineClient_usage.txt Log Message: added relationships methods to Central.java moby-live/Java/src/Clients/help MobyCmdLineClient_usage.txt,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt 2003/10/17 13:13:34 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyCmdLineClient_usage.txt 2003/11/24 18:45:25 1.3 @@ -33,6 +33,17 @@ -data print definition of given data type + To get ontological relationships of given entities: + + -ot + print all parents names of given service type + -od + print all relantionships (types and names) of given data type + -od2 ISA + -od2 HASA + -od2 HAS + print all relantionships of given type for given data type + To find services given by their attributes: -fn From senger at pub.open-bio.org Mon Nov 24 18:45:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Mon, 24 Nov 2003 13:45:25 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241845.hAOIjP1g016131@pub.open-bio.org> senger Mon Nov 24 13:45:25 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv16028/src/main/org/biomoby/shared Modified Files: Central.java Log Message: added relationships methods to Central.java moby-live/Java/src/main/org/biomoby/shared Central.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2003/09/24 14:33:37 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2003/11/24 18:45:25 1.2 @@ -14,7 +14,6 @@ /** * An interface to the Moby Registry. *

                - * * The Moby Registry service (or Moby Central service) is used to do * various transactions, including registering new Data and Service * types, querying for these types, registering new Services, or @@ -34,12 +33,29 @@ * http://biomoby.org. *

                * + *

                Last changes (in backwards order)
                + *
                  + *
                • New methods retrieving various types of relationships has been added: + * {@link #getDataTypeRelationships}, + * {@link #getServiceTypeRelationships} + *
                • Added constants defining recognizable relationship types + * ({@link #ISA}, {@link #HASA}, {@link #HAS}) + *
                + *

                * @author Martin Senger * @version $Id$ */ public interface Central { + /** A name for the relationship type "is a". */ + static final String ISA = "ISA"; + + /** A name for the relationship type "has a". */ + static final String HASA = "HASA"; + + /** A name for the relationship type "has". */ + static final String HAS = "HAS"; /************************************************************************** * Get a (redundant) list of all registered service names. @@ -71,6 +87,18 @@ throws MobyException; /************************************************************************** + * Get all ISA relationships of the given 'serviceTypeName'. + *

                + * @param serviceTypeName is an ontology term specifying whose + * relationships should be looked at + * @return an array of ontology terms defining all parents (direct + * or indirect) of the given 'serviceTypeName' + * @throws MobyException if communication with the Moby Registry fails + *************************************************************************/ + String[] getServiceTypeRelationships (String serviceTypeName) + throws MobyException; + + /************************************************************************** * Get the list of all registered namespaces. *

                * @return a hash table where keys are names of namespaces while @@ -99,6 +127,34 @@ MobyDataType getDataType (String dataTypeName) throws MobyException, NoSuccessException; + /************************************************************************** + * Get all relationships of the given 'dataTypeName'. + *

                + * @param dataTypeName is an ontology term specifying whose + * relationships should be looked at + * @return a Map of ontology terms defining all relationships of + * the given 'dataTypeName'. The keys (of type String) are from + * the set {@link #ISA}, {@link #HASA}, and {@link #HAS}. The + * values (of type String) are data type names. + * @throws MobyException if communication with the Moby Registry fails + *************************************************************************/ + Map getDataTypeRelationships (String dataTypeName) + throws MobyException; + + /************************************************************************** + * Get all relationships of type 'relationshipType' for the given + *'dataTypeName'.

                + * @param dataTypeName is an ontology term specifying whose + * relationships should be looked at + * @param relationshipType is one from the set {@link #ISA}, + * {@link #HASA}, and {@link #HAS}. + * @return an array of names specifying all related types (of the + * given type and for the given data type) + * @throws MobyException if communication with the Moby Registry fails + *************************************************************************/ + String[] getDataTypeRelationships (String dataTypeName, String relationshipType) + throws MobyException; + /************************************************************************* * Get XML Schema definition of the given data type. *

                From senger at pub.open-bio.org Mon Nov 24 18:45:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Mon, 24 Nov 2003 13:45:25 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241845.hAOIjPpH016066@pub.open-bio.org> senger Mon Nov 24 13:45:25 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv16028/src/Clients Modified Files: MobyCmdLineClient.java Log Message: added relationships methods to Central.java moby-live/Java/src/Clients MobyCmdLineClient.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2003/09/24 12:33:50 1.1 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2003/11/24 18:45:25 1.2 @@ -172,6 +172,35 @@ param.substring (pos+1))); } + if ((param = cmd.getParam ("-ot")) != null ) { + decorationLn ("Service type '" + param + "' is-a:"); + decorationLn ("------------"); + System.out.println (StringUtils.join (worker.getServiceTypeRelationships (param), + "\n")); + } + + if ((param = cmd.getParam ("-od")) != null ) { + decorationLn ("Relationships of data type '" + param + "':"); + decorationLn ("--------------------------"); + Map types = worker.getDataTypeRelationships (param); + + for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + System.out.println (entry.getKey()); + System.out.println ("\t" + + StringUtils.join ((String[])entry.getValue(), + "\n\t")); + } + } + + String[] params = cmd.getParam ("-od2", 2); + if ((params != null && params[0] != null && params[1] != null)) { + decorationLn ("Relationships of data type '" + params[0] + "' of type '" + params[1] + "':"); + decorationLn ("--------------------------"); + System.out.println (StringUtils.join (worker.getDataTypeRelationships (params[0], params[1]), + "\n")); + } + // // registrations of various entities // @@ -468,7 +497,7 @@ // // call a raw method (for debugging) // - String[] params = null; + params = null; if ((params = cmd.getParam ("-call", 2)) != null ) { if (params[0] != null) { if (params[1] == null) { From senger at pub.open-bio.org Mon Nov 24 18:45:25 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Mon, 24 Nov 2003 13:45:25 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311241845.hAOIjPwp016108@pub.open-bio.org> senger Mon Nov 24 13:45:25 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv16028/src/main/org/biomoby/client Modified Files: CentralImpl.java Log Message: added relationships methods to Central.java moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.4,1.5 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/20 17:08:47 1.4 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/24 18:45:25 1.5 @@ -628,7 +628,7 @@ /************************************************************************** * The 'retrieveObjectDefinition' method returns something like this; * - * + * * urn:lsid:biomoby.org:objectclass:go_term * * http://www.illuminae.com @@ -640,7 +640,7 @@ * urn:lsid:biomoby.org:objectclass:string * urn:lsid:biomoby.org:objectclass:string * - * + * * *************************************************************************/ public MobyDataType getDataType (String dataTypeName) @@ -1083,4 +1083,139 @@ this.debug = debug; } + /************************************************************************** + * The 'Relationships' method returns something like this; + * + * + * + * urn:lsid:biomoby.org:servicetype:analysis + * urn:lsid:biomoby.org:servicetype:service + * + * + *************************************************************************/ + public String[] getServiceTypeRelationships (String serviceTypeName) + throws MobyException { + String result = + (String)doCall ("Relationships", + new Object[] { + "" + + "" + serviceTypeName + "" + + "" + Central.ISA + "" + + "1" + + "" + }); + + // parse returned XML + Vector v = new Vector(); + Document document = parser.parse (new StringReader (result)); + NodeList list = document.getElementsByTagName ("Relationship"); + for (int i = 0; i < list.getLength(); i++) { + Element elem = (Element)list.item (i); + NodeList children = elem.getChildNodes(); + for (int j = 0; j < children.getLength(); j++) { + if (children.item (j).getNodeName().equals ("serviceType")) { + v.addElement (children.item (j).getFirstChild().getNodeValue()); + } + } + } + String[] results = new String [v.size()]; + v.copyInto (results); + return results; + } + + /************************************************************************** + * The 'Relationships' method returns something like this; + * + * + * + * urn:lsid:biomoby.org:objectclass:virtualsequence + * urn:lsid:biomoby.org:objectclass:object + * + * + * urn:lsid:biomoby.org:objectclass:string + * urn:lsid:biomoby.org:objectclass:integer + * + * + * + *************************************************************************/ + public Map getDataTypeRelationships (String dataTypeName) + throws MobyException { + String result = + (String)doCall ("Relationships", + new Object[] { + "" + + "" + dataTypeName + "" + + "" + Central.ISA + "" + + "" + Central.HASA + "" + + "" + Central.HAS + "" + + "1" + + "" + }); + + // parse returned XML + Map results = new HashMap(); + Document document = parser.parse (new StringReader (result)); + NodeList list = document.getElementsByTagName ("Relationship"); + + for (int i = 0; i < list.getLength(); i++) { + Element elem = (Element)list.item (i); + String relType = elem.getAttribute ("relationshipType"); + NodeList children = elem.getChildNodes(); + Vector v = new Vector(); + for (int j = 0; j < children.getLength(); j++) { + if (children.item (j).getNodeName().equals ("objectType")) { + v.addElement (children.item (j).getFirstChild().getNodeValue()); + } + } + String[] names = new String [v.size()]; + v.copyInto (names); + results.put (relType, names); + } + return results; + } + + /************************************************************************** + * The 'Relationships' method returns something like this; + * + * + * + * urn:lsid:biomoby.org:objectclass:virtualsequence + * urn:lsid:biomoby.org:objectclass:object + * + * + * + *************************************************************************/ + public String[] getDataTypeRelationships (String dataTypeName, + String relationshipType) + throws MobyException { + String result = + (String)doCall ("Relationships", + new Object[] { + "" + + "" + dataTypeName + "" + + "" + relationshipType + "" + + "1" + + "" + }); + + // parse returned XML + Vector v = new Vector(); + Document document = parser.parse (new StringReader (result)); + NodeList list = document.getElementsByTagName ("Relationship"); + + // it should always be just one element in this list + for (int i = 0; i < list.getLength(); i++) { + Element elem = (Element)list.item (i); + NodeList children = elem.getChildNodes(); + for (int j = 0; j < children.getLength(); j++) { + if (children.item (j).getNodeName().equals ("objectType")) { + v.addElement (children.item (j).getFirstChild().getNodeValue()); + } + } + } + String[] results = new String [v.size()]; + v.copyInto (results); + return results; + } + } From senger at pub.open-bio.org Tue Nov 25 13:18:10 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue, 25 Nov 2003 08:18:10 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIA1x019447@pub.open-bio.org> senger Tue Nov 25 08:18:10 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients In directory pub.open-bio.org:/tmp/cvs-serv19385/src/Clients Modified Files: MobyCmdLineClient.java MobyGraphs.java Log Message: added buglist for graphs; code cleaning moby-live/Java/src/Clients MobyCmdLineClient.java,1.2,1.3 MobyGraphs.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2003/11/24 18:45:25 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyCmdLineClient.java 2003/11/25 13:18:10 1.3 @@ -175,7 +175,7 @@ if ((param = cmd.getParam ("-ot")) != null ) { decorationLn ("Service type '" + param + "' is-a:"); decorationLn ("------------"); - System.out.println (StringUtils.join (worker.getServiceTypeRelationships (param), + System.out.println (StringUtils.join (worker.getServiceTypeRelationships (param, true), "\n")); } =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2003/11/08 00:27:24 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/MobyGraphs.java 2003/11/25 13:18:10 1.3 @@ -106,6 +106,38 @@ } // + // create a graph with service types + // + if (cmd.hasOption ("-t")) { + + // get all services types + v.clear(); + decorationLn ("Asking for all service types..."); + Map types = worker.getServiceTypes(); + for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String typeName = (String)entry.getKey(); + decorationLn ("Processing service type " + typeName + "..."); + MobyServiceType serviceType = new MobyServiceType (typeName); + serviceType.setDescription ((String)entry.getKey()); + serviceType.setParentNames (worker.getServiceTypeRelationships (typeName, false)); + v.addElement (serviceType); + } + decorationLn (""); + MobyServiceType[] serviceTypes = new MobyServiceType [v.size()]; + v.copyInto (serviceTypes); + decorationLn ("Creating a graph of the service types..."); + String graph = Graphviz.createServiceTypesGraph (serviceTypes, props); + param = cmd.getParam ("-ft"); + if (param == null) + param = cmd.getParam ("-f"); + if (param == null) + System.out.println (graph); + else + createFile (param, graph); + } + + // // create a graph with services // if (cmd.hasOption ("-s")) { From senger at pub.open-bio.org Tue Nov 25 13:18:11 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue, 25 Nov 2003 08:18:11 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIBU5019525@pub.open-bio.org> senger Tue Nov 25 08:18:11 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared In directory pub.open-bio.org:/tmp/cvs-serv19385/src/main/org/biomoby/shared Modified Files: Central.java Utils.java Log Message: added buglist for graphs; code cleaning moby-live/Java/src/main/org/biomoby/shared Central.java,1.2,1.3 Utils.java,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2003/11/24 18:45:25 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Central.java 2003/11/25 13:18:11 1.3 @@ -89,13 +89,16 @@ /************************************************************************** * Get all ISA relationships of the given 'serviceTypeName'. *

                - * @param serviceTypeName is an ontology term specifying whose + * @param serviceTypeName is a service type name whose * relationships should be looked at - * @return an array of ontology terms defining all parents (direct - * or indirect) of the given 'serviceTypeName' + * @param expand 'true' causes that all related type names are + * returned, 'false' means that only first-level neighbour is returned + * @return an array of service type names representing all parents + * (direct or indirect) of the given 'serviceTypeName' * @throws MobyException if communication with the Moby Registry fails *************************************************************************/ - String[] getServiceTypeRelationships (String serviceTypeName) + String[] getServiceTypeRelationships (String serviceTypeName, + boolean expand) throws MobyException; /************************************************************************** =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java 2003/10/17 13:13:35 1.2 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/Utils.java 2003/11/25 13:18:11 1.3 @@ -189,7 +189,7 @@ /************************************************************************* * Return just the last part of the LSID identifier. An example of - * an LSID identrifier as used by and returned from the Moby + * an LSID identifier as used by and returned from the Moby * registry is urn:lsid:biomoby.org:objectclass:object. *

                * From senger at pub.open-bio.org Tue Nov 25 13:18:11 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue, 25 Nov 2003 08:18:11 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIBqA019496@pub.open-bio.org> senger Tue Nov 25 08:18:10 EST 2003 Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client In directory pub.open-bio.org:/tmp/cvs-serv19385/src/main/org/biomoby/client Modified Files: CentralImpl.java GraphsServlet.java Graphviz.java Log Message: added buglist for graphs; code cleaning moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.5,1.6 GraphsServlet.java,1.3,1.4 Graphviz.java,1.1,1.2 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/24 18:45:25 1.5 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java 2003/11/25 13:18:10 1.6 @@ -1093,7 +1093,8 @@ * * *************************************************************************/ - public String[] getServiceTypeRelationships (String serviceTypeName) + public String[] getServiceTypeRelationships (String serviceTypeName, + boolean expand) throws MobyException { String result = (String)doCall ("Relationships", @@ -1101,7 +1102,7 @@ "" + "" + serviceTypeName + "" + "" + Central.ISA + "" + - "1" + + "" + (expand ? "1" : "0") + "" + "" }); =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/09 01:52:28 1.3 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/GraphsServlet.java 2003/11/25 13:18:10 1.4 @@ -21,7 +21,8 @@ /** - * A servlet making graphs of Moby services and Moby data types.

                + * A servlet making graphs of Moby service instances, Moby data types, + * and Moby service types.

                * * @author Martin Senger * @version $Id$ @@ -119,6 +120,7 @@ // these are filled in the static initializer static String[] supportedTypesForData; static String[] supportedTypesForServices; + static String[] supportedTypesForServiceTypes; static Hashtable contentTypes; static Hashtable displayNamesForTypes; @@ -137,6 +139,7 @@ boolean verbose = false; MobyDataType[] dataTypes; MobyService[] services; + MobyServiceType[] serviceTypes; long lastRead = -1; // in millis long refreshInterval = -1; // in millis @@ -166,6 +169,8 @@ T_PNG, T_GIF, T_JPG, T_PS, T_SVG, T_VRML, T_MIF, /* T_IMAP, T_CMAP, */ T_HPGL, T_PCL, T_FIG, T_DOT, T_CANON, T_PLAIN, T_RDF }; + supportedTypesForServiceTypes = supportedTypesForData; + displayNamesForTypes = new Hashtable(); displayNamesForTypes.put (T_PNG, "PNG - Portable Network Graphics"); displayNamesForTypes.put (T_GIF, "GIF Bitmap image"); @@ -298,8 +303,8 @@ worker.doGraphDataTypes (req, res); else if (exists (req, ACTION_JOB_SERVI)) worker.doGraphServices (req, res); -// else if (exists (req, ACTION_JOB_SERVT)) -// worker.doGraphServiceTypes (req, res); + else if (exists (req, ACTION_JOB_SERVT)) + worker.doGraphServiceTypes (req, res); else worker.doEntryPage (req, res); } @@ -543,6 +548,30 @@ h.submit (" Create Graph of Data Types ", ACTION_JOB_DATA))); out.println (h.end (BLOCKQUOTE)); + // --------------------------------------------- + out.println (h.gen (H3, "Graph of service types")); + // --------------------------------------------- + out.println (start (BLOCKQUOTE)); + + labels = null; + values = null; + synchronized (supportedTypesForServiceTypes) { + labels = new String [supportedTypesForServiceTypes.length]; + values = new String [supportedTypesForServiceTypes.length]; + for (int i = 0; i < supportedTypesForServiceTypes.length; i++) { + labels[i] = (String)displayNamesForTypes.get (supportedTypesForServiceTypes[i]); + values[i] = supportedTypesForServiceTypes[i]; + } + } + selected.clear(); + selected.put (T_PNG, "1"); + + out.println ("Select output type: "); + out.println (h.list (OUTPUT_TYPE_SERVT, labels, values, selected)); + out.println (h.gen (P, + h.submit (" Create Graph of Service Types ", ACTION_JOB_SERVT))); + out.println (h.end (BLOCKQUOTE)); + // ------------------------------------------------------------- out.println (h.gen (H3, "Additional visualization properties")); // ------------------------------------------------------------- @@ -657,39 +686,13 @@ } // create the real graphs (or an RDF representation) - String graph; if (wantedOutputType.equals (T_RDF)) { - graph = RDF.createServicesGraph (edges, props); + String graph = RDF.createServicesGraph (edges, props); cache.setContents (id, graph.getBytes()); } else { - graph = Graphviz.createServicesGraph (edges, props); - - // where is the 'dot' program - String dotProg = "dot"; - String dotPath = (String)initParams.get (DOT_PATH); - if (dotPath != null) - dotProg = dotPath + System.getProperty ("file.separator") + dotProg; - - // depending on the cache implementation we may ask - // 'dot' to produce output to its standard output, or - // to write to a file - if (cache.supportsFilenames()) { - - // note that this filename represents a not-yet-existing file - String filename = cache.getFilename (id); - - // call 'dot' to create a real graph in a 'filename' - executeDot (dotProg, graph, wantedOutputType, filename); - - } else { - - // call 'dot' to return a real graph as byte array - byte[] graphBytes = executeDot (dotProg, graph, wantedOutputType); - if (graphBytes == null || graphBytes.length == 0) - throw new MobyException ("An empty graph. Strange."); - cache.setContents (id, graphBytes); - } + createGraph (id, wantedOutputType, + Graphviz.createServicesGraph (edges, props)); } } res.sendRedirect (res.encodeRedirectURL (cache.getURL (id))); @@ -737,34 +740,56 @@ if (! cache.exists (id)) { // create a dot definition of the graph log ("Creating a graph of the data types...\n"); - String dotGraph = Graphviz.createDataTypesGraph (dataTypes, props); - - - // where is the 'dot' program - String dotProg = "dot"; - String dotPath = (String)initParams.get (DOT_PATH); - if (dotPath != null) - dotProg = dotPath + System.getProperty ("file.separator") + dotProg; - - // depending on the cache implementation we may ask - // 'dot' to produce output to its standard output, or - // to write to a file - if (cache.supportsFilenames()) { + createGraph (id, wantedOutputType, + Graphviz.createDataTypesGraph (dataTypes, props)); + } + res.sendRedirect (res.encodeRedirectURL (cache.getURL (id))); + + } catch (MobyException e) { + error (res, res.SC_SERVICE_UNAVAILABLE, e); + return; + } + } - // note that this filename represents a not-yet-existing file - String filename = cache.getFilename (id); + /************************************************************************* + * Create and return a graph of Moby service types. + *************************************************************************/ + protected void doGraphServiceTypes (HttpServletRequest req, HttpServletResponse res) + throws ServletException, IOException { - // call 'dot' to create a real graph in a 'filename' - executeDot (dotProg, dotGraph, wantedOutputType, filename); + // check if the output type is supported + String wantedOutputType = getString (req, OUTPUT_TYPE_SERVT); + if (wantedOutputType == null) + wantedOutputType = T_PNG; + boolean supported = false; + for (int i = 0; i < supportedTypesForServiceTypes.length; i++) { + if (supportedTypesForServiceTypes[i].equals (wantedOutputType)) { + supported = true; + break; + } + } + if (! supported) { + error (res, res.SC_SERVICE_UNAVAILABLE, + new MobyException ("Unrecognized output type '" + wantedOutputType + "'.")); + return; + } - } else { + // collect visualization properties + Properties props = new Properties(); + String rankdir = getString (req, RANKDIR); + if (rankdir != null) + props.put (Graphviz.PROP_RANKDIR, rankdir); - // call 'dot' to return a real graph as byte array - byte[] graph = executeDot (dotProg, dotGraph, wantedOutputType); - if (graph == null || graph.length == 0) - throw new MobyException ("An empty graph. Strange."); - cache.setContents (id, graph); - } + try { + // perhaps we have the same graph in the cache already + props.entrySet().toArray(); + String id = cache.createId (endpoint, GRAPH_SERVT, + wantedOutputType, lastRead, props); + if (! cache.exists (id)) { + // create a dot definition of the graph + log ("Creating a graph of the services types...\n"); + createGraph (id, wantedOutputType, + Graphviz.createServiceTypesGraph (serviceTypes, props)); } res.sendRedirect (res.encodeRedirectURL (cache.getURL (id))); @@ -777,9 +802,44 @@ /******************************************************************** * ********************************************************************/ + protected void createGraph (String id, + String wantedOutputType, + String graph) + throws MobyException, IOException { + + // where is the 'dot' program + String dotProg = "dot"; + String dotPath = (String)initParams.get (DOT_PATH); + if (! UUtils.isEmpty (dotPath)) + dotProg = dotPath + System.getProperty ("file.separator") + dotProg; + + // depending on the cache implementation we may ask + // 'dot' to produce output to its standard output, or + // to write to a file + if (cache.supportsFilenames()) { + + // note that this filename represents a not-yet-existing file + String filename = cache.getFilename (id); + + // call 'dot' to create a real graph in a 'filename' + executeDot (dotProg, graph, wantedOutputType, filename); + + } else { + + // call 'dot' to return a real graph as byte array + byte[] graphBytes = executeDot (dotProg, graph, wantedOutputType); + if (graphBytes == null || graphBytes.length == 0) + throw new MobyException ("An empty graph. Strange."); + cache.setContents (id, graphBytes); + } + } + + /******************************************************************** + * + ********************************************************************/ protected void readRegistryIfNeeded() throws MobyException { - if (dataTypes == null || services == null) { + if (dataTypes == null || services == null || serviceTypes == null) { readRegistry(); return; } @@ -827,6 +887,22 @@ dataTypes = new MobyDataType [v.size()]; v.copyInto (dataTypes); + // read all services types and their relationships + v.clear(); + log ("Asking for all service types...\n"); + types = registry.getServiceTypes(); + for (Iterator it = types.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + String typeName = (String)entry.getKey(); + log ("Processing service type " + typeName + "...\n"); + MobyServiceType serviceType = new MobyServiceType (typeName); + serviceType.setDescription ((String)entry.getKey()); + serviceType.setParentNames (registry.getServiceTypeRelationships (typeName, false)); + v.addElement (serviceType); + } + serviceTypes = new MobyServiceType [v.size()]; + v.copyInto (serviceTypes); + // read all services v.clear(); log ("Asking for all service names...\n"); @@ -1024,7 +1100,7 @@ h.gen (HR) + h.gen (DIV, ALIGN, "right", h.gen (FONT, SIZE, "-2", h.gen (ADDRESS, contact) + - "Last modified: " + UUtils.formatDate())); + "Page created: " + UUtils.formatDate())); } /************************************************************************* =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/Graphviz.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/Graphviz.java 2003/10/17 13:13:34 1.1 +++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/Graphviz.java 2003/11/25 13:18:10 1.2 @@ -157,6 +157,44 @@ } /************************************************************************* + * Creates a graph connecting 'serviceTypes' using their ISA + * relationship.

                + * + * @param servicesTypes represent nodes in the created graph + * @param props are some properties that can influence how the + * graph will look like; see the property names elswhere in this + * API what properties are understood + * + * @return a string with all definitions as understood by 'dot' + * program (from the graphviz package); this string can be saved + * in a '.dot' file that can be passed to a dot program to produce + * graphs in many available formats + * + *************************************************************************/ + static public String createServiceTypesGraph (MobyServiceType[] serviceTypes, + Properties props) { + + StringBuffer buf = new StringBuffer(); + buf.append ("digraph MobyServicesTypes {\n"); + buf.append ("\trankdir=" + props.getProperty (PROP_RANKDIR, "LR") + ";\n"); + buf.append ("\tedge [dir=back,arrowtail=empty];\n"); + for (int t = 0; t < serviceTypes.length; t++) { + MobyServiceType type = serviceTypes[t]; + String name = Utils.pureName (type.getName()); + String[] parents = type.getParentNames(); + for (int i = 0; i < parents.length; i++) { + buf.append ("\t"); + buf.append (trName (Utils.pureName (parents[i])).toLowerCase()); + buf.append (" -> "); + buf.append (trName (name).toLowerCase()); + buf.append (";\n"); + } + } + buf.append ("}\n"); + return new String (buf); + } + + /************************************************************************* * Append 'value' to 'buf'. If it is not the first value there, it * prefix it by a comma. *************************************************************************/ From senger at pub.open-bio.org Tue Nov 25 13:18:10 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue, 25 Nov 2003 08:18:10 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIAXI019423@pub.open-bio.org> senger Tue Nov 25 08:18:10 EST 2003 Update of /home/repository/moby/moby-live/Java/docs/graphs In directory pub.open-bio.org:/tmp/cvs-serv19385/docs/graphs Modified Files: index.html Added Files: buglist.html Log Message: added buglist for graphs; code cleaning moby-live/Java/docs/graphs buglist.html,NONE,1.1 index.html,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/graphs/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/docs/graphs/index.html 2003/11/09 01:05:02 1.2 +++ /home/repository/moby/moby-live/Java/docs/graphs/index.html 2003/11/25 13:18:10 1.3 @@ -76,7 +76,7 @@

                The main features

                  -
                • graphs of data types and service instances +
                • graphs of data types, service instances, and service types
                • selection on variety of output types (including common image formats, but also scalable vector graphics and RDF)
                • possibility to display only some services and some authorities, or to decide @@ -113,8 +113,10 @@
                • Add an option to "show only" or "do not show at all" the orphan services.
                • Add a better support for saving graphs into local files. -
                • Graphs of the service types - this can be done after BioMoby - registry makes this information accessible in its API. +
                • Add a graph showing pathes from input data-type to output data-type. +

                  + +

                • And there is a Bug List to work on...

                @@ -126,7 +128,7 @@

                Suggestions, comments, and bug reports to:
                Martin Senger
                -Last modified: Sun Nov 9 00:21:16 2003 +Last modified: Tue Nov 25 12:56:31 2003
                From senger at pub.open-bio.org Tue Nov 25 13:18:10 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue, 25 Nov 2003 08:18:10 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIAU3019404@pub.open-bio.org> senger Tue Nov 25 08:18:10 EST 2003 Update of /home/repository/moby/moby-live/Java/docs In directory pub.open-bio.org:/tmp/cvs-serv19385/docs Modified Files: ChangeLog Log Message: added buglist for graphs; code cleaning moby-live/Java/docs ChangeLog,1.7,1.8 =================================================================== RCS file: /home/repository/moby/moby-live/Java/docs/ChangeLog,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/24 18:45:25 1.7 +++ /home/repository/moby/moby-live/Java/docs/ChangeLog 2003/11/25 13:18:10 1.8 @@ -1,5 +1,7 @@ 2003-11-24 Martin Senger + * Added graphs of service types. + * Added several new methods to Central.java dealing with relationships. Consequently MobyCmdLineClient got few new options. From senger at pub.open-bio.org Tue Nov 25 13:18:10 2003 From: senger at pub.open-bio.org (senger@ebi.ac.uk) Date: Tue, 25 Nov 2003 08:18:10 -0500 Subject: [MOBY-guts] biomoby commit Message-ID: <200311251318.hAPDIAQU019467@pub.open-bio.org> senger Tue Nov 25 08:18:10 EST 2003 Update of /home/repository/moby/moby-live/Java/src/Clients/help In directory pub.open-bio.org:/tmp/cvs-serv19385/src/Clients/help Modified Files: MobyGraphs_usage.txt Log Message: added buglist for graphs; code cleaning moby-live/Java/src/Clients/help MobyGraphs_usage.txt,1.2,1.3 =================================================================== RCS file: /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2003/11/08 00:27:24 1.2 +++ /home/repository/moby/moby-live/Java/src/Clients/help/MobyGraphs_usage.txt 2003/11/25 13:18:10 1.3 @@ -5,8 +5,8 @@ -q ... quiet mode -d ... graph showing data types - -s ... graph showing services - -t ... reserved: for the graph of service types + -s ... graph showing service instances + -t ... graph showing service types output format: -dot ... (this is default) @@ -26,10 +26,12 @@ (makes sense only together with -d) -fs ... where to put the services graph (makes sense only together with -s) + -ft ... where to put the service types graph + (makes sense only together with -t) -f ... where to put (any) created graph - (makes sense only together with -d or -s, - but does not make sense if both -d and -s - are used) + (makes sense only together with -d, -s, + or -t, but does not make sense if two + or even all three of them are used) default: standard output graph properties: From f31dnvt at yahoo.com Wed Nov 26 07:37:56 2003 From: f31dnvt at yahoo.com (Queen Mccoy) Date: Wed, 26 Nov 03 07:37:56 GMT Subject: [MOBY-guts] re: FRee P-E-N-l-S PlLLZ WOW!! vo Message-ID: An HTML attachment was scrubbed... URL: