Re: Understanding some issues on the denotational semantics

* Juan Sequeda <juanfederico@gmail.com> [2011-02-17 10:10-0600]
> Is it me, or is the updated version that you are presenting [1] completely
> different from the current version [2].
> 
> Your proposal is to replace [2] with [1] ?
> 
> Thanks for the clarification
> 
> [1] http://www.w3.org/2011/02/16-DM-denotational-rdf-semantics
> [2] http://www.w3.org/TR/2010/WD-rdb-direct-mapping-20101118/#RDFdef

Do you mean RDFdef or the direct mapping?

If the former, I think they differ only in the "as subsequently
restricted by SPARQL" text (which I'm working out currently with
the SPARQL WG). If the latter, then sort of; they differ in the
implementation of the mapping from rows to bnodes in tables. The
denotational semantics implements this function by creating a
data structure in which identical rows are distinct objects while
the set notation's implementation relied on an explicit iteration:

  for each referencable tables T
    for each row R
      create S (IRI if there's a primary key, fresh bnode otherwise)
      for each candidate key with columns KC with values R(KC)
        KeyMap(T)(KC)(R(KC)) = S

(which is then used to create objects of refrence triples like so:
  for each table T
    for each row R
      for each foreign key linking local columns LC to target R cols RC
        o = KeyMap(R)(RC)(R(LC))
  ...
)

> Juan Sequeda
> +1-575-SEQ-UEDA
> www.juansequeda.com
> 
> 
> On Wed, Feb 16, 2011 at 2:14 PM, Juan Sequeda <juanfederico@gmail.com>wrote:
> 
> >
> >
> > On Wed, Feb 16, 2011 at 1:56 PM, Alexandre Bertails <bertails@w3.org>wrote:
> >
> >> On Wed, 2011-02-16 at 13:50 -0600, Juan Sequeda wrote:
> >> > On Wed, Feb 16, 2011 at 1:26 PM, Alexandre Bertails <bertails@w3.org>
> >> > wrote:
> >> >         Hi Juan,
> >> >
> >> >         On Wed, 2011-02-16 at 13:15 -0600, Juan Sequeda wrote:
> >> >         > Alex, Eric
> >> >         >
> >> >         >
> >> >         > Can you guys clarify some issues that I'm not understanding
> >> >         correctly.
> >> >
> >> >
> >> >         It's funny you ask these things right after I sent [1] :-)
> >> >
> >> >
> >> >
> >> > Yes, what a coincidence. You sent your email 1 hour ago. I've been
> >> > working on this for the last two.
> >> >
> >> >         I suggest you follow [2] instead of what you found in the
> >> >         current draft.
> >> >         This is an updated version (far simpler and much more
> >> >         complete) and I'll
> >> >         be happy to help you going through it.
> >> >
> >> >
> >> > Damn.. 2 hours of work down the drain....
> >>
> >> Sorry for that :-/
> >>
> >
> > Np. Not your fault ;)
> >
> >>
> >> One good indication of our work is to follow the activity on the
> >> repository. We don't produce the maths without having the corresponding
> >> code and tests. This part is now living in the "no_hierarchy" branch but
> >> I plan to merge that into the default one in the next days. That will
> >> also update the web application but this will be transparent, as both
> >> branches pass exactly the same test-suite.
> >>
> >
> > ok
> >
> >>
> >> Alexandre.
> >>
> >>
> >> >
> >> >
> >> >         Alexandre Bertails.
> >> >
> >> >         [1] http://www.w3.org/mid/1297880900.11894.25.camel@simplet
> >> >         [2] http://www.w3.org/2011/02/16-DM-denotational-rdf-semantics
> >> >
> >> >
> >> >         >
> >> >         >
> >> >         > Thanks!
> >> >         >
> >> >         >
> >> >         > I'm going to use this as my
> >> >         > example:
> >> >
> >> http://www.w3.org/TR/2010/WD-rdb-direct-mapping-20101118/#lead-ex
> >> >         >
> >> >         >
> >> >         > First, I'm going to define a Database Model, following:
> >> >         >
> >> >         http://www.w3.org/TR/2010/WD-rdb-direct-mapping-20101118/#Rel
> >> >         >
> >> >         >
> >> >         > Database = {"Address -> Table1, "People" -> Table2}
> >> >         >
> >> >         >
> >> >         > Table1 = (Header1, 0, [id], 0, Body1)
> >> >         > Header1 = {id -> int, city -> char, state ->char}
> >> >         > Body1 = [Tuple1, Tuple2]
> >> >         > Tuple1 = {id -> 18, city -> Cambridge, state -> MA}
> >> >         > Tuple2 = {id -> 19, city -> Austin, state -> TX}
> >> >         >
> >> >         >
> >> >         > Table2 = {Header2, 0, [id], FK2, Body2)
> >> >         > Header2 = {id -> int, fname -> char, addr -> int}
> >> >         > FK2 = { [addr] -> (Table1, [id]) }
> >> >         > Body2 = [Tuple3, Tuple4, Tuple5]
> >> >         > Tuple3 = {id -> 7, fname -> Bob, addr -> 18}
> >> >         > Tuple4 = {id -> 8, fname -> Sue, addr -> null}
> >> >         > Tuple5 = {id -> 9, fname -> Joe, addr -> 19}
> >> >         >
> >> >         >
> >> >         > So lets start!
> >> >         > [23]
> >> >         > directDB()
> >> >         > ≝
> >> >         > { directR(R, M) ∣
> >> >         > R ∈ DB }
> >> >         >
> >> >         >
> >> >         > First of all, I do not know what M is. I'm assuming that DB
> >> >         is the
> >> >         > Database, therefore:
> >> >         >
> >> >         >
> >> >         > R = {"Address -> Table1, "People" -> Table2}
> >> >         >
> >> >         >
> >> >         > If I understand the notation correctly, then:
> >> >         >
> >> >         >
> >> >         > directDB() = {directR("Address -> Table1, M),
> >> >         directR("People" ->
> >> >         > Table2, M)}
> >> >         >
> >> >         >
> >> >         > so let's do the first directR
> >> >         >
> >> >         >
> >> >         > 24]
> >> >         > directR(R, M)
> >> >         > ≝
> >> >         > { directT(T, R,
> >> >         > M) ∣ T ∈ R.Body }
> >> >         >
> >> >         > I'm still unclear what is M
> >> >         >
> >> >         >
> >> >         > What is R.Body? I'm assuming you are retrieving Body.
> >> >         Therefore Body
> >> >         > of Table1 is [Tuple1, Tuple2], therefore I assume:
> >> >         >
> >> >         >
> >> >         > T = [Tuple1, Tuple2]
> >> >         >
> >> >         >
> >> >         > now we have:
> >> >         >
> >> >         >
> >> >         > directR("Address -> Table1, M) = { directT([Tuple1, Tuple2],
> >> >         "Address
> >> >         > -> Table1, M) }
> >> >         >
> >> >         >
> >> >         > now let's go to the definition of directT
> >> >         >
> >> >         >
> >> >         > 25]
> >> >         > directT(T, R, M)
> >> >         > ≝
> >> >         > { directS(S, T,
> >> >         > R, M) ∣ S =
> >> >         > subject(T, R,
> >> >         > M) }
> >> >         >
> >> >         >
> >> >         > now we need to know what is S
> >> >         >
> >> >         >
> >> >         > 26]
> >> >         > subject(T, R, M)
> >> >         > ≝
> >> >         > if (pk(R) =
> >> >         > ∅) then new blank
> >> >         > node else rowIRI(R, T[pk(R)]) # references the ultimate
> >> >         referent of hierarchical key
> >> >         >
> >> >         >
> >> >         > What is pk(R)?
> >> >         >
> >> >         >
> >> >         > now we have:
> >> >         >
> >> >         >
> >> >         > subject([Tuple1, Tuple2], "Address -> Table1, M) = if
> >> >         (pk("Address ->
> >> >         > Table1) = 0
> >> >         >
> >> >         >          then new blank node
> >> >         >
> >> >         >      else
> >> >         >
> >> >         >          rowIRI("Address -> Table1, T[pk("Address ->
> >> >         Table1)])
> >> >         >
> >> >         >
> >> >         >
> >> >         >
> >> >         > I'm assuming tat pk("Address -> Table1) will return the
> >> >         primary key,
> >> >         > then we have
> >> >         >
> >> >         >
> >> >         > pk("Address -> Table1) = [id]
> >> >         >
> >> >         >
> >> >         > Now we have
> >> >         >
> >> >         >
> >> >         > subject([Tuple1, Tuple2], "Address -> Table1, M) =
> >> >         rowIRI("Address ->
> >> >         > Table1, T[[id]])
> >> >         >
> >> >         >
> >> >         > Now let's go to the definition of rowIRI
> >> >         >
> >> >         >
> >> >         > [31]
> >> >         > rowIRI(R, As)
> >> >         > ≝
> >> >         > IRI(UE(R.name) +
> >> >         > "/" + (join(',',
> >> >         > UE(A.name) + "="
> >> >         > + UE(A.value)) ∣
> >> >         > A ∈ As ) + "#_")
> >> >         >
> >> >         >
> >> >         > What is UE()?
> >> >         >
> >> >         >
> >> >         > What is R.name? Where is it defined?
> >> >         >
> >> >         >
> >> >         > Ok, I'm stopping here.
> >> >         >
> >> >         >
> >> >         > p.s. By the time I finished doing all of this, I saw that
> >> >         Alex sent an
> >> >         > email with a new version of the denotational semantics. I'm
> >> >         guessing I
> >> >         > should re-do what I just did with the new version?
> >> >         >
> >> >         >
> >> >         > Thanks guys for the clarifications!
> >> >         >
> >> >         >
> >> >         > Juan Sequeda
> >> >         > +1-575-SEQ-UEDA
> >> >         > www.juansequeda.com
> >> >         >
> >> >         >
> >> >
> >> >
> >> >
> >> >
> >>
> >>
> >>
> >

-- 
-ericP

Received on Thursday, 17 February 2011 16:42:15 UTC