Hello there, 

I have set up a Virtuoso server with DBpedia data and URI dereferencing 
(dbpedia VAD). 
I have introduced alternative URIs for DBpedia resources like for dbpedialite. 
The new URIs have a different namespace and they are related to DBpedia entries 
by owl:sameAs relations. 

For instance 


<http://fr.dbpedia.org/resourceById/1544866> owl:sameAs 
<http://fr.dbpedia.org/resource/Charles_Darwin> 



I would like to make the new URIs dereferencable with a simple http 302 
redirect towards the corresponding DBpedia resource. 

Is there a simlpe way to take into account RDF data to define http redirects in 
Virtuoso. 
I tried to define a vsp page to which I will redirect the virtual directory 
'/resourceById' : 

<blockquote>
<?vsp 
declare _resource_, _resource_uri_, meta, data any; 

_resource_ := get_keyword ('res', params, ''); 
_resource_uri_ := registry_get('dbp_domain') || _resource_; 

exec (sprintf ('sparql '|| 
'select ?o where { <%S> owl:sameAs ?o }', _resource_uri_), null, null, vector 
(), 0, meta, data); 
if (length (data)) 
{ 
http_request_status ('HTTP/1.1 302 Found'); 
http_header ('Location: '|| data[0][0] ||'\r\nAccept: application/rdf+xml, 
text/html\r\n'); 
} 
else{ 
http_request_status ('HTTP/1.1 404 Not found'); 
} 
?> 

</blockquote>

But I get stuck with content negotiation, "Content-Type: text/html; 
charset=UTF-8" is added to the header and thus I get a http 406 error when I 
ask for another content type like "application/rdf+xml" . 
Is there be a nicer way to do this ? 

Thanks for any help, 
Julien 






































------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to