Presentation is loading. Please wait.

Presentation is loading. Please wait.

Uniform Resource Identifiers Jacek Kopecký WSML Working Group June 2004.

Similar presentations

Presentation on theme: "Uniform Resource Identifiers Jacek Kopecký WSML Working Group June 2004."— Presentation transcript:

1 Uniform Resource Identifiers Jacek Kopecký WSML Working Group June 2004

2 2 Jacek Kopecký, Overview History of URIs URI syntax URI references and their resolution Good practices for creating URIs Interesting issues

3 June 20043 Jacek Kopecký, URI History Universal Resource Identifiers (RFC 1630, June 1994) Uniform Resource Locators and Names RFC 2396, August 1998 2396bis in development Originally “Universal”, later “Uniform” as a compromise “Universal” again preferred by TimBL

4 June 20044 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

5 June 20045 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 2004-6-22 Resource need not be accessible when URI is created Pictures from my future trip to London will be at

6 June 20046 Jacek Kopecký, URI Syntax According to 2396bis Examples news:comp.infosystems.www.servers.unix telnet:// URI Syntax - simplified scheme: [//authority] [/path] [?query] [#fragid] Relative URI without “scheme:” Dot path segments (‘.’ and ‘..’) treated specially

7 June 20047 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

8 June 20048 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

9 June 20049 Jacek Kopecký, URI Ref. Resolution Examples Base URI: http://a/b/c/d?e#f 1.g= http://a/b/c/g 2..= http://a/b/c/ 3../= http://a/b/c/ 4../g= http://a/b/c/g 5...= http://a/b/ 6.../= http://a/b/ 7.../g= http://a/b/g 8.../../g= http://a/g 9.../../../g= http://a/g

10 June 200410 Jacek Kopecký, URI Ref. Resolution Examples Base URI: http://a/b/c/d?e#f 10././g= http://a/g 11.//g= http://g 12.#s= http://a/b/c/d?e#s 13.g#s= http://a/b/c/g#s 14.?y= http://a/b/c/d?y 15.g?y= http://a/b/c/g?y 16.g?y#s= http://a/b/c/g?y#s 17.g:h= g:h 18../g:h= http://a/b/d/g:h

11 June 200411 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

12 June 200412 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

13 June 200413 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)

14 June 200414 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)

15 June 200415 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 “www.” prefix optional (both ways) helps Content negotiation – drop.html (.php,.asp) URI changes harmful

16 June 200416 Jacek Kopecký, Creating Example URIs Reserved for precisely this purpose Or use own domain (, not good

17 June 200417 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

18 June 200418 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?

19 June 200419 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

20 June 200420 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?

21 June 200421 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?

22 June 200422 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

23 June 200423 Jacek Kopecký, References

24 June 200424 Jacek Kopecký, Hope it Helped Thanks for your attention Questions? Comments?

Download ppt "Uniform Resource Identifiers Jacek Kopecký WSML Working Group June 2004."

Similar presentations

Ads by Google