[MOBY-l] MobyDataSetInstance vs MobyDataSimpleinstance

Paul Gordon gordonp at ucalgary.ca
Tue Apr 19 14:59:59 UTC 2005


Ha!  Just as I received this e-mail, I was commiting a change to this 
very code, which calls super.toXML() in CENTRAL_XML_MODE.  The fact that 
toXML() can generate both XMLs is a bit of a retrofit into the
nomenclature that existed before I started adding classes.  I was going 
to do the same for MobyDataSetInstance, but
it is not clear to me (no javadocs) from the MobyPrimaryDataSet class if 
setElements() should be given just a list of the datatypes the
set will hold, or if it is expecting instances.  The latter would be 
wierd, because the class does not encode data instances (and toXML()
as implemented would provide a very, very long service template XML if 
you had 1000 DNASequences, for example).  If the method
should be registering data types contained in the set, perhaps it should 
be renamed...

Benjamin Good wrote:

> I suppose MobyPrimaryDataSet is the answer to my question.  The main 
> difference between Instance and Primary - for communicating with Moby 
> Central is the presence of different serializations for talking with 
> Central versus executing a service - coming from this method.
>
>      public String toXML(){
>     if(xmlMode == SERVICE_XML_MODE)
>         return "<Simple xmlns=\""+MobyPrefixResolver.MOBY_XML_NAMESPACE+
>         (getName() != null ? "\" xmlns:moby=\""+
>          MobyPrefixResolver.MOBY_XML_NAMESPACE+"\" 
> moby:articleName=\"" + getName() : "")+
>         "\">" + dataValue + "</Simple>";
>     else{
>         MobyNamespace[] ns = getNamespaces();
>         String result = "<Simple 
> xmlns=\""+MobyPrefixResolver.MOBY_XML_NAMESPACE+"\">\n<objectType>" +
>         getDataType().getName() + "</objectType>\n";
>         for(int i = 0; ns != null && i < ns.length; i++){
>         result += "<Namespace>" + ns[i].getName() + "</Namespace>\n";
>         }
>         result += "</Simple>";
>         return result;
>     }
>     }
>
> Can this be avoided?  It adds another step and another complication to 
> client development that seems like it could be handled higher up the 
> API ????
>
> -Ben
>
> On Apr 19, 2005, at 5:32 AM, Martin Senger wrote:
>
>> Ben,
>>    I gues that Paul already answered your questions about this - but 
>> still
>> I wonder what have you been trying to do... It seems to me that you were
>> creating a service template to send it to the registry in order to find
>> matching services. Correct? I wonder why you needed 
>> MobyDataSetInstance at
>> all for that? The MobyDataSetInstance is Paul's extension to
>> MobyPrimaryDataSimple - but the class MobyPrimaryDataSimple already has
>> everything (I hope) to create a template for communicating with the
>> registry.
>>    This probably reflects one of the bad things in jMoby - we have a lot
>> of similarly named classes that (perhaps) overlap each other. I hope we
>> will have chance to discuss it in the jMoby BoF in Vancouver. Paul, are
>> you coming there?
>>
>>    Regards,
>>    Martin
>>
>> On Thu, 14 Apr 2005, Benjamin Good wrote:
>>
>>> There is no .setXmlMode in MobyDataSetInstance .  I think this will
>>> cause problems requesting services from Central ..??
>>>
>>> Has anyone built a collection in a java and used it to query for
>>> services successfully?
>>>
>>> I built a collection of Objects as below and didn't find any matching
>>> services?  This should match anything that accepts a collection as
>>> input because of the inheritance from object right??
>>>
>>>             //specify a dataype for use in the input to the template
>>> service
>>>             MobyDataType type = new MobyDataType("Object");
>>> //make a jMoby object to act as the input to the template (and later
>>> the actual call)
>>>             MobyDataSimpleInstance input1 = new MobyDataSimpleInstance
>>> ("");
>>>             input1.setDataType (type);
>>>             input1.addNamespace (new MobyNamespace ("NCBI_gi"));
>>>             input1.setId("111076");
>>>
>>>             MobyDataSimpleInstance input2 = new MobyDataSimpleInstance
>>> ("");
>>>             input2.setDataType (type);
>>>             input2.addNamespace (new MobyNamespace ("NCBI_gi"));
>>>             input2.setId("111077");
>>>
>>>             MobyDataSimpleInstance[] inputset = new
>>> MobyDataSimpleInstance[2];
>>>             inputset[0] = input1;
>>>             inputset[1] = input2;
>>>             MobyDataSetInstance input = new
>>> MobyDataSetInstance("",inputset);
>>>
>>> //specify that the xml generated for this object by the getXML method
>>> //is suitable for communicating with moby central --- doesn't exist!
>>>          //   
>>> input.setXmlMode(MobyDataSimpleInstance.CENTRAL_XML_MODE);
>>> //add the moby object as input to the template service
>>>             templateService.addInput(input);
>>>
>>> //Find services that match this template service
>>>             MobyService[] validServices =
>>> worker.findService(templateService);
>>>
>>> -> finds none
>>> -> why?
>>>
>>> thanks!
>>> -Ben
>>>
>>>
>>> http://bioinfo.icapture.ubc.ca/bgood
>>>
>>> _______________________________________________
>>> moby-l mailing list
>>> moby-l at biomoby.org
>>> http://biomoby.org/mailman/listinfo/moby-l
>>>
>>
>> -- 
>> Martin Senger
>>
>> EMBL Outstation - Hinxton                Senger at EBI.ac.uk
>> European Bioinformatics Institute        Phone: (+44) 1223 494636
>> Wellcome Trust Genome Campus             (Switchboard:     494444)
>> Hinxton                                  Fax  : (+44) 1223 494468
>> Cambridge CB10 1SD
>> United Kingdom                           
>> http://industry.ebi.ac.uk/~senger
>>
>>
> http://bioinfo.icapture.ubc.ca/bgood
>
> _______________________________________________
> moby-l mailing list
> moby-l at biomoby.org
> http://biomoby.org/mailman/listinfo/moby-l
>




More information about the moby-l mailing list