IRI, URI, URL, URN

Publicat el 21/01/2007

Un URI (Uniform Resource Identifier) és un identificador de recursos (físics o abstractes).

Un URI es pot definir més especificament com a localitzador o com a nom; aquests dos subconjunts són respectivament els URL (Uniform Resource Locator) i els URN (Uniform Resource Names).

Els URL donen una direcció per localitzar un recurs (p.ex. la localització d'un document com http://blog.esbudellat.net/iri-uri-url-urn/) mentre que els URN permeten parlar d'un recurs inequívocament però no permet localitzar-lo (p.ex. l'ISBN d'un llibre: rn:isbn:0-59-600223-8).

Actualment però el W3C/IETF URI Planning Interest Group creu que aquesta distinció no és tan necessaria i s'aposta per un ús del terme URI.

La sintaxi dels URI permet usar el conjunt US-ASCII ([0-9a-zA-Z] i $-_.,+!*'()) i obliga a codificar els caràcters no permesos.

Els IRI són una reformulació dels URI permetent qualsevol caràcter Unicode. Els agents d'usuari però, hauran d'escapar-los a US-ASCII (o sigui, degradar-los a URI). Els motius que dóna l'IETF:

Syntaxical. Many URI schemes and components define additional syntactical restrictions not captured in section 2.2. Scheme-specific restrictions are applied to IRIs by converting IRIs to URIs and checking the URIs against the scheme-specific restrictions.

Interpretational. URIs identify resources in various ways. IRIs also identify resources. When the IRI is used solely for identification purposes, it is not necessary to map the IRI to a URI (see section 5). However, when an IRI is used for resource retrieval, the resource that the IRI locates is the same as the one located by the URI obtained after converting the IRI according to the procedure defined here. This means that there is no need to define resolution separately on the IRI level.

Citació: rfc3987

Recursos relacionats

Comentaris

Afegir un comentari