Uniform Resource Identifiers Jacek Kopecký WSML Working Group June 2004
2 Jacek Kopecký, Overview History of URIs URI syntax URI references and their resolution Good practices for creating URIs Interesting issues
June Jacek Kopecký, URI History Universal Resource Identifiers (RFC 1630, June 1994) Uniform Resource Locators and Names RFC 2396, August bis in development Originally “Universal”, later “Uniform” as a compromise “Universal” again preferred by TimBL
June Jacek Kopecký, URLs and URNs Locators (addresses) vs. Names URNs not easily dereferencable URNs can be made dereferencable by infrastructure URLs perceived as less persistent URLs and URNs drifting towards middle ground No point in making the distinction any more
June Jacek Kopecký, Uniform Resource Identifiers URIs “identify” “resources” Identification doesn’t imply interaction Resource is a sameness of characteristics over time Latest blog rant Latest blog rant on politics Blog rant on politics from Resource need not be accessible when URI is created Pictures from my future trip to London will be at
June Jacek Kopecký, URI Syntax According to 2396bis Examples news:comp.infosystems. telnet://melvyl.ucop.edu/ URI Syntax - simplified scheme: [//authority] [/path] [?query] [#fragid] Relative URI without “scheme:” Dot path segments (‘.’ and ‘..’) treated specially
June Jacek Kopecký, URI Syntax cont’d Reserved characters (like ) Many allowed characters Rest of UNICODE percent-encoded from UTF-8 Percent-encoding allowed characters creates equivalent URIs But namespaces compared char-by-char
June Jacek Kopecký, URI Reference Resolution Resolving URI A against base URI B Going from the left, keep as much from B as is undefined in A First part of A replaces that part from B Path resolution special If A has absolute path, that is taken Relative path from A resolved against path from B, removing dot segments from result Everything after first part of A taken from A Fragment always taken from A
June Jacek Kopecký, URI Ref. Resolution Examples Base URI: 1.g= 2..= 3../= 4../g= = /= /g= /../g= /../../g=
June Jacek Kopecký, URI Ref. Resolution Examples Base URI: 10././g= 11.//g= 12.#s= 13.g#s= 14.?y= 15.g?y= 16.g?y#s= 17.g:h= g:h 18../g:h=
June Jacek Kopecký, Base URIs Necessary when resolving URI references 1.Explicit base URI embedded in content 2.URI of the document Usual in HTML files on the web 3.App-dependent base URI default
June Jacek Kopecký, URI Equivalence Do two URIs identify the same resource? Comparing without accessing the resources Various applications for URI comparison Increasing cache efficiency Comparing the namespaces of two symbols Algorithms must avoid false positives False negatives unavoidable redirect to above
June Jacek Kopecký, Uses of URIs Addresses on the Web Namespaces in XML QNames Namespaces in QNames in other languages Identifiers of things and concepts (e.g. RDF) Unique keys (e.g. MIME message ID)
June Jacek Kopecký, QName Introduced in XML Namespaces Name of an XML namespace-qualified element RDF uses QNames for brevity of URI notation XML Schema expanded use of QNames to further things (6 symbol spaces) Every following language uses QNames as identifiers Number of independent symbol spaces => Turning QNames into URIs is cumbersome Should have been as simple as in RDF (IMHO)
June Jacek Kopecký, Creating URIs for Web Resources Versioning approach for persistence vs. vs. Simple, memorable URIs Scribbled on a napkin Correcting spelling and case helps – mod_speling Making the “ prefix optional (both ways) helps Content negotiation – drop.html (.php,.asp) URI changes harmful
June Jacek Kopecký, Creating Example URIs Reserved for precisely this purpose Or use own domain (deri.org, wsmo.org) not good
June Jacek Kopecký, Creating URIs for Namespaces Dereferencable, ending with ‘/’ or ‘#’ Canonical URIs – no unnecessary dot segments or percent-encoding Namespaces compared char-by-char Namespace document Preferably in the language that uses the namespace – enables automatic discovery With human-oriented descriptions To allow for the above, don’t share namespace URIs for schema and WSDL
June Jacek Kopecký, Creating URIs for Concepts Group concepts in a common, dereferencable namespace Each concept identified by its fragID In RDF/XML, namespace ends with ‘#’ Namespace document describes the concepts Two problems FragIDs depend on media types Can identify a car?
June Jacek Kopecký, Fragment IDs in URIs Fragment ID identifies a secondary resource Interpretation of fragment IDs depends on media type In HTML In XML No meaning in JPEG xml:id in development So far language-dependent (often DTD) solutions Fragment IDs should mean the same thing across media types with content negotiation
June Jacek Kopecký, Range of HTTP URIs? Open W3C TAG issue Can http: URI identify a car? Can I say is my motorbike? TimBL doesn’t seem to think so Is it necessary to distinguish between a thing and a description of that thing?
June Jacek Kopecký, Other Interesting Issues data: URI scheme – the URI is the resource RFC 2397 data:image/gif;base64,R0lGODdhMAAwAPAA… mailto: scheme a misnomer URIs don’t specify actions but identifiers uuid: scheme for unique identifiers Good for transient identification in closed systems Mismatches between perceived and intended meaning of a resource Should URIs be human-readable?
June Jacek Kopecký, Main Points Cool URIs don’t change URIs can be (and are) scribbled on napkins URIs don’t (necessarily) point to documents Dereferencable URIs also good as names URLs, URNs obsolete
June Jacek Kopecký, References
June Jacek Kopecký, Hope it Helped Thanks for your attention Questions? Comments?