W3C home > Mailing lists > Public > semantic-web@w3.org > September 2006

Re: Basic Namespace

From: Danny Ayers <danny.ayers@gmail.com>
Date: Fri, 22 Sep 2006 10:14:06 +0200
Message-ID: <1f2ed5cd0609220114h7731094aydc262fa6dbebbb50@mail.gmail.com>
To: NOMADMY <nomadmy@gmail.com>
Cc: semantic-web@w3.org

On 21/09/06, NOMADMY <nomadmy@gmail.com> wrote:

> 1.) Why some ended with '#' and some can be ended with '/'?
> 2.) Why have 2 different format?
> 3.) What is the '#' means?

The exact definitions will be in the specs somewhere, and my history
may not be accurate, but roughly:

XML Namespaces says how to create a space for names using URIs, so

<ex:something xmlns:w="http://example.org/space/" />

means that the term "something" used here is in the
"http://example.org/space/" namespace.

RDF goes a step further in saying that the terms are themselves are
identified with URIs, which are constructed by prefixing the local
name with the namespace URI. URI syntax supports (at least?) two ways
of doing this this namespace+name concatenation, with namespace URIs
that end with "/" (slash) and those that end with "#" (hash), e.g.

<ex:something xmlns:w="http://example.org/space/" />

means that the term "something" used here is the term with the URI
http://example.org/space/something

similarly:

<ex:something xmlns:w="http://example.org/space#" />

means that the term "something" used here is the term with the URI
http://example.org/space#something

Without hash or slash you'd end up with URIs like
http://example.org/spacesomething, which is harder to pull apart.

The # in URIs is know as a fragment identifier (frag id), it
originates in HTML where a part of a document can be addressed using
anchors - e.g.

<a href="http://example.org/space#something">there</a>
links to
<a id="something">here</a> in the HTML for http://example.org/space

There's been plenty of debate over whether using # or / is better for
RDF vocabularies (nearest to resolution is "it depends"). More
background & links at : http://esw.w3.org/topic/HashVsSlash

Cheers,
Danny.

-- 

http://dannyayers.com
Received on Friday, 22 September 2006 08:14:14 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 07:41:53 UTC