{"id":140,"date":"2011-07-13T09:58:23","date_gmt":"2011-07-13T09:58:23","guid":{"rendered":"http:\/\/blogs.sussex.ac.uk\/salda\/?p=140"},"modified":"2011-07-26T14:36:59","modified_gmt":"2011-07-26T14:36:59","slug":"setting-up-our-uris-and-the-talis-platform","status":"publish","type":"post","link":"https:\/\/blogs.sussex.ac.uk\/salda\/2011\/07\/13\/setting-up-our-uris-and-the-talis-platform\/","title":{"rendered":"Setting up our URIs and the Talis Platform"},"content":{"rendered":"<p>Time to set up our URIs and upload our data to one of our Talis Platform stores.<\/p>\n<p>In a previous post we discussed which URIs to use. We settled on <em>http:\/\/data.lib.sussex.ac.uk\/archive\/<\/em> &#8211; we felt this should be stable, and allow for\u00a0integration\u00a0with other Special Collection records in the future (while not conflicting with other Library data).<\/p>\n<p>We now needed those URIs to do something, at the moment they all just returned a 404 message (albeit a 404 message with a Rick \u00a0roll link).<\/p>\n<p>As so often the case in this project this is where Pete Johnston came in. He had already set up the\u00a0required\u00a0code on his test server, and similar things had been put in place for the <a href=\"http:\/\/blogs.ukoln.ac.uk\/locah\/\">LOCAH project<\/a>.<\/p>\n<p>In total, all that is required is a few php\/html files and a .htaccess file to handle rewrites (i.e. taking a URI and calling the script in question with the righthand bit of the URI as a parameter). The main script is an index.php file which on our server lives at www\/data\/archive\/doc (which\u00a0corresponds\u00a0to http:\/\/data.lib.sussex.ac\/archive\/doc\/).<\/p>\n<p>Along with these files were a few\u00a0dependencies, PHP libraries: <a href=\"http:\/\/code.google.com\/p\/paget\/wiki\/GettingStarted\">paget<\/a>, <a href=\"http:\/\/code.google.com\/p\/moriarty\/\">moriarty<\/a> and <a href=\"https:\/\/github.com\/semsol\/arc2\/wiki\">ARC<\/a>.<\/p>\n<p>However this code needs to access data from somewhere, and to do this we need to put our data in to our new shiny Talis Platform store&#8230;<\/p>\n<p><strong>Talis Platform<\/strong><\/p>\n<p>The second part of this work was to upload our data to the Talis Platform. Talis had kindly created to stores for us: <a href=\"http:\/\/api.talis.com\/stores\/massobservation\">massobservation<\/a> and <a href=\"http:\/\/api.talis.com\/stores\/massobservation-dev1\">massobservation-dev1<\/a>, as part of their <a href=\"http:\/\/www.talis.com\/platform\/cc\/\">Connect Commons<\/a> scheme.<\/p>\n<p>Pete ran a set of scripts he had developed to upload our data to the dev1 store. We&#8217;re currently installing these on our own server so we can do this ourselves, and we&#8217;ll report more on them soon.<\/p>\n<p>So that was that, without much fuss, we now had our data in our publicly available, Sparql\u00a0query-able, RDF store. There probably should have been\u00a0champagne.<\/p>\n<p><strong>Back to our server<\/strong><\/p>\n<p>So with our data now in a RDF store, libraries installed on server, files copied and in place, config edited to point to our store, it was time to point a browser at one our URIs and start debugging the first error message (which once resolved will lead to the next error message, and so forth). But&#8230; for the first time in my life, it just worked. This never happens. It left me confused, I had set aside hours of my diary for endless frustrations and here it was working. I felt cheated. But, once over the shock, I (and you too) could visit examples such as this: <a href=\"http:\/\/data.lib.sussex.ac.uk\/archive\/doc\/archivalresource\/gb181SxMOA1\">http:\/\/data.lib.sussex.ac.uk\/archive\/doc\/archivalresource\/gb181SxMOA1<\/a> (<a href=\"http:\/\/data.lib.sussex.ac.uk\/archive\/doc\/archivalresource\/gb181SxMOA1.rdf\">RDF\/XML<\/a>, <a href=\"http:\/\/data.lib.sussex.ac.uk\/archive\/doc\/archivalresource\/gb181SxMOA1.json\">JSON<\/a>, <a href=\"http:\/\/data.lib.sussex.ac.uk\/archive\/doc\/archivalresource\/gb181SxMOA1.turtle\">Turtle<\/a>)<\/p>\n<p>Look! It&#8217;s <em>our<\/em> data&#8230; as <em>Linked Data<\/em>&#8230; live on the internet!<\/p>\n<p><strong>data.lib.sussex.ac.uk<\/strong><\/p>\n<p>I would like to see <em>data.lib.sussex.ac.uk<\/em> become more than just the Mass Observation Archive, and with that in mind I created a front end for the top level URL: <a href=\"http:\/\/data.lib.sussex.ac.uk\/\"><strong>http:\/\/data.lib.sussex.ac.uk\/<\/strong><\/a><\/p>\n<p>This uses WordPress as the CMS (life&#8217;s to short to code the html\/css files by hand).<\/p>\n<p>For those interested, the .htaccess mod_rewrite looks like this:<\/p>\n<pre>&lt;IfModule mod_rewrite.c&gt;\r\nRewriteEngine On\r\nRewriteRule ^archive\/id\/(.*)$ \/archive\/doc\/$1 [R=303,L]\r\nRewriteBase \/\r\nRewriteRule ^index\\.php$ - [L]\r\nRewriteCond %{REQUEST_FILENAME} !-f\r\nRewriteCond %{REQUEST_FILENAME} !-d\r\nRewriteRule . \/index.php [L]\r\n&lt;\/IfModule&gt;<\/pre>\n<p>The rule for the URIs is at the top (simply redirecting archive\/id\/* to archive\/doc\/*) if this rule is &#8216;matched&#8217; then processing ends and the rest of the rules are ingnored ( <em>[L]<\/em> ), otherwise process the standard WordPress rules.<\/p>\n<p><strong>Next steps&#8230; (for this strand of work)<\/strong><\/p>\n<p>Install scripts on our server so that we can:<\/p>\n<ul>\n<li>take a file of EAD date from Calm and transform in to a file of RDF\/XML<\/li>\n<li>convert this to a set of <a href=\"http:\/\/en.wikipedia.org\/wiki\/N-Triples\">N-Triples<\/a> files (which are easier to upload to the Platform store as each statement\/triple (or if you prefer,<em> fieldname<\/em> and <em>field value<\/em> from a <em>record<\/em>) is complete and able to standalone, so the data can be uploaded in stages without complications.<\/li>\n<li>Upload the files to the store.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Time to set up our URIs and upload our data to one of our Talis Platform stores. In a previous post we discussed which URIs to use. We settled on http:\/\/data.lib.sussex.ac.uk\/archive\/ &#8211; we felt this should be stable, and allow for\u00a0integration\u00a0with other Special Collection records in the future (while not conflicting with other Library data). [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[126],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.sussex.ac.uk\/salda\/wp-json\/wp\/v2\/posts\/140"}],"collection":[{"href":"https:\/\/blogs.sussex.ac.uk\/salda\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.sussex.ac.uk\/salda\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.sussex.ac.uk\/salda\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.sussex.ac.uk\/salda\/wp-json\/wp\/v2\/comments?post=140"}],"version-history":[{"count":7,"href":"https:\/\/blogs.sussex.ac.uk\/salda\/wp-json\/wp\/v2\/posts\/140\/revisions"}],"predecessor-version":[{"id":201,"href":"https:\/\/blogs.sussex.ac.uk\/salda\/wp-json\/wp\/v2\/posts\/140\/revisions\/201"}],"wp:attachment":[{"href":"https:\/\/blogs.sussex.ac.uk\/salda\/wp-json\/wp\/v2\/media?parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.sussex.ac.uk\/salda\/wp-json\/wp\/v2\/categories?post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.sussex.ac.uk\/salda\/wp-json\/wp\/v2\/tags?post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}