Like HowStuffWorks on Facebook!

How Semantic Web Works


Knowing What's What: URIs
A URI gives a computer a specific point of reference for each item in the triple -- there's no need for interpretation or potential for misunderstanding.
A URI gives a computer a specific point of reference for each item in the triple -- there's no need for interpretation or potential for misunderstanding.

Even with the framework that XML and RDF provide, a computer still needs a very direct, specific way of understanding who or what these resources are. To do this, RDF uses uniform resource identifiers (URIs) to direct the computer to a document or object that represents the resource. You're already familiar with the most common form of URI -- the uniform resource locator (URL), which begins with http://. A URI can point to anything on the Web and may also point to objects that are not part of the web, like appliances in computerized homes. Mailto, ftp and telnet addresses are some other examples of URIs.

For our example, we'll use the characters' pages at the official Star Wars site as their URIs.

Now the computer knows what the subject and object are -- Anakin Skywalker is the entity represented by the first URI, and Luke Skywalker is the entity represented by the second. But you'll notice that the middle URI in our triple -- the one for the property -- doesn't point to the Star Wars site. Instead, it points to a make-believe document on the HowStuffWorks server. If that page really existed, it would be our XML namespace.

Unlike HTML, which uses standard tags like <b> for bold and <u> for underline, XML doesn't have standard tags. This is useful -- it lets developers create unique tags for specific purposes. But it means that a browser doesn't automatically know what the tags mean. An XML namespace is basically a document that tells applications the meaning of all the tags in another document. The creator of an XML document declares the namespace at the beginning of the document with a line of code. In our example, our namespace declaration would look like this:

<rdf:RDF xmlns:hsw=http://www.howstuffworks.com/example/RDF/relationship#>

That line of code says to the computer, "Any tags you see that begin with 'hsw' use the vocabulary found in this document. You can look up any tag beginning with 'hsw' here." That way, people can create the XML tags they need for a document without conflicting with other XML documents on the Web.

XML and RDF are the "official language" of the Semantic Web, but by themselves they're not enough to make the entire Web accessible to a computer. We'll look at some of the other layers next.


More to Explore