OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Best Practice for URI construction?

[ Lists Home | Date Index | Thread Index ]

Roger,
Isn't the query string part just parameterising the node in the resource 
hierarchy?  What the best practices are seems to hinge on what the 
properties of the hierarchy in the URL path are, otherwise the 
information content is about the same.

We have a structure like:  hierarchy, then qualifiers of the identified 
node, then fragment.  Where hierarchy and relative references are 
intrinsic to the resource (unix and windows filesystem objects for 
example) the elements should be encoded using the hierarchy part.  If 
you don't have relative references or a hierarchy 
(http://balloon.private/?color1=r&colourA=blau&clr=hitam) then there 
doesn't seem to be anything gained by encoding the qualifiers in a path 
and a certain amount to be lost (why are the qualifiers ordered as they 
are?, what if I want to leave out or wildcard the middle of the hierarchy?).

Greg

Costello, Roger L. wrote:

> Hi Folks,
>  
> A URI is used to "identify" a resource:
>  
> /A Uniform Resource Identifier (URI) is a compact sequence of 
> characters that _identifies_ an abstract or physical resource./[1]
>  
> I would like to bound the following discussion by considering just 
> URLs that use the http scheme.
>  
> As I see it, there are two main approaches to constructing a URL to 
> identify a resource:
>  
> *Approach 1. URL Construction using Parent/Child Relationships*
>  
> Here's an example of a URL that uses this approach:
>  
> http://www.location.org/US/MA/Boston
>  
> After the [host] (www.location.org <http://www.location.org>) 
> there are a series of slash-delimited names.  The name to the left 
> of a slash is the parent.  The name to the right of a slash is the child.
>  
> *Approach 2. URL Construction using Key-Value Pairs plus Conjunction*
>  
> This second approach is exemplified with this URL:
>  
> http://www.location.org?country=US&state=MA&city=Boston 
> <http://www.location.org?country=US&state=MA&city=Boston>
>  
> After the [host] there is the query string delimiter (?) followed by 
> one or more key=value pairs ANDed together.
>  
> Hybrids of the above two approaches are also possible.  For example:
>  
> http://www.location.org/US/MA?city=Boston
>  
> *Questions*
>  
> (1) The above URLs (I believe) are expressing the same thing - they 
> are identifying the same resource.  So which is "better"?
>  
> (2) As was noted at the top, the purpose of a URL is to "identify" a 
> resource.  Can every resource in the universe be identified using the 
> above two approaches?  Are there resources that do not lend themselves 
> to identification using the above two approaches?
>  
> /Roger
>  
> [1] http://www.gbiv.com/protocols/uri/rfc/rfc3986.html
>  
>  





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS