{"id":239,"date":"2015-04-21T22:29:11","date_gmt":"2015-04-21T22:29:11","guid":{"rendered":"http:\/\/www.sgmlguru.org\/wp\/?p=239"},"modified":"2022-04-25T21:41:16","modified_gmt":"2022-04-25T21:41:16","slug":"the-uniqueness-of-things","status":"publish","type":"post","link":"http:\/\/www.sgmlguru.org\/wp\/?p=239","title":{"rendered":"The Uniqueness of Things"},"content":{"rendered":"<p>Found the below in my Drafts folder, unearthed after I imported my old blog to the WordPress instance on my own server. While it was written six years ago, I thought it was still worth publishing after I read it. I hope you think so too.<\/p>\n<p>Two years after writing this (and having long since forgotten that I did), I presented the concepts behind URNs and the need for uniqueness in document management at XML Finland. The system was finished and done, and I was proud of it. It wasn&#8217;t perfect but it was battle-tested and we knew about its weaknesses. I really wanted to talk about it with other markup people, colleagues who knew about angled brackets, and I was sure they&#8217;d understand. In fact, I feared some might say they implemented it all\u00a0<em>years<\/em> ago, only <em>better<\/em>. Yet, what is described here also happened at XML Finland; the importance of uniqueness and the advantages of semantic naming using URNs went right past them, judging by the Q&amp;A afterwards.<\/p>\n<p>Or maybe it&#8217;s just that I&#8217;m wrong.<\/p>\n<p>Anyway, here goes&#8230;<\/p>\n<p>===<\/p>\n<p>I&#8217;ve been busy finalising an authoring system that is supposed to identify every resource ever stored in it with URNs. What follows is just a rant, but I do think about it and would like to know the why&#8217;s and the how&#8217;s. I would like to know why the concept of uniqueness is so difficult to understand.<\/p>\n<p>A URN, of course, is the unique <span style=\"font-style: italic;\">name<\/span> of a document, as opposed to its location, the URL. Compare with a book in a library. Sometimes books get reorganised in a library, meaning that they will be put on another shelf (another address), but the name will remain the same. The name is unique while the address is not. When identifying content to be reused, this is the principle you need to honour.<\/p>\n<p>Anyway&#8230;<\/p>\n<p>It&#8217;s been my primary concern all along to ensure that <span style=\"font-style: italic;\">everything<\/span> is identified with a URN. Everything. If you create a document and link to another, meaning to insert that other document in the one you&#8217;re editing, the link should take the form <span style=\"font-weight: bold;\">URN#id<\/span>, where the hash separates the name of the document from a node pointed out within the document when checked into the database. When checked out, in the XML editor, however, the form should be <span style=\"font-weight: bold;\">URL#id<\/span>, since URLs are what most authoring systems can handle; we need the URL for styling the document in the editor, to publish it, and to process it in various ways.<\/p>\n<p>A URN is possible, of course, but it needs to be replaced with a URL when processing, one way or another, so the decision was to use a URL when a resource has been checked out and replace it with a URN when checked in.<\/p>\n<p>Early on, we did make a demo application that opened a document containing URNs pointing to other documents, replaced them with the corresponding URLs, normalised the resulting document, and published it using XSL and FOP. It worked like a charm.<\/p>\n<p>Today, I found that the check-in does not replace the URLs with URNs. The file name is a pseudo-URN (with colons replaced by underscores) so I know my URN scheme is being used, but that&#8217;s as far as it goes. The URN-like file names remain.<\/p>\n<p>Talking to a developer, I realised that he hadn&#8217;t even thought about it. He was using URNs to identify the resources in the database (the URN being an attribute on the object) but in spite of all our planning, all of our tests, the URLs were left in the links when the document containing them had been checked in. The object IDs in the database are unique, he said, but yes (he admitted), the file names are being used in the database so we can&#8217;t store two identically named <span style=\"font-style: italic;\">files<\/span> in the same folder in the database.<\/p>\n<p>This is not a major problem since we already have the code to do all the work, but what surprises me is that <span style=\"font-style: italic;\">nobody made the connection.<\/span> Me, I <span style=\"font-style: italic;\">assumed<\/span> everyone had understood but did not check. I simply assumed that following the test, following the discussions, following the months of development, no-one could fail to understand their true meaning.<\/p>\n<p>Wrong.<\/p>\n<p>What is it that makes the concept of URNs so difficult?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Found the below in my Drafts folder, unearthed after I imported my old blog to the WordPress instance on my own server. While it was written six years ago, I thought it was still worth publishing after I read it. I hope you think so too. Two years after writing this (and having long since [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[113,156,1,127,95,78,94],"tags":[],"_links":{"self":[{"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/239"}],"collection":[{"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=239"}],"version-history":[{"count":3,"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/239\/revisions"}],"predecessor-version":[{"id":639,"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/239\/revisions\/639"}],"wp:attachment":[{"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=239"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}