W3C home > Mailing lists > Public > public-lod@w3.org > November 2008

Re: Suggestions/existing material for Linked Data tutorial?

From: Hugh Glaser <hg@ecs.soton.ac.uk>
Date: Sun, 16 Nov 2008 13:53:43 +0000
To: Danny Ayers <danny.ayers@gmail.com>
CC: "public-lod@w3.org" <public-lod@w3.org>
Message-ID: <C545D667.27C7E%hg@ecs.soton.ac.uk>

If you have people who want to see some code.
Last year I put a little hack on this list.
Like quite a few of us, we "resolve" URIs by trapping a 404 and then doing
an SCBD or whatever on a triplestore, and returning the RDF.
Caching is good, however.
So when we resolve a URI, we also put it in the correct place, so that the
next time it is requested, Apache just serves it, without any php (or
whatever) overhead.
Ian has changed the code a bit - here is the latest version of the 404
handler in php:

//  Query for RDF
$rdf = constructRDF2("<$uri>");

//  If the RDF is empty, then output 404
if ($rdf === false) {
    header('HTTP/1.1 404 Not Found');
    error('Error 404 &mdash; Not Found', 'The requested resource could not
be found.');
    die;
}

//  Otherwise, ensure that the path exists for the specified file
//  ($id may well contain further slashes)
exec("mkdir -p " . dirname($file));

//  Write data to rdf-cache on disk
$rdf = join("\n", $rdf);
$fp = fopen($file, 'w');
fputs($fp, $rdf);
fclose($fp);

//  Send normal headers and print RDF
header('HTTP/1.1 200 OK');
header('Content-Type: application/rdf+xml; charset=UTF-8');
print $rdf;
die;



On 14/11/2008 11:19, "Danny Ayers" <danny.ayers@gmail.com> wrote:

>
>
> Hi LODites,
>
> I'm going to be doing a tutorial at the SWAP conference in Rome on
> 15th Dec (main conf is 16th-17th, http://www.swapconf.it/2008/  ).
> Provisional title is  "Publishing Linked Data on the Semantic Web: how
> and why?".
>
> I have my own thoughts about what to do (naturally ;-) but would very
> much appreciate any suggestions for how to go about it, especially the
> hands-on part. Also if anyone's already got slide sets on the topic,
> I'd be grateful for pointers.
>
> Attendees will apparently be mostly young semweb
> researchers/developers and Web 2.0 people, no idea of numbers yet. The
> schedule I've proposed is:
>
> 9:30 - 11:00 : background and description of techniques (with a bit of
> Q&A at the end)
> 11:00 - 11:30 : coffee
> 11:30 - 13:00 : hands-on  (with a bit of Q&A, discussion & conclusions
> at the end)
>
> Cheers,
> Danny.
>
> --
> http://dannyayers.com
> ~
> http://blogs.talis.com/nodalities/this_weeks_semantic_web/
>
>
Received on Sunday, 16 November 2008 13:54:34 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:20:43 UTC