Re: R2RML doubts: Inverse Expressions and No Join Conditions

On 07-01-2019 13:52, Christophe Debruyne wrote:
> Hello,
> 
> I always wondered the motivation of inverse expressions as well, so 
> thanks for bringing that up.

Happy to know I'm not alone!

> As for your second question, I believe the specifications does not state 
> that it acts like a Cartesian product because of this condition:
>>
>> If the child query <https://www.w3.org/TR/r2rml/#dfn-child-query> and 
>> parent query <https://www.w3.org/TR/r2rml/#dfn-parent-query> of a 
>> referencing object map 
>> <https://www.w3.org/TR/r2rml/#dfn-referencing-object-map> are not 
>> identical, then the referencing object map must have at least one join 
>> condition <https://www.w3.org/TR/r2rml/#dfn-join-condition>.

Ahhh, thank you! I somehow missed that restriction.

(For posterity, I think this means that there's a minor bug on this line 
of the definition of the triple generation algorithm in the standard:

 Let parent_row be the logical table row derived by taking all but the 
first n columns of row

In the case of a referencing object map with no join condition, there 
are only the n columns of the child table, and hence no object will be 
created from parent_row by this definition.)

> This implies a join. But that raises another question, what is 
> “identical”? Are the parent queries that are obtained from rr:tableName 
> “X” and rr:sqlQuery “SELECT * FROM X AS FOO”?

You have replaced one of my doubts with a fresh one. :) But I guess the 
intent is probably that both queries are in some way "syntactically 
identical". While perhaps some syntactic normalisation would be feasible 
(e.g., lowercasing queries), query equivalence in SQL (deciding if two 
SQL queries will return the same results over any data) offers a very 
very slippery slope to undecidability. :)

Thanks!
Aidan


>> On Jan 7, 2019, at 17:20, Aidan Hogan <aidhog@gmail.com 
>> <mailto:aidhog@gmail.com>> wrote:
>>
>> Hi all,
>>
>> I'm writing a section about R2RML for a book and I have two doubts:
>>
>>
>> * Inverse expressions: I think I get the idea technically speaking, 
>> but I don't understand in what use-case or scenario it would be useful 
>> to do such a reverse search (or, more generally, what was the 
>> motiviation to define these expressions in the standard).
>>
>> https://www.w3.org/TR/r2rml/#inverse
>>
>> (Searching around on the Web, a lot of material just seems to 
>> paraphrase the standard, but unfortunately the standard itself is not 
>> clear to me.)
>>
>>
>> * For referencing object maps without a join condition, the 
>> definitions suggest that this acts like a Cartesian product (and 
>> intuitively this would make a lot of sense to me) but the standard 
>> provides an example where the parent and child maps refer to the same 
>> table that seems to contradict that idea.
>>
>> https://www.w3.org/TR/r2rml/#ex-ref-object-map2
>>
>> The text above states:
>>
>> "No join condition is needed as both triples maps use the same logical 
>> table (the base table DEPT)."
>>
>> While it's not clear what it means that "no join condition is needed", 
>> what I think it's trying to tell me is that when the parent and child 
>> tables are the same, by default the same row will be used in the 
>> parent and child map to generate the subject/object. But the 
>> definitions do not seem to support that and unfortunately the concrete 
>> example provided is ambiguous in the standard because it only has one 
>> row (so the Cartesian product interpretation and the row-by-row 
>> interpretation give the same result, as seen). I'm wondering what was 
>> the intention here?
>>
>>
>> (Perhaps there is a better place to ask these questions, but it seems 
>> the list public-rdb2rdf-wg@w3.org has been deactivated. Also just to 
>> add that in general I quite like the R2RML language design and find it 
>> quite intuitive; just these two points have me really puzzled.)
>>
>> Cheers!
>> Aidan
>>
> 

Received on Monday, 7 January 2019 19:12:53 UTC