Re: A way to generate PK-strings or new blank nodes

On 21 Oct 2011, at 13:51, David McNeil wrote:
> TABLE, PK_COLUMN, PK_COLUMN_ORDER
> PERSON, FNAME, 1
> PERSON, LNAME, 2
> 
> Now you would like to run a query against these tuples to produce an aggregate value (grouped on TABLE) something like "FNAME,LNAME". You need a list of the key columns in a string that you can use in a template in the R2RML mapping. So I see two possibilities:
> 
> 1) write the query you need in SQL - I don't know if this is possible in generic SQL.

Not in generic SQL. In MySQL it's easily done with GROUP_CONCAT, and there are equivalents for the other RDBMS but with slightly different syntax.

Still, that's the way to go IMO.

I don't like the idea of adding features to R2RML with the motivation that SQL isn't portable. R2RML is not a database abstraction layer. Not even string concatenation is portable in SQL – if you do anything non-trivial, you'll have to special-case anyways, that's just a fact of life and we may just as well accept it.

Best,
Richard

Received on Friday, 21 October 2011 13:14:30 UTC