Encode and decode URLs
URLs only accept ASCII characters. Therefore we need to encode any
special characters like accents before we incorporate them into a URL.
Try it yourself:
To encode, press the first button...
http://my.site/
To decode, press the second button...
You can change and experiment with other input values for the little scripts above.
Here we see the whole point of the IRI for internationalization and accessibility of the identifiers on the Web.
URI IRI
The translation from URI to IRI back and forth is described in the RFC3987.
The idea is that the IRI is initially encoded in UTF8 then, every IRI
character that is not present in the ASCII code is transformed by
replacing it with its hexadecimal code preceded by % character.
See also:
URIs for everything...
As we will see later, URIs are used to name a lot of very different things.
Here are some examples:
Namespace and URIs
The notion of namespace is one of the most abstract
of this MOOC. Now that we have discussed URIs, let us go back to the
notion of namespaces a second time.
Quoting Wikipedia: "In
computing, a namespace is a set of symbols that are used to organize
objects of various kinds, so that these objects may be referred to by
name (...) namespaces are typically employed for the purpose of grouping
symbols and identifiers around a particular functionality and to avoid
name collisions between multiple identifiers that share the same name."
Since URIs can be used to identify anything, they can be used to
identify these sets that form namespaces. You can see namespace as a set
of terms that where isolated and that we identify by giving a URI to
that set. This allows you to do two important things:
- to specify that a term you use belongs to a specific set and as a
specific meaning just like when you say "I use the word SCORE with the
meaning of the University of NICE" as a way to avoid any
misunderstanding;
- to avoid name collisions by prefixing the words (called "qualified
name") with prefixes associated with the right namespace for example URI
unice: SCORE and sport:SCORE that would make the difference between
"results of student exams" and "sport results"; so we can use these two
prefixed terms in the same data, documents and applications without any
collision or ambiguity.
So you can conceive namespaces as a mechanism to create sets
of terms, to identify these sets with URIs and to link these URIs to
prefixes that allow to you use terms in a non-ambiguous way.
Famous namespaces include:
REFERENCES
commentaires
Ajouter un commentaire Lire les commentaires