Re: two nasty schemata, union types and surrogate keys

From: David BL <davidbl_at_iinet.net.au>
Date: Tue, 20 Oct 2009 08:11:06 -0700 (PDT)
Message-ID: <4716886a-8e4e-474a-9db6-b6418eb25b5a_at_m33g2000pri.googlegroups.com>


On Oct 20, 9:14 pm, Brian <br..._at_selzer-software.com> wrote:
> On Oct 19, 10:19 pm, David BL <davi..._at_iinet.net.au> wrote:
>
> > Consider two external predicates p1, p2 (where "external" means they
> > are informally described in natural language) satisfying
>
> > for all X, p1(X) --> p2(X)
>
> > E.g.
>
> > p1(X) :- X is a frog currently on display in
> > the San Diego zoo
>
> > p2(X) :- X is an amphibian currently on display
> > in the San Diego zoo
>
> > A relvar recording p1 under the CWA can also be regarded as recording
> > p2 under the OWA.
>
> Not a good idea.

That's only because the OWA sucks. There is no information whatsoever about why data is missing. In this case under OWA we aren't told we have only recorded the amphibians that happen to be frogs.

> p1 implies p2 but p2 does not imply p1.

That's exactly what lies behind the distinction between OWA and CWA.

> Consider:
>
> p3(X) :- X is a salamander currently on display
> in the San Diego zoo
>
> It would be best to represent p1, p2 and p3 as separate relation
> schemata. The implicative relationships from p1 to p2 and from p3 to
> p2 would then be best represented as inclusion dependencies.

What's best depends on the requirements.

> > Putting it another way, it is often the case that by "narrowing" the
> > external predicate one can turn an OWA into a CWA.
>
> > E.g. there may be a relvar for which the following gives an OWA:
>
> > p2(X) :- X is currently an employee of Acme Co
>
> > whereas the following gives a CWA:
>
> > p1(X) :- It is known to the HR department that X is currently
> > an employee of Acme Co.
>
> In this example, p1 is closed with respect to what is known to be
> true, not what is supposed to be true.

Actually p1 designates an *external* predicate. It is meaningless to ask whether p1 is open/closed. External predicates are defined independently of databases.

It is a *relvar* within a database which is open/closed with respect to some external predicate.

When you say "what is known to be true" you make it sound like that has some absolute, universal significance. But consider:

   p0(X) :- It is known by Fred that it is known to the

       HR department that X is currently an employee
       of Acme Co.

Fred could create a database with a relvar that is closed with respect to p0 and open with respect to p1. Received on Tue Oct 20 2009 - 17:11:06 CEST

Original text of this message