[MOBY-dev] BUG in MobyRequest
Andreas Groscurth
groscurt at mpiz-koeln.mpg.de
Tue Dec 16 14:04:30 UTC 2008
Hi,
I guess I found a bug in the MobyRequest system....
I want to call the service ID2Taxonomy from our institute more than once
with several inputs. Therefore i wrote the following program, which
works fine.
But if I change e.g. the second identifier (NP_080073.1) to
AC144389_35.2, which does not return a result for the webservice, then
NO result is returned at all.
So, if apparently an input does not return a result, none (or some) also
do not return a result, although they should.
Basically there are different results depending at which position the
identifier with no result appears.
1. AC144389_35.2 is at first position - the other return a result... (so
thats ok)
2. AC144389_35.2 is at second position - no input returns any result :-(
3. AC144389_35.2 is at third position - only the second returns a result :-(
and its getting even more confusing... if i use the same string for the
job identifier as for the mobyobject identifier (e.g. in both cases
NP_510335.2), then no result is returned. As soon as i changed the job
identifier to anything different than NP_510335.2 - it works again and I
get back a result.
Did i do anything wrong or is this a bug ?
Thanks and cheers
Andreas
public static void main( String[] args ) throws Exception {
Central central = new CentralDigestCachedImpl();
MobyRequest mobyRequest = new MobyRequest( central );
MobyDataObject dataObject1 = new MobyDataObject( "", "NP_510335.2" );
MobyDataObject dataObject2 = new MobyDataObject( "", "NP_080073.1" );
MobyDataObject dataObject3 = new MobyDataObject( "", "NP_491931.1" );
MobyContentInstance instance = new MobyContentInstance();
MobyDataJob job = new MobyDataJob();
job.put( "obj1", dataObject1 );
instance.put( "obj1", job );
job = new MobyDataJob();
job.put( "obj2", dataObject2 );
instance.put( "obj2", job );
job = new MobyDataJob();
job.put( "obj3", dataObject3 );
instance.put( "obj3", job );
mobyRequest.setInput( instance );
MobyService mobyservice = new MobyService();
mobyservice.setName( "ID2Taxonomy" );
mobyservice = central.findService( mobyservice )[ 0 ];
mobyRequest.setService( mobyservice );
instance = mobyRequest.invokeService();
for ( String string : instance.keySet() ) {
System.out.println( "key " + string );
MobyDataJob dataJob = instance.get( string );
MobyDataInstance[] instances = dataJob.getPrimaryData();
for ( MobyDataInstance mobyDataInstance : instances ) {
MobyDataComposite composite = ( MobyDataComposite ) mobyDataInstance;
System.out.println( "DATA " + composite.getId() + " - " + composite.get( "Name" ) );
}
}
}
--
/***************************************************
Dipl. Bioinf. Andreas Groscurth
Software developer
Plant Computational Biology group
Max-Planck Institute for plant breeding research
Carl-von-Linne Weg 10
50829 Cologne
Germany
+49(0) 221 5062449
***************************************************/
More information about the MOBY-dev
mailing list