[MOBY] Re: [MOBY-l] Policy on the use of prefix 'moby'?

Gabriel Berriz gberriz at hms.harvard.edu
Tue Apr 13 19:07:33 UTC 2004


At 10:01 AM 4/13/2004 -0600, you wrote:
>There should probably be a caveat at the start of the MOBY-S API saying 
>that the use/lack of prefixes in the examples is not canonical.  To XML 
>aware applications, whether you use a default prefix, moby:, or even 
>xhtml: (if you're crazy), makes no difference at all, since the namespace 
>should always resolve to http://www.biomoby.org/moby in the examples 
>implicitly.

Gordon, I don't understand what you mean.  Please correct me if I'm wrong, 
but in

        <?xml version="1.0" encoding="UTF-8"?>
        <moby:MOBY xmlns:moby="http://www.biomoby.org/moby">
          <moby:Query>
            <moby:queryInput queryID='a1'>
              <Simple articleName=''>
                <Object namespace="Genbank/gi" id="163483"/>
              </Simple>
            </moby:queryInput>
          </moby:Query>
        </moby:MOBY>

...an XML-aware application should resolve the namespace of Simple, Object, 
queryID, articleName, namespace (the attribute), and id to null, not to 
http://www.biomoby.org/moby.

And as far as I can tell, this code would be not be valid XML:

        <?xml version="1.0" encoding="UTF-8"?>
        <moby:MOBY xmlns:moby="http://www.biomoby.org/moby">
          <moby:Query>
            <moby:queryInput queryID='a1'>
              <Simple xhtml:articleName=''>
                <Object namespace="Genbank/gi" id="163483"/>
              </Simple>
            </moby:queryInput>
          </moby:Query>
        </moby:MOBY>

...because the xhtml prefix (for articleName) is not defined (again, please 
correct me if I'm wrong).

The quickest fix for the last case would be to:

        <?xml version="1.0" encoding="UTF-8"?>
        <moby:MOBY xmlns:moby="http://www.biomoby.org/moby"
                   xmlns="http://www.biomoby.org/moby" <!-- to bring Simple,
                                                            Object, etc. 
into the
                                                            MOBY ns -->
                   xmnls:xhtml="http://www.w3.org/1999/xhtml">
          <moby:Query>
            <moby:queryInput queryID='a1'>
              <Simple xhtml:articleName=''>
                <Object namespace="Genbank/gi" id="163483"/>
              </Simple>
            </moby:queryInput>
          </moby:Query>
        </moby:MOBY>


I agree that all those 'moby:' prefixes make the code hard to read.  My 
guess is that the least cluttered version for the first example above would be

        <?xml version="1.0" encoding="UTF-8"?>
        <MOBY xmlns="http://www.biomoby.org/moby">
              xmlns:moby="http://www.biomoby.org/moby">
          <Query>
            <queryInput moby:queryID='a1'>
              <Simple moby:articleName=''>
                <Object moby:namespace="Genbank/gi" moby:id="163483"/>
              </Simple>
            </queryInput>
          </Query>
        </MOBY>

...since there's no away around using a prefix if we want attribute names 
such as id to belong to the MOBY namespace.

Incidentally, I've come across both http://www.biomoby.org/moby and 
http://www.biomoby.org/moby-s as the namespace for MOBY keywords.  Which 
one is preferable?

Gabriel




More information about the moby-l mailing list