Re: Eric's RIF simple mapping

* Juan Sequeda <juanfederico@gmail.com> [2010-07-16 13:18-0500]
> Hi all
> 
> I'm going over Eric's RIF simple mapping doc [1] and have the following
> observations:
> 
> The way I understand this is that the simple mapping is a 1:1 mapping
> between an RDF graph with some type of predicates (
> http://foo.example/DB/People#fname, etc..) which I assume came out of a RDB
> and a domain ontology (FOAF, vcard, etc)
> 
> Essentially the subject and object URI's are the same and the predicates are
> the ones mapped
> 
> db_pers:name = vcard:fn
> 
> ...
> 
> The next example are rules to transform URI structures.
> 
> However, I do not see a mapping from RDB to RDF here. Can you please
> clarify.

rifSimpleMapping is meant to be a simple subset of RIF useful for
transforming and exposing RDF graphs. The abstract cites two use
cases, maintaining multiple views of some graph (e.g. Indivo and HL7
views of patient data) and transforming a graph native to some storage
mechanism (e.g. a RelDB's direct graph) to a useful interface graph.

Note that while this is independently specified from the direct
graph, there's nothing that keeps an implementation from taking
a configuration like (using N3 as a surface syntax for RIF):

  stemURI: http://my.example/db/
  rules:
    { ?emp Employees:fn ?fn } => { ?emp foaf:givenName ?fn }
    { ?emp Employees:manager ?boss } => { ?emp WSML-HR:worksFor ?boss }

and a query like "what's Bob's boss's name?":
    { ?emp foaf:givenName "Bob" ; WSML-HR:worksFor ?boss .
      ?boss foaf:givenName ?name }
and translating directly to
    SELECT boss.fn AS name
      FROM Employees AS emp
         , Employees AS boss ON boss.id=emp.manager
     WHERE emp.fn = "Bob"
; the info is all there for optimization:

                                joins             var bindings         constraints
?emp foaf:givenName "Bob"  ⇨ Employees AS emp   uri(emp.id) AS emp   emp.fn="Bob"
?emp WSML-HR:worksFor ?boss⇨ Employees AS emp   uri(emp.id) AS emp¹
                             Employees AS boss  uri(boss.id) AS emp  boss.id=emp.manager
?boss foaf:givenName ?name ⇨ Employees AS boss  uri(boss.id) AS emp¹ boss.fn AS name

¹ redundant


> I'm planning to present on Tuesday the equivalent of the two mapping
> languages that Marcelo and I presented in SQL and RIF.
> 
> [1] http://www.w3.org/2001/sw/rdb2rdf/rifSimpleMapping/
> 
> Juan Sequeda
> +1-575-SEQ-UEDA
> www.juansequeda.com

-- 
-ericP

Received on Saturday, 17 July 2010 17:24:34 UTC