[xquery-talk] XQuery Style Conventions

Michael Kay mhk at mhk.me.uk
Fri Oct 21 21:45:34 PDT 2005


My inclination is that modules should either be fetched by name or by
location. I don't see very much sense in using the location URI and then
making it anything other than a dereferencable relative URI that returns the
query text. If you want some sort of catalog to provide indirection, then it
makes sense to drive this from the module namespace URI rather than from the
location hints.

I'm not sure I would want version information in either of the URIs. I don't
normally say in a source program which version of dependent software I want
to invoke: that's configuration information that's much better held in some
external place, like the indirection catalog mentioned above.

I hope someone will develop an informal standard in this area along the
lines of Oasis catalogs.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: talk-bounces at xquery.com 
> [mailto:talk-bounces at xquery.com] On Behalf Of McBeath, Darin 
> W (ELS-AMS)
> Sent: 21 October 2005 19:04
> To: talk at xquery.com
> Subject: RE: [xquery-talk] XQuery Style Conventions
> 
> 
> Martin. 
> 
> I would agree that our choice of a module namespace URI in 
> the example was
> poorly chosen ... we will address that in the next draft version.  We
> actually have adopted some internal best practices for both 
> module namespace
> URIs and module location URIs.  I initially elected not to 
> include these in
> the XQuery Style Conventions, but below I have included some 
> of our thoughts
> on this matter.  Be warned, I'm sure our views will not be 
> agreeable with
> everyone.
> 
> 
> Module Namespace URIs
> =====================
> 
> The module namespace declaration inside a library module 
> should adhere to
> the following convention:
> 
> http://xquery.<<domain-name>>/<<some-optional-path-info>>/<<fi
> le-name-withou
> t-suffix>>
> 
> So, it would look something like the following:
> 
> http://xquery.elsevier.com/fabrication/utilities
> 
> 
> Module Location URIs
> ====================
> 
> Since the current spec leaves the 'at' location 
> implementation defined, we
> have attempted to error on the side of flexibility.  We 
> recommend a relative
> path approach (based on the module namespace URI). If this 
> approach is used,
> then we believe the file could be found via the file system, a webdav
> server, some sort of XML catalog type utility, etc.  So, the 
> location URI
> should adhere to the following convention (note the 
> relationship to the
> module namespace structure):
> 
> /<<some-optional-path-info>>/<<file-name-with-suffix>>
> 
> So, it would look something like the following:
> 
> /fabrication/utilities.xqy
> 
> We have also incorporated versioning thoughts into both of 
> the above URIs,
> but I would rather defer that discussion and just solicit 
> feedback on the
> above first.  I realize that a huge debate will be created 
> when one suggests
> incorporating version information into URIs ... some like it, 
> some tolerate
> it, and some just plain hate it.
> 
> In any case, I would be interested in your thoughts on the 
> above.  We could
> certainly add this to the document if people believe it would 
> be worthwhile.
> 
> Darin.
> 
> 
> 
> -----Original Message-----
> From: talk-bounces at xquery.com 
> [mailto:talk-bounces at xquery.com] On Behalf Of
> Martin Probst
> Sent: Friday, October 21, 2005 6:01 AM
> To: talk at xquery.com
> Subject: Re: [xquery-talk] XQuery Style Conventions
> 
> Hi,
> 
> you given an example for a module import including a namespace:
> 
> > import module namespace math="sample/sample-math-lib" at 
> "SampleLib.xqy";
> 
> I would actually like to see some advise on picking a namespace for
> your module in that document. And I don't think just picking a path is
> really the right thing - module namespaces should be unambiguous, and
> probably follow normal namespace conventions, e.g.
> > module namespace math = "http://example.org/math-functions";
> 
> The specification doesn't say much about that, except that an 
> implementation
> may raise an error in your case. Think about implementations 
> that don't rely
> on a location identifier ('at "foo"') but rather have some 
> sort of a mapping
> from namespaces to actual modules built-in (not that I know 
> any, but it's 
> certainly legal). If you module namespaces are ambiguous, you have a
> problem.
> 
> Martin
> 
> _______________________________________________
> talk at xquery.com
> http://xquery.com/mailman/listinfo/talk
> _______________________________________________
> talk at xquery.com
> http://xquery.com/mailman/listinfo/talk
> 




More information about the talk mailing list