[MOBY] Re: [MOBY-l] XML namespaces

Ken Steube steube at sdsc.edu
Fri Oct 24 09:56:47 EDT 2003


On Fri, 24 Oct 2003, Mark Wilkinson wrote:
> On Fri, 2003-10-24 at 07:58, Paul Gordon wrote:
> > While I agree that if you declare it as the default name space, you
> > don't need the moby:, I **strongly** suggest you use an
> > XML parser that supports namespaces.
>
> I agree 110%.  If we put as much energy into re-coding the registry as
> we did complaining about the moby: namespace the problem wouldn't exist
> anymore.
>
> One thing for certain: we are *not* going to encourage slipshod XML, or
> redefine the XML specification itself just for our own convenience!  We
> have to maintain some credibility... even if it means an extra line or
> two of code here and there in the short-term.

I understand all that, but I'm not interested in solving your XML
parsing problems for you.  I'd rather write services at this time.

Call it complaining if you want, but I've asked you a question you
can't answer:

Why do you want to use two different XML namespaces '' and 'moby:' at
this time?  My interpretation of that would be that there are two
different data object ontologies, which is not the case at this time.
If the data doesn't require it, you don't want to use the extra level
of complication but instead reserve it for when you do need it.

The reason I have to ask this question is that my very simple XML
input has all these tags:

	<moby:queryInput>
	<moby:Simple>
	<moby:GenericSequence>
	<moby:Integer>
	<moby:String>
	<CrossReference>
	<Object>

To parse reliably I have to check twice that many because they may or
may not have an XML namespace.  Chances are pretty good that people
aren't going to do all this right and services will be unreliable.

All I'm asking is to make a simple choice: use the namespace or don't.

> Ken, if you send me the XML message that is causing you headaches I will
> fix the CommonSubs routine that is failing.  There should be little need
> for you to ever worry about the moby: prefix if you are using the
> CommonSubs routines...

CommonSubs isn't anywhere near to giving us what we need to parse MOBY
input XML. Take a look at the example below.

For each MOBY object I need to be able to parse it to get all these things:

	class

	namespace

	id

	articleName

	value

And I need parsing to do this too:

	all the above for any XML objects included within the top-level obj

	content of xref block

Ken



<?xml version='1.0' encoding='UTF-8'?>
<moby:MOBY xmlns:moby='http://www.biomoby.org/moby-s'>
<moby:Query>
  <moby:queryInput>
    <moby:Simple>
      <moby:AminoAcidSequence namespace='AGI_LocusCode' id='At3g19100' moby:articleName='seqA'>
        <moby:Integer namespace='' id='' articleName='Length'>947</moby:Integer>
        <moby:String  namespace='' id='' articleName='SequenceString'>
	  <CrossReference>
	    <Object namespace='taxon' id='9913'/>
	    <Object namespace='Global_Keyword' id='Bos taurus'/>
	    <Object namespace='NCBI_Acc' id='M80838'/>
	  </CrossReference>
	  sequence a
	</moby:String>
      </moby:AminoAcidSequence>
    </moby:Simple>
  </moby:queryInput>
  <moby:queryInput>
    <moby:Simple>
      <moby:AminoAcidSequence namespace='NCBI_gi' id='At3g19101' moby:articleName='seqB'>
        <moby:Integer namespace='' id='' articleName='Length'>947</moby:Integer>
        <moby:String  namespace='' id='' articleName='SequenceString'>sequence b</moby:String>
      </moby:AminoAcidSequence>
    </moby:Simple>
  </moby:queryInput>
</moby:Query>
</moby:MOBY>




More information about the moby-l mailing list