Thank you for your reply Hugh, 

I was actually looking first on URL rewriting through the definition of rules. 
But I didn't see how to use sql functions within these rules. 
I cannot define a generic redirect rule with the use of regex. 
Here the redirection from http://fr.dbpedia.org/resourceById/1544866 to 
http://fr.dbpedia.org/resource/Charles_Darwin is determined by the fact that 
the repository contains the triple: 
< http://fr.dbpedia.org/resourceById/1544866 > owl:sameAs < 
http://fr.dbpedia.org/resource/Charles_Darwin > . 

I have a sql function that takes as input the tail of URI that begin with 
http://fr.dbpedia.org/resourceById/ (here 1544866) and returns the 
corresponding URI that begin with http://fr.dbpedia.org/resource/ . 
How can I use it in URL rewriting rules ? 
I was hopping to let the content negotiation be handled by the existing rules 
on URIs within http://fr.dbpedia.org/resource/ namespace. 

In the documentation there is mention of two formats of redirects rules, regex 
based and sprintf based, but there is no example for the last. Would this kind 
of rules be more helpful for my case ? 

Best, 
Julien 

----- Mail original -----

> De: "Hugh Williams" <hwilli...@openlinksw.com>
> À: "Julien Cojan" <julien.co...@inria.fr>
> Cc: virtuoso-users@lists.sourceforge.net
> Envoyé: Mardi 17 Septembre 2013 16:09:41
> Objet: Re: [Virtuoso-users] http redirect according to owl:sameAs

> Hi

> Have you looked at the Virtuoso URL rewrite rules as detailed at:

> http://docs.openlinksw.com/virtuoso/rdfiridereferencing.html#urlrewriting
> http://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtLinkedDataDeployment#URL%20Rewriting

> Best Regards
> Hugh Williams
> Professional Services

> OpenLink Software, Inc. // http://www.openlinksw.com/
> Weblog -- http://www.openlinksw.com/blogs/
> LinkedIn -- http://www.linkedin.com/company/openlink-software/
> Twitter -- http://twitter.com/OpenLink
> Google+ -- http://plus.google.com/100570109519069333827/
> Facebook -- http://www.facebook.com/OpenLinkSoftware
> Universal Data Access, Integration, and Management Technology
> Providers

> On 16 Sep 2013, at 18:02, Julien Cojan < julien.co...@inria.fr >
> wrote:

> > 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' :
> 

> > > <?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');
> > 
> 
> > > }
> > 
> 
> > > ?>
> > 
> 

> > 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
> 
------------------------------------------------------------------------------
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