[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Best Practice for URI construction?

  • To: "XML Developers List" <xml-dev@l...>
  • Subject: Best Practice for URI construction?
  • From: "Costello, Roger L." <costello@m...>
  • Date: Fri, 9 Dec 2005 09:21:13 -0500
  • Thread-index: AcX8y88cf76Sz8g3QjKuR8zgIdCFfg==
  • Thread-topic: Best Practice for URI construction?

uri construction
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] (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
 
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
 
 

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.