3

I'm still looking into Linked Data and what it takes to get up to the fourth and fifth star of Tim Berners-Lee's 5-Star classsification.

We are to use URIs to denote things. I'm wondering if URIs can include parameters?

For instance there are two URLs that can be used to point to the same YouTube video:

https://www.youtube.com/watch?v=4x_xzT5eF5Q

is the typical one, but you can use the short-form:

https://youtu.be/4x_xzT5eF5Q

Can the relevant parts of both of these URLs be considered a URI? If so then exposing data through an API so that you select e.g. www.example.com/population?country=USA would be a method of making the data "linkable".

4

If by "relevant parts" you mean the video IDs, I think those alone could be considered URIs, but not very good ones, as they do identify the resource, but not unambiguously. If I ask you to find me 4x_xzT5eF5Q, that could be difficult because there could be any number of things named 4x_xzT5eF5Q, and that name tells you nothing about what the thing I expect to find is.

On the other hand, the full URLs both uniquely identify one particular object. Nothing else in existence (probably) is named https://youtu.be/4x_xzT5eF5Q. That also happens to be a URL, so tells you once place you can find that object, but if you treat it as the object's name, you can imagine you might be able to find that object elsewhere under the same name (e.g. on some theoretical Youtube mirror). (Also, this object has many possible names: any URL which leads to it can be considered another name for it.)

(Of course if you want to make sure nothing else has the same name as your object, you should ideally use a UUID or hash. A hash also has the advantage that all copies of it automatically have the same name, and all variations automatically have different names, which are also unique to them.)

tl;dr a Youtube video ID, and any valid URL for that video, can be seen as one of many possible "names" for the video (and a URI is essentially a name), but these are poor URIs because there's no guarantee that a) nothing else has the same name and b) all copies of the video have these names.

  • Thanks for your response, given me some things to think about. By "relevant parts" I mainly meant everything after the "https://" which I don't believe is part of a URI. – Dave Alger Jun 23 '15 at 7:36
  • In a way the https:// part (the protocol) is part of the URL (and hence the URI), since it's part of the path to that object. Replacing it with http:// might give you another valid path, but with ftp:// or gopher:// probably won't. (But there could be other objects at such paths.) Browsers usually fill in http or https for you if you leave it out, but it's always there. – Rena Jun 23 '15 at 18:29
  • Ok, thanks. I had, from somewhere, gotten the impression that the URI didn't contain the protocol part, but the URL did. On further reading I see I had misunderstood. – Dave Alger Jun 24 '15 at 14:52
  • One other question then. You suggest that they're poor URIs because they don't guarantee that "all copies...have these names". But if data is copied and hosted elsewhere won't that automatically mean that it will have a different location (because youtub.be would be replaced by a mirror address) and therefore a different URI? – Dave Alger Jun 24 '15 at 14:57
  • Right, they'll have a different location (URL). A URI is supposed to identify the content, not locate it. A URL can be a URI, but it's not ideal because the same content can have multiple URLs (and the URLs might point to different content in the future). hence Uniform Resource Locator vs Uniform Resource Identifier. – Rena Jun 24 '15 at 18:41
2

https://www.youtube.com/watch?v=4x_xzT5eF5Q and https://youtu.be/4x_xzT5eF5Q are URIs.

v=4x_xzT5eF5Q is the query component of the URI https://www.youtube.com/watch?v=4x_xzT5eF5Q.
/4x_xzT5eF5Q is the path component of the URI https://youtu.be/4x_xzT5eF5Q.

And you can use any URI for Linked Open Data.

  • Sounds reasonable. I just have never seen anyone give a URI for demo purposes which had a query component! – Dave Alger Jun 22 '15 at 14:18
  • @DaveAlger: Yeah, in URIs especially minted for Linked Data (e.g., for vocabularies), using the query component is uncommon (maybe because it’s somewhat ugly). They typically use so-called hash or slash URIs. But if you say something about URIs not under your control (for example, to specify someone’s YouTube video), you have of course to use what is given to you. – unor Jun 22 '15 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.