Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URI vs URL

 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Whats the diff between URL & URI...

Is it diff terms for same thing?

Tx
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure but a guess:

URI - universal resource indicator - it's the query string (the string after ?, which identify a particular resource).

URL - universal resource locator - it's the whole string ( server name (IP) + URI).

correct?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not quite right

Uniform Resource Identifier (URI)
Uniform Resource Locators (URL)

Refer to this RFC :
http://www.faqs.org/rfcs/rfc2396.html
And more :
http://www.w3.org/TR/uri-clarification/
[ May 08, 2006: Message edited by: Satou kurinosuke ]
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rathi...and Satou..

 
balakrishna nannaka
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
url is not there only uri exists for convieneance we call the path that includes server as url and actual resource as uri .
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure anyone really hit this on the head so far...

A URL is, as given earlier, a Uniform Resource Locator - it's what we colloquially call a "web address" and defines the host name and port of a server and the path to a resource on that server (including any extra query string data).

A URI is the general term given to all Resource Identifiers. A URL is a special case of a URI, but there are others, most notably a Uniform Resource Name (URN).

URNs are primarily intended for naming of resources and defining namespaces without reference to a path in a file system. They take the form:

urn:{namespace}:{otherdata}

where {namespace} is chosen by and assigned to the organisation and {otherdata} is chosen by the organisation to sub-categorise. For example, RFC 3121 gives the example:

urnasis:names:tc:docbook:dtd:xml:docbook:5.0b1

This is a urn (first bit) owned by the Oasis group (second phrase) and part of their "names" namespace, residing under the category "tc:docbook:dtd:xml:docbook" with version "5.0b1".

You might ask what use this is - in practise URNs are rarely used because there is no authorative body for their administration. Unlike domain names there is no main registration process, which makes it unclear who owns what namespaces. So URLs are in fact used in many places to define a namespace where in fact perhaps a URN would be better.

One example of a URN in J2EE is when declaring a tag library in a JSP document (the XML variety) where you want to refer to an explicit TLD or a tag file directory. In that case you can use these:

urn:jsptld:{path}
urn:jsptagdir:{path}

where {path} is the path to the TLD or the tag directory respectively.

So URNs do have limited use locally within applications, but their widespread use is much reduced. I don't know why many of the servlet methods talk about URIs when nearly always they actually mean URLs - perhaps they are left open for the possibility of using URNs etc. in the future?
[ May 08, 2006: Message edited by: Charles Lyons ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic