Non-PK tables and query preservation

Hi Juan,

You said in today's call that the current DM behaviour for non-PK tables is motivated by query preservation. And changing it so that it generates lean graphs would not be query preserving.

I thought about this and would like to understand how you get to this conclusion.

How do you define query preservation? I would define it like this:

Given a direct mapping function from DBs to RDF graphs, let's call it DM(db), and given a SPARQL-to-SQL query rewriting function, let's call it RW(q), RW is query preserving with respect to DM iff for any SPARQL query q and database db, the result of executing q over DM(db) is the same as the result of executing RW(q) over db.

Now I don't see why we can't have a query rewriting algorithm that isn't query-preserving with respect to the “lean” direct mapping.

All we'd need to do is to make sure that DISTINCT is applied to any non-PK tables in the SQL query before we further query that table.


Received on Tuesday, 24 April 2012 18:45:05 UTC