[MOBY-dev] BioMOBY namespace and attributes

Pieter Neerincx pieter.neerincx at wur.nl
Wed Apr 16 17:45:09 UTC 2008


Hi Mark,

On 16•Apr•2008, at 6:53 PM, Mark Wilkinson wrote:
> I think the honest answer would be "we have never really made a  
> decision".
>
> My understanding of the spec is as follows:
>
> articleName  is the same as moby:articleName  so long as the default  
> (xmlns="...") namespace and the moby namespace (xmlns:moby="...")  
> are the same.

That's what I expected :), but previously I never encountered  
moby:articleName, so my code is only looking for the attributes  
without the namespace prefix. Since the attributes with and without  
the namespace prefix are not the same for an XML parser (like  
XML::LibXML for those in the Perl world), my code doesn't find the  
ones with the namespace. I'll just have to change my code to look for  
both cases.

I can imagine people are reluctant to put the moby namespace prefix on  
each and every attribute name as it makes the XML rather fat. Usually  
you can leave them out, but I can also imagine that for a generic  
attribute name like "id" it is sometimes necessary to stick a  
namespace onto them to put them in the right context. It would have  
been handy if the XML specification would allow the declaration of a  
default namespace for attribute names too... but a.f.a.i.k. that's not  
possible.

> I'm not certain if Moby Central or the Moby server software  
> currently adds a defaut namespace, but it would be a good idea to do  
> so.

Yes, it does, which is good for the element names, but the default  
namespace has no effect on the attribute names.

> I could go through the code and make sure... would that help?

Not necessary yet, but if I run into problems with the BioMOBY code  
and can't fix it in CVS I'll let you know...

Thanks,

Pi

> M
>
>
>
>
> On Wed, 16 Apr 2008 08:09:15 -0700, Pieter Neerincx <pieter.neerincx at wur.nl 
> > wrote:
>
>> Hi,
>>
>> I'm having trouble with an XML parser in combination with a recent  
>> version of CommonSubs.pm and was wondering what the official rules  
>> are for applying the BioMOBY namespace (I'm talking about the xmlns  
>> thingy not the namespace atribute in BioMOBY objects). Therefore I  
>> have have the following questions:
>>
>> 1. Is the BioMOBY namespace required for BioMOBY object nodes?
>> 2. Is the BioMOBY namespace required for the id, namespace and  
>> articleName attributes of BioMOBY object nodes?
>> 3. Is the BioMOBY namespace required for the other attributes in  
>> BioMOBY XML? (for example the queryID attribute of the mobyData  
>> node.)
>>
>> With xmlns:moby='http://www.biomoby.org/moby' and xmlns='http://www.biomoby.org/moby' 
>>   for the default namespace defined somewhere higher up the tree  
>> are the following Object objects legal?:
>>
>> A. <     Object      namespace=''      id=''      articleName=''/>	 
>> legal:yes/no
>> B. <moby:Object      namespace=''      id=''      articleName=''/>	 
>> legal:yes/no
>> C. <     Object moby:namespace='' moby:id='' moby:articleName=''/>	 
>> legal:yes/no
>> D. <moby:Object moby:namespace='' moby:id='' moby:articleName=''/>	 
>> legal:yes/no
>>
>> The problem I have is that the default namespace only applies to  
>> element names, but not to attribute names as per XML spec.  
>> Therefore A and B are equivalents as are C and D, but  
>> moby:articleName is not the same attribute as articleName without  
>> the moby namespace prefix....
>>
>> Cheers,
>>
>> Pi
>>
>>
>>
>>
>> _______________________________________________
>> MOBY-dev mailing list
>> MOBY-dev at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/moby-dev
>
>
>
> -- 
> Mark D Wilkinson, PI Bioinformatics
> Assistant Professor, Medical Genetics
> The James Hogg iCAPTURE Centre for Cardiovascular and Pulmonary  
> Research
> Providence Heart + Lung Institute
> University of British Columbia - St. Paul's Hospital
> Vancouver, BC, Canada
>
> _______________________________________________
> MOBY-dev mailing list
> MOBY-dev at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/moby-dev
>

-------------------------------------------------------------
Wageningen University and Research centre (WUR)
Laboratory of Bioinformatics
Transitorium (building 312) room 1034

Dreijenlaan 3
6703 HA Wageningen
The Netherlands

phone:	+31 (0)317-483 060
fax:	+31 (0)317-483 584
mobile:	+31 (0)6-143 66 783
mail:	pieter.neerincx at wur.nl
skype:	pieter.online
------------------------------------------------------------






More information about the MOBY-dev mailing list