- From: Alexandre Bertails <bertails@w3.org>
- Date: Wed, 19 Jan 2011 08:59:49 -0500
- To: Harry Halpin <hhalpin@w3.org>
- Cc: Ivan Herman <ivan@w3.org>, Juan Sequeda <juanfederico@gmail.com>, RDB2RDF WG <public-rdb2rdf-wg@w3.org>
On Wed, 2011-01-19 at 12:22 +0000, Harry Halpin wrote:
> >
> > On Jan 18, 2011, at 19:05 , Alexandre Bertails wrote:
> > [snip]
> >>
> >> Juan, in order to help you with your action, I would like you to
> >> considerer the following:
> >>
> >> [[
> >> CREATE TABLE Debts (
> >> Name varchar(50),
> >> Amount Integer
> >> );
> >> INSERT INTO Debts (Name, Amount) VALUES("juan", 50);
> >> INSERT INTO Debts (Name, Amount) VALUES("juan", 50);
> >> ]]
> >>
> >> Using this very simple RDB [1] example, can you go through all the
> >> phases that lead to the RDF where I owe you 100?
> >
> >
> > Alex, for my understanding: what I would expect to see in RDF are two
> > pairs of identical triples with different subjects. How would a direct
> > produce anything whereby I owe Juan 100? I will owe 50 twice, but the fact
> > that this is a hundred is a step that the RDF per se cannot say...
@Ivan sorry, I wasn't clear enough :-) Please translate my "I owe you
100" by this SQL query on the example above:
[[
mysql> SELECT SUM(Amount) FROM Debts WHERE Name = "Juan";
+-------------+
| SUM(Amount) |
+-------------+
| 100 |
+-------------+
]]
So you were totally correct when you said "two pairs of identical
triples with different subjects". And in my example, I owe Juan 2*50.
> Otherwise known as "RDF can't add, and (up until recently) neither can
> SPARQL". Which is a feature, not a bug, re decidability :)
@harry As I said above, nobody expects any triple with 100. Sorry for
the misunderstanding.
> However, I'm assuming Alex is asking with Datalog semantics, do you get
> with those two insert statements *two* distinct pairs of triples
> (multiset) or just one (set)?
>
> Multisets have repeated membership, while sets don't I think.
You're right. The problem is that Datalog (and more generally any
predicate-based logic) is based on sets whereas the SQL user expects
multisets.
Alexandre.
>
>
>
>
>
> >
> > Ivan
> >
> >
> >
> >
> >
> >>
> >> Alexandre.
> >>
> >> [1] http://www.w3.org/TR/2010/WD-rdb-direct-mapping-20101118/#Rel
> >>
> >>
> >
> >
> > ----
> > Ivan Herman, W3C Semantic Web Activity Lead
> > Home: http://www.w3.org/People/Ivan/
> > mobile: +31-641044153
> > PGP Key: http://www.ivan-herman.net/pgpkey.html
> > FOAF: http://www.ivan-herman.net/foaf.rdf
> >
> >
> >
> >
> >
> >
>
>
Received on Wednesday, 19 January 2011 13:59:46 UTC