[xquery-talk] XQuery Style Conventions

McBeath, Darin W (ELS-AMS) D.McBeath at elsevier.com
Fri Oct 21 20:03:56 PDT 2005


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>>/<<file-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


More information about the talk mailing list