spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

Resources and URIs

Developer News
Metasploit 3.2 Offers More 'Evil Deeds'
'Thank You Apple. Seriously.'
The Buzz: BlackBerry App Store Seen Next

At some point in the past, someone came up with the concept of a resource. What is a resource, you ask? Everything is! This page is a resource, this sentence is a resource, you're a resource, I'm a resource, my e-mail inbox is a resource. Resources are the most general type of abstraction. A resource is just something, anything.

So, I hear you asking, what's the reason for abandoning a good old English word like "thing" and calling things resources? The reason is not quite clear, but it boils down to the fact that we need some way of accessing resources. The important characteristic of a resource, however, is that it is unique.

If you've been using the Internet for even a short while, you'll have realized that trillions of things are accessible through it. The need for a general way to refer to things has come about. For instance, when I want to refer to this Web page, I need a simple way to describe it, that can be comprehended by both humans and computers. And hence, some innovative people came up with Uniform Resource Identifiers (URIs).

A URI identifies a resource (which, as I pointed out, is just a fancy word for "thing"). There are two kinds of URIs: URNs, or Uniform Resource Names and URLs, or Uniform Resource Locators. Confused yet? You should be. I'm going to cover a few basics on URI syntax. If you get too confused, don't worry, it'll become clearer in the next section where I give some examples and show URIs in action.

There are basically two kinds of resources (things). Some are unique, but might have many instances. For instance, Shakespeare's Hamlet is a unique resource, as in it is a single body of text. Hamlet, act V, scene I, lines 2-15, is still a unique piece of text. It is the same piece of text no matter where we find it: in a book, a voice recording, a CD-ROM, the videotape of a stage production, even the Mel Gibson movie (albeit with more cheese added). A URN points to such a resource; it doesn't tell us where to find it, but it does uniquely identify a resource.

The other kind of resource is something that is unique in that it has a unique location where it can be found. This Web page is an example. It resides on WebReference.com's Web server, in the Experts section, in the HTML with Style area, in the first page of the second tutorial. It could also be published in a book, or recited, or be printed out and stacked on your desk, but these instances would be different. This is the kind of resource identified by a URL. A URL will tell us where a resource is located. It's a lot like a postal address - in fact, postal addresses can be expressed as URLs.

So a URI is a way of identifying something. As you might have guessed, both URNs and URLs are very useful for different purposes. Unfortunately, at the time this document is being written, URNs are still new technology and are not well defined. Most HTML user agents definitely do not supported by them. So, in this tutorial, we will concentrate on URLs.

URLs have a certain defined syntax that is beyond the scope of this tutorial. If I were to tell you everything about the rules of how to write URLs, I'd be going on all day. Instead, I'll cover only the types of URLs that you're most likely to use in your Web pages. If practice changes on this topic and people start using a new type of URL or URI, watch this space closely as I'll update the tutorial to reflect it.

The only general rule I'm going to mention about URLs is that they can be broken down into three parts: the scheme name, a colon (:), and the location itself. Here are some examples:

http://WebReference.com/html/
mailto:stephanos@webreference.com

In the above examples, the scheme names are http and mailto. They are followed by a colon and a bunch of characters that is the main body of the URI. The scheme defines the way the rest of the URI is interpreted. For example, take the two URLs below:

http://WebReference.com/html/
ftp://WebReference.com/html/

These point to different locations, because although they have the same syntax after the colon, they have different schemes, and so are interpreted differently. The text //WebReference.com/html/ has different meaning in the http URL scheme than it does in the ftp URL scheme.

You may have noticed that some URL schemes use a series of words separated by slash characters (/). These fall under the heading of generic URLs. Everything else is an opaque URL. The http scheme, for instance, defines generic URLs. The mailto scheme, on the other hand, defines opaque URLs. The reason we make this distinction is that it is possible to have relative URLs when the scheme we are using creates generic URLs. We'll cover relative URLs later on, so keep that in mind.

I know you're probably confused by now, so here's a breakdown of what we've covered on URIs:

Now let's see all of that in action as we look at the http URL scheme

Front Page12345678

http://www.internet.com

Produced by Stephanos Piperoglou


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
Avaya Article: Call Control XML - Powerful, Standards-Based Call Control
Tripwire Whitepaper: Seven Practical Steps to Mitigate Virtualization Security Risks
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
Microsoft Partner Portal Video: Microsoft Gold Certified Partners Build Successful Practices
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview · Controllers: Programming Application Logic - Part 2 · How to Use JavaScript to Validate Form Data
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Choosing the Right Online Backup Provider · Mother Avaya Nurtures Her Technology Partners · Software as a Service a Winning Model for Hotspot Provider


All Rights Reserved. Legal Notices.

URL: http://www.webreference.com/html/tutorial2/1.html
Created: June 11, 1998
Revised: June 11, 1998