Qualifying namespace in schema

Ray Plante rplante at ncsa.uiuc.edu
Wed May 17 12:24:57 PDT 2006


Hi Guys,

I should note that "unqualified" helps the VOResource schema for 2 
reasons:
  o  the fact that we integrate metadata from multiple schemas (the core 
       and extension schemas)
  o  by virtue of the XML definition style we adopted and strictly adhere 
       to in all our extensions.  

Our definition style is described in the VOResource spec (sect. 2.2), but
it occurs to me that it would useful to write up a IVOA note that
describes not only the conventions but also the motivation behind it.  
(Gerard Lemson was the originator of this approach which the Registry WG
adopted and applied to our schemas).

The basics of the convention are:
  o  define only global complex types, no global elements (applications 
       are responsible for defining the document root element).  
  o  no anonymous type definitions (exception: restrictions for controlled 
       vocabulary okay as an anonymous type)
  o  no choice groups
  o  use xsi:type for polymorphism, not substitution groups.
  o  (a consistant naming convention; see VOResource spec.)

This results in a consistant view which maps well into object-oriented 
code and exposes in a limited but useful way inheritance relationships.  

Finally, I'll note that STC does not follow these convenstions, so the 
part of our records where it appears, the benefits of "unqualified" are 
not realized.  Because (in the registry context) the STC coverage will 
invariably need to handled differently from the rest of the record, it 
turns out that this is okay.  

I think the main benefit to VOEvent for adopting our definition 
conventions is that it will make XPaths used to extract/search data 
becomes simpler.  Instead of:

   voe:VOEvent/voe:Who/voe:Date

you have

   voe:VOEvent/Who/Date

(Since VOEvent is the document's root element, it must be globally defined 
and therefore requires a namespace prefix.)  Since VOEvent is mainly a 
single schema + STC, then you are not so harrassed by the namespace 
prefixes in an instance document, so "unqualified" doesn't necessarily 
simplify the view of the VOEvent document.  

hope this helps,
Ray



On Tue, 16 May 2006, Matthew Graham wrote:

> Hi,
> 
> Following the proposal to set elementFormDefault="unqualified" in the 
> resource schema, I am wondering whether we should adopt this for VOEvent 
> as well. What this does is mean that namespaces do not need to be 
> specified in an instance document (except on the root element) - this 
> results in a slightly smaller packet but also means that XPath 
> statements do not require namespace qualification and so Roy's 
> pseudo-code queries suddenly work as are. Note, however, that STC 
> components would (currently) still require the namespace specification.
> 
>     Cheers,
> 
>     Matthew
> 



More information about the voevent mailing list