Re: .htaccess a major bottleneck to Semantic Web adoption / Was: Re: RDFa vs RDF/XML and content negotiation
Le 05/07/2009 13:54, Toby A Inkster a écrit : On 5 Jul 2009, at 01:52, Pierre-Antoine Champin wrote: I guess a PHP version would not even require that .htaccess, but sorry, I'm not fluent in PHP ;) The situation with PHP should be much the same, though I suppose web hosts might be more likely to set index.php in the DirectoryIndex as a default. this was my intuition as well. However, I actually have to add the DirectoryIndex directive to have index.php taken into account on my server. PHP has another advantage over CGI (and WSGI): you can usually run a PHP script from any directory of your hosted space, while CGI are usually confined in a special directory. Anyway, I've done a quick port of your code to PHP. (I stripped out your connection negotiation code and replaced it with my own, as I figured out it would be faster to paste in the ConNeg class I'm familiar with rather than do line-by-line porting of the Python to PHP.) Here it is, same license - LGPL 3. great :) We should start a repository somewhere of useful code for serving linked data. I agree. I note that your implementation uses absolute URIs for redirection. This has two main advantages over mine: - this complies with the RFC (I had missed that part ;) - this still works when you append path elements after the script name (which messes the relative URI in my script) pa
Re: .htaccess a major bottleneck to Semantic Web adoption / Was: Re: RDFa vs RDF/XML and content negotiation
We should start a repository somewhere of useful code for serving linked data. I agree. (I raise my hand) If I am not wrong, this thread has given out 4 different implementations for serving linked data. I mentioned before that I wanted to post this on linkeddata.org I will work out the logistics with Tom Heath, so we can put upload the code examples hopefully this week! Juan Sequeda
Re: .htaccess a major bottleneck to Semantic Web adoption / Was: Re: RDFa vs RDF/XML and content negotiation
OK, I'll have a go :-) Why did I think this would be fun to do on a sunny Sunday morning that has turned into afternoon? Here are the instructions: 1. Create a web-accessible directory, let's say foobar, with all your .rdf, .ttl, .ntriples and .html files in it. 2. Copy lodpub.php and path.php into it. 3. Access path.php from your web server. 4. Follow the instruction to paste that text into .htaccess 5. You can remove path.php if you like, it was only there to help you get the .htaccess right. That should be it. The above text and files are at http://www.rkbexplorer.com/blog/?p=11 Of course, I expect that you can tell me all sorts of problems/better ways, but I am hoping it works for many. Some explanation: We use a different method, and I have tried to extract the essence, and keep the code very simple. We trap all 404 (File not Found) in the directory, and then any requests coming in for non-existent files will generate a 303 with an extension added, depending on the Accept header. Note that you probably need the leading / followed by the full path from the domain root, otherwise it will just print out the text lodpub.php; (That is not what the apache specs seem to say, but it is what seems to happen). If you get Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request., then it means that web server is not finding your ErrorDocument . Put the file path.php in the same directory and point your browser at it - this will tell you what the path should be. Note that the httpd.conf (in /etc/httpd/conf) may not let your override, if your admins have tied things down really tight. Mine says: AllowOverride All Finally, at the moment, note that I think that apache default does not put the correct MIME type on rdf files, but that is a separate issue, and it makes no difference that the 303 happened. Best Hugh On 05/07/2009 01:52, Pierre-Antoine Champin swlists-040...@champin.net wrote: Le 03/07/2009 15:14, Danny Ayers a écrit : 2009/7/2 Bill Robertsb...@swirrl.com: I thought I'd give the .htaccess approach a try, to see what's involved in actually setting it up. I'm no expert on Apache, but I know the basics of how it works, I've got full access to a web server and I can read the online Apache documentation as well as the next person. I've tried similar, even stuff using PURLs - incredibly difficult to get right. (My downtime overrides all, so I'm not even sure if I got it right in the end) I really think we need a (copy paste) cheat sheet. Volunteers? (raising my hand) :)* Here is a quick python script that makes it easier (if not completely immediate). It may still requires a one-liner .htaccess, but one that (I think) is authorized by most webmasters. I guess a PHP version would not even require that .htaccess, but sorry, I'm not fluent in PHP ;) So, assuming you want to publish a vocabulary with an RDF and an HTML description at http://example.com/mydir/myvoc, you need to: 1. Make `myvoc` a directory at the place where your HTTP server will serve it at the desired URI. 2. Copy the script in this directory as 'index.cgi' (or 'index.wsgi' if your server as WSGI support). 3. In the same directory, put two files named 'index.html' and 'index.rdf' If it does not work now (it didn't for me),you have to tell your HTTP server that the directory index is index.wsgi. In apache, this is done by creating (if not present) a `.htaccess` file in the `myvoc` diractory, and adding the following line:: DirectoryIndex index.cgi (or `index.wsgi`, accordingly) There is more docs in the script itself. I think the more recipes (including for other httpds) we can provide with the script, the more useful it will be. So feel free to propose other ones. enjoy pa attachment: path.php attachment: lodpub.php
Re: .htaccess a major bottleneck to Semantic Web adoption / Was: Re: RDFa vs RDF/XML and content negotiation
yay!! more easy-lod goodness! more incentive to get this up on linkeddata.org this week! do we have any volunteers for ruby? Juan Sequeda, Ph.D Student Dept. of Computer Sciences The University of Texas at Austin www.juansequeda.com www.semanticwebaustin.org On Sun, Jul 5, 2009 at 5:16 PM, Hugh Glaser h...@ecs.soton.ac.uk wrote: OK, I'll have a go :-) Why did I think this would be fun to do on a sunny Sunday morning that has turned into afternoon? Here are the instructions: 1. Create a web-accessible directory, let's say foobar, with all your .rdf, .ttl, .ntriples and .html files in it. 2. Copy lodpub.php and path.php into it. 3. Access path.php from your web server. 4. Follow the instruction to paste that text into .htaccess 5. You can remove path.php if you like, it was only there to help you get the .htaccess right. That should be it. The above text and files are at http://www.rkbexplorer.com/blog/?p=11 Of course, I expect that you can tell me all sorts of problems/better ways, but I am hoping it works for many. Some explanation: We use a different method, and I have tried to extract the essence, and keep the code very simple. We trap all 404 (File not Found) in the directory, and then any requests coming in for non-existent files will generate a 303 with an extension added, depending on the Accept header. Note that you probably need the leading / followed by the full path from the domain root, otherwise it will just print out the text lodpub.php; (That is not what the apache specs seem to say, but it is what seems to happen). If you get Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request., then it means that web server is not finding your ErrorDocument . Put the file path.php in the same directory and point your browser at it - this will tell you what the path should be. Note that the httpd.conf (in /etc/httpd/conf) may not let your override, if your admins have tied things down really tight. Mine says: AllowOverride All Finally, at the moment, note that I think that apache default does not put the correct MIME type on rdf files, but that is a separate issue, and it makes no difference that the 303 happened. Best Hugh On 05/07/2009 01:52, Pierre-Antoine Champin swlists-040...@champin.net wrote: Le 03/07/2009 15:14, Danny Ayers a écrit : 2009/7/2 Bill Robertsb...@swirrl.com: I thought I'd give the .htaccess approach a try, to see what's involved in actually setting it up. I'm no expert on Apache, but I know the basics of how it works, I've got full access to a web server and I can read the online Apache documentation as well as the next person. I've tried similar, even stuff using PURLs - incredibly difficult to get right. (My downtime overrides all, so I'm not even sure if I got it right in the end) I really think we need a (copy paste) cheat sheet. Volunteers? (raising my hand) :)* Here is a quick python script that makes it easier (if not completely immediate). It may still requires a one-liner .htaccess, but one that (I think) is authorized by most webmasters. I guess a PHP version would not even require that .htaccess, but sorry, I'm not fluent in PHP ;) So, assuming you want to publish a vocabulary with an RDF and an HTML description at http://example.com/mydir/myvoc, you need to: 1. Make `myvoc` a directory at the place where your HTTP server will serve it at the desired URI. 2. Copy the script in this directory as 'index.cgi' (or 'index.wsgi' if your server as WSGI support). 3. In the same directory, put two files named 'index.html' and 'index.rdf' If it does not work now (it didn't for me),you have to tell your HTTP server that the directory index is index.wsgi. In apache, this is done by creating (if not present) a `.htaccess` file in the `myvoc` diractory, and adding the following line:: DirectoryIndex index.cgi (or `index.wsgi`, accordingly) There is more docs in the script itself. I think the more recipes (including for other httpds) we can provide with the script, the more useful it will be. So feel free to propose other ones. enjoy pa
Re: Include LOD content into Drupal websites
Alexandre Passant wrote: Hi all, I've just released a Drupal module that permits to include LOD content into Drupal nodes on runtime (so that you always got 'fresh' data). It relies on sparcool.net and can be downloaded at [1], see for instance the announcement blog post at [2] as an example of what can be done with it. Best, Alex. [1] http://drupal.org/project/sparcool [2] http://apassant.net/blog/2009/07/03/using-lod-your-webpages-sparcool-module-drupal-and-javascript-library Alex, As I suggest at Semtech 2009 gathering, we should start making screencast demos of these things. They are powerful tools for reducing activation threshold. Do you think you can knock up a screencast? -- Regards, Kingsley Idehen Weblog: http://www.openlinksw.com/blog/~kidehen President CEO OpenLink Software Web: http://www.openlinksw.com