Re: Template as mechanism for CSV conversion.

On 15 May 2014, at 11:17 , Andy Seaborne <andy@apache.org> wrote:

[snip]

>>> A starting point for templates is URI Templates
>>> 
>>> http://tools.ietf.org/html/rfc6570
>>> 
>>> although there needs to be escaping per syntax support.
>> 
>> As it's not specifically intended for templating literal types, we
>> may need to extend this for datatype-specific template requirements,
>> and to define escape mechanisms that may need to be required.
> 
> Yes - this is a good case for starting with RFC 6570 as it has the concept of position dependent escaping rules.  Any URI generated
> requires that as does the carrier syntax.
> 
> I think for for the first round, we restrict the process to substitution of values (possibly with conversion e.g. case, regex) and not have structural templating (the shape of the RDF changes based on column values).  It needs UC evidence to go further and also to show that processing as RDF->RDF (JSON->JSON, CSV-LD->CSD-LD) isn't enough.
> 
> 	Andy
> 

A big +1. I think we should begin by something small and see if our use cases are covered. We should never forget that the escape mechanism to take the output and push it through, eg, XSLT or SPARQL, is available per our (I guess) agreement for anything more complex.

Note that the template possibilities of R2RML[1] are even poorer: there is a substitution of column names that can be used to generate values, and that is it. Neither case conversion nor regexp is included (although that may be because R2RML includes the possibility of an SQL engine, conceptually, running between the original data and the 'logical table' that is used for RDF conversion). I must admit I do not remember any major discussion in that group on the issue of regexp and case conversion. That being aside, the fact that R2RML seems to be fine with such a simple templating shows that we should not aim at some sort of a complex templating right away, but begin simple...

(b.t.w., having the templating be common to various output syntaxes does sound like a great idea!)

Ivan


[1] http://www.w3.org/TR/r2rml/#from-template

----
Ivan Herman, W3C 
Digital Publishing Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
GPG: 0x343F1A3D
WebID: http://www.ivan-herman.net/foaf#me

Received on Thursday, 15 May 2014 09:57:36 UTC