Re: Functions to compute URIs

* Richard Cyganiak <richard@cyganiak.de> [2011-06-09 13:43+0100]
> Hi David,
> 
> There's a wiki page that talks quite a bit about this.
> http://www.w3.org/2001/sw/rdb2rdf/wiki/Identifier_re-use#Entity_alignment
> 
> It also describes D2RQ's capabilities in this regard, which I would like to see added to R2RML.
> 
> In particular, a number of template functions:
> 
>    rr:template "http://example.com/people/{NAME|urlencode}";
> 
> and defining mapping tables as part of the mapping.

I note the usual tension between readable and reversible.
With |urlencode,
  SELECT ?dob { <http://example.com/people/John%20Smith> <HR#dob> ?dob }
can be trivially truned into
  SELECT HR.dob FROM HR WHERE HR.name="John Smith"
, which can exploit an index. Conversely, |urlify's
  SELECT ?dob { <http://example.com/people/John_Smith> <HR#dob> ?dob }
is harder to reliably reverse (unless '_'s in native data are doubled):
  SELECT HR.dob FROM HR WHERE urlify(HR.name)="http://example.com/people/John_Smith"


> Best,
> Richard
> 
> 
> On 8 Jun 2011, at 15:50, David McNeil wrote:
> > At Semtech this week I have talked to two separate people who were interested in R2RML and who thought it was important for R2RML to support the conversion of data in the relational database to URIs. I believe they were talking about both: 
> > 
> > * the case where the data in the database contains the data necessary to produce the URI (e.g. "John Smith" -> "http://people/john_smith"). There was a desire expressed to do this without writing the SQL or SPARQL expression to perform the conversion.
> > 
> > * the case where the data in the database does not provide sufficient data to produce the URI (e.g. a code of "js25" needs to be translated to "http://people/john_smith").
> > 
> > Of course R2RML has the template feature which can partially be used to address the first case (but not without writing a SQL/SPARQL expression to do case conversion on the input data), but not the second.
> > 
> > In the past I believe we have talked about satisfying this type of need (in the context of ISSUE-7), by defining a framework for plugging in user provided conversion functions without specifying the detailed form which those plugins would take.
> > 
> > -David
> 
> 

-- 
-ericP

Received on Thursday, 9 June 2011 16:26:11 UTC