Are all URLs also URNs?
URLs and URNs are subsets of URIs.
There are many answers on Stack Overflow that explain the concepts quite nicely. You often find a Venn diagram where URNs and URLs are overlapping sets, implying that each of the three areas are not empty. I can imagine a URN that's not a URL: the ISBN of a book. I can also imagine a URN that's also a URL: a normal web address.
What would be examples of URLs that are not URNs?
According to the classical view, a URI can either be a URL or a URN (or possibly something else), not both:
During the early years of discussion of web identifiers (early to mid 90s), people assumed that an identifer type would be cast into one of two (or possibly more) classes. An identifier might specify the location of a resource (a URL) or its name (a URN) independent of location. Thus a URI was either a URL or a URN .
So in that view, any URI that specifies the resource's location would be a URL, and never be a URN in addition.
(According to the contemporary view, this distinction isn't considered to be useful. It's recommended to use the term URI or URL for all cases.)
A URI identifies a resource, it is done either by location (URL) or by name (URN).
See: URI on Wikipedia
EDIT
A URL like http://example.com/
does not name the resource, just the location it could be get. A resource naming URL would be http://example.com/index.html
...
上一篇: 创建没有域的XML名称空间
下一篇: 所有的URL都是URN吗?