Re: Blank Nodes Re: Toward easier RDF: a proposal

On 11/28/18 10:41 AM, Henry Story wrote:
> A person looking at the Json [of a postal address] sees the same address because they think of of a number of things:
>    1. . . .
>    2.  they could decide that two addresses are the same if they have exactly the same attributes and values.

You're right, I forgot to mention one very important assumption: that 
the attributes and values of those addresses constitute a composite 
*key*.  That is what allows us to logically conclude that they are the 
*same* address.  For something like a postal address the attributes and 
values naturally do constitute a composite key, and we humans are so 
accustomed to knowing this that it is easy to forget that the computer 
will *not* necessarily know this . . . unless we tell it to do so.  Let 
me explain further.

Suppose we have these address entries for joe and monica:

:joe :address _:b1 .
_:b1 a "PostalAddress" ;
      :streetAddress "123 West Jefferson Street" ;
      :addressLocality "Phoenix" ;
      :addressRegion "AZ" ;
      :postalCode "85003" ;
      :addressCountry "US" .

:monica :address _:b2 .
_:b2 a "PostalAddress" ;
      :streetAddress "123 West Jefferson Street" ;
      :addressLocality "Phoenix" ;
      :addressRegion "AZ" ;
      :postalCode "85003" ;
      :addressCountry "US" .

Do joe and monica have the *same* address?  In other words, is the above 
logically equivalent to writing the following?

:joe :address _:b1 .
_:b1 a "PostalAddress" ;
      :streetAddress "123 West Jefferson Street" ;
      :addressLocality "Phoenix" ;
      :addressRegion "AZ" ;
      :postalCode "85003" ;
      :addressCountry "US" .

:monica :address _:b1 .

If we know that those attributes form a composite key, then the answer 
is yes.  Otherwise, the answer is no, because for example the following 
two statements may show up elsewhere in the graph:

_:b1 :addressPlanet "Earth" .
_:b2 :addressPlanet "Alpha7" .

In my own experience, objects composed of literal attributes like this 
generally *do* form a composite key, though perhaps other RDF developers 
have had different experience.  But even if the attributes do not form a 
composite key, I am convinced that in general objects like this *should* 
have some kind of key -- i.e., it is beneficial to give them a key if 
they don't naturally have one.  This corresponds directly to standard 
good practice for tables in relational databases: that every table 
should have a primary key (which could be composite).

David Booth

Received on Thursday, 29 November 2018 05:02:44 UTC