Re: Question on Use Cases & Requirements for Mapping Relational Databases to RDF

On Fri, Jun 18, 2010 at 8:54 AM, Freddy Priyatna <
fpriyatna@delicias.dia.fi.upm.es> wrote:

> Dear All,
>
> I've just read the document "Use Cases & Requirements for Mapping
> Relational Databases to RDF". There is a question I would like to ask
> regarding the figure on page 4.
>
> The figure depicts that the SPARQL is posed on the RDF graph generated by
> RDB2RDF. The impression I got is, the RDF graph has to be generated first as
> a result of RDB2RDF before we can pose the SPARQL query. However, there is a
> possibility that the RDF graph is the result of RDB2RDF + SPARQL. Is this
> accommodated in the requirement?
>
> I am missing something here? Sorry if this issue has been discussed before.

The requirement SQLGEN
  http://www.w3.org/TR/2010/WD-rdb2rdf-ucr-20100608/#SQLGEN

is intended to stipulate that the mapping language enable the
translation of SPARQL queries to SQL. Following 2.1.1 "Queries Over
the RDF Graph", we commented out a section, meant to illustrate a
transformation to SQL:
[[
<!-- div3 id="RDF_Graphs_as_Non-materialized_Views">

* RDF Graphs as Non-materialized Views *

The RDF graphs defined by a mapping over a relational database need
not be materialised. Indeed, queries or inference may be expressed in
terms of a notional representation of relational data, but executed
over the original relational store. Executing the following SQL query
over any data in the relational tables should give results identical
to a SPARQL query over the RDF graph mapped from that relational data:

SELECT R_patient.ID AS patient, R_patient.DateOfBirth AS dob, R__0_sexEntry.EntryName AS sex
  FROM Person AS R_patient
       INNER JOIN Sex_DE AS R_sexEntry
       INNER JOIN Item_Medication AS R_indicItem
       INNER JOIN Medication AS R_indicMed
       INNER JOIN Medication_DE AS R_indicDE
       INNER JOIN NDCcodes AS R_indicCode
       LEFT OUTER JOIN (
       SELECT 6 AS _DISJOINT_, R_disqualMed.MedDictDE AS disqualDE, 
              R_disqualItem.PerformedDTTM AS disqualDate, R_disqualItem.ID AS disqualItem, 
              R_disqualMed.ID AS disqualMed, R_disqualDE.NDC AS disqualNDC, 
              R_disqualItem.PatientID AS patient, R_disqualItem.EntryName AS takes
         FROM Item_Medication AS R_disqualItem
              INNER JOIN Medication AS R_disqualMed
              INNER JOIN Medication_DE AS R_disqualDE
              INNER JOIN NDCcodes AS R_disqualCode
        WHERE (R_disqualCode.NDC=R_disqualDE.NDC)
          AND (R_disqualCode.ingredient=11289)
          AND (R_disqualDE.ID=R_disqualMed.MedDictDE)
          AND (R_disqualItem.EntryName IS NOT NULL)
          AND (R_disqualItem.PatientID IS NOT NULL)
          AND (R_disqualItem.PerformedDTTM IS NOT NULL)
          AND (R_disqualMed.ID IS NOT NULL)
          AND (R_disqualMed.ItemID=R_disqualItem.ID)
                  ) AS G_opt6 ON (G_opt6.patient=R_patient.ID)
   AND (G_opt6.takes=R_indicItem.EntryName)
 WHERE (R_indicCode.NDC=R_indicDE.NDC)
   AND (R_indicCode.ingredient=6809)
   AND (R_indicDE.ID=R_indicMed.MedDictDE)
   AND (R_indicItem.EntryName IS NOT NULL)
   AND (R_indicItem.PatientID=R_patient.ID)
   AND (R_indicItem.PerformedDTTM IS NOT NULL)
   AND (R_indicMed.ID IS NOT NULL)
   AND (R_indicMed.ItemID=R_indicItem.ID)
   AND (R_patient.DateOfBirth IS NOT NULL)
   AND (R_patient.MiddleName IS NOT NULL)
   AND (R_sexEntry.EntryName IS NOT NULL)
   AND (R_sexEntry.ID=R_patient.SexDE);

This query is not a normative representation of the earlier SPARQL
query; it is included here only to illustrate the ability of R2RML
tools to produce efficient SQL queries.
				</div3 -->
]]

This section can be uncommented if it would help the use cases
document.

I believe the majority of the implementations that are informing this
work translate SPARQL queries over this virtual RDF graph to SQL
queries over the native store, so this is certainly a priority for us.

> Regards
>
> Freddy
-- 
-ericP

Received on Friday, 18 June 2010 14:42:39 UTC