RDFa profile and new URI
I just added a short profile about myself embedding RDFa that aims to replace my old FOAF file, in which I already moved some things (i.e. relationships) to external services.
I also gave me a nicer URI, http://apassant.net/alex that uses content-negociation to redirect either to the HTML version of this profile or to the extracted RDF one, depending on the Accept header, combining some rewrite rules that Ivan Herman defined for the SW Faq and the .htaccess used for the Flickr wrapper. My old foaf.rdf file is also now redirected to this extracted profile, and I’m using an owl:sameAs in RDFa link to be compliant with services that uses my old URI.
# Old foaf.rdf compliance
RedirectPermanent /foaf.rdf http://www.w3.org/2007/08/pyRdfa/extract?uri=http://apassant.net/about/
# RDF redirect for my URI
RewriteCond %{HTTP_ACCEPT} application/rdf\+xml
RewriteRule ^alex$ http://www.w3.org/2007/08/pyRdfa/extract?uri=http://apassant.net/about/ [R=303,L]
# HTML redirect for my URI
RewriteRule ^alex$ about [R=303,L]
I’m also wondering, since this profile is used as http://apassant.net homepage which is also my OpenID URL, how it will work when loggin on websites using SparqlPress + OpenID as ARC2 embeds an RDFa extractor so that it should discover my FOAF data without using any autodiscovery link.

Hi,
May I suggest to use Apache’s content negotiation capabilities (through a type-map file) when it comes to parsing HTTP Accept headers?
http://httpd.apache.org/docs/trunk/content-negotiation.html
With only one regular expression, a RewriteCond %{HTTP_ACCEPT} is always wrong, as it cannot properly parse the complexity of an HTTP Accept header, for instance if a client sends “application/rdf+xml;q=0″ or “application/xhtml+xml;q=0.2,application/rdf+xml;q=0.1″.
The solution using type-map is standard compliant and scales better when more types are added, e.g. application/xrds+xml, etc.
In your case, I would probably suggest to use http://apassant.net/alex/ (mind the slash) for performance and simplicity reasons, and move your /about/ directory to /alex/. However, to keep exactly the same URIs as you have now, here is a proposal (other variants are possible, and it is probably possible to make it simpler):
(Change all [ and ] to less-than and more-than signs)
# In your /.htaccess
[Files “/alex”]
ForceType type-map
[/Files]
# And then in the file /alex
URI: alex.rdf.php
Content-type: application/rdf+xml;qs=1
URI: alex.html.php
Content-type: application/xhtml+xml;qs=0.9
URI: alex.html.php
Content-type: text/html;qs=0.5
# In your /alex.html.php
[?php
header(’Location: http://apassant.net/about/‘);
header(’HTTP/1.1 303 See Other’);
header(’Status: 303 See Other’);
…+ some HTML code as per HTTP/1.1 RFC2616
?]
# In /alex.rdf.php
[?php
header(’Location: http://www.w3.org/2007/08/pyRdfa/extract?uri=http://apassant.net/about/‘);
header(’HTTP/1.1 303 See Other’);
header(’Status: 303 See Other’);
…+ some HTML code as per HTTP/1.1 RFC2616
?]
# Bye!
http://apassant.net/about/ isn’t loved by the W3C xhtml+rdfa validator at the moment
Or by http://www.w3.org/2007/08/pyRdfa/extract?uri=http://apassant.net/about/
You could also make the page understood by GRDDL aware agents by adding in an rdfa profile - http://ns.inria.fr/grddl/rdfa/
clockwerx > I added the GRDDL profile - also fixed an unclosed HTML tag that broke the parsing.
Alexandre > I’ll have a look in detail (when time permits
Thanks to both of you