W3C home > Mailing lists > Public > public-rdb2rdf-wg@w3.org > October 2010

Re: RDB2RDF WG agenda for 2010-10-19 meeting 1600 UTC

From: Paul Tyson <phtyson@sbcglobal.net>
Date: Sun, 17 Oct 2010 16:36:28 -0500
To: Alexandre Bertails <bertails@w3.org>
Cc: ashok.malhotra@oracle.com, Eric Prud'hommeaux <eric@w3.org>, Michael Hausenblas <michael.hausenblas@deri.org>, RDB2RDF WG <public-rdb2rdf-wg@w3.org>
Message-Id: <1287351388.5821.23.camel@tristan>
On Sun, 2010-10-17 at 14:24 -0400, Alexandre Bertails wrote:
> On Fri, 2010-10-15 at 15:57 -0700, ashok malhotra wrote:
> > I will not be able to make the call on Tuesday.
> > Can we agree that Eric's description is accurate and correct?
> 
> Eric, I like your document. Giving a concrete syntax for the input is a
> nice thing to do to make it explicit so that any RDBMS user can
> understand what your document is about. By the way, may I suggest you to
> precise that you need only two subsets of SQL:
> * the Data Definition Language to describe your database
> * the Data Manipulation Language that gives you the INSERT
> It's important as you don't need any query at that point.
> 
> As nobody defines mapping in terms of concrete syntax, I guess we will
> need some sort of abstraction (ie. AST) to reason about, one for the
> input (SQL Data Definition Language + Data Manipulation Language /
> INSERT) and one for the output (RDF). The latter is easy as we already
> have [1] as a W3C Recommendation. Maybe you already have something in
> mind for a SQL AST but here is an example of what one can expect from
> your first example:
> 
> [[
> CREATE TABLE Addresses (ID INT, city CHAR(10), state CHAR(2), PRIMARY
> KEY(ID))
> CREATE TABLE People (ID INT, fname CHAR(10), addr INT, PRIMARY KEY(ID),
> FOREIGN KEY(addr) REFERENCES Addresses(ID))
> INSERT INTO Addresses (ID, city, state) VALUES (18, "Cambridge", "MA")
> INSERT INTO People (ID, fname, addr) VALUES (7, "Bob", 18)
> INSERT INTO People (ID, fname, addr) VALUES (8, "Sue", NULL)
> ]]
> 
> would give something like that: (for better indentation/understanding,
> please see the attached file)
> 
> [[
> database(relation(name("Addresses"),
>                   header(attribute("ID") → type(int)×PrimaryKey,
>                          attribute("city") → type(char),
>                          attribute("state") → type(char)),
>                   data(tuple("ID" → 18, "city" → "Cambridge", "state" →
> "MA")))
>          relation(name("People"),
>                   header(attribute("ID") → type(int)×PrimaryKey,
>                          attribute("fname") → type(char),
>                          attribute("addr") →
> type(int)×ForeignKey("Adresses", "ID")),
>                   data(tuple("ID" → 7, "fname" → "bob", "addr" → 18),
>                        tuple("ID" → 8, "fname" → "sue", "addr" →
> null))))
> ]]

Or why not use an RDF schema of the relational model?  See attached
rdb-schema.ttl for one concept of the schema, and rdb-ex.ttl for the
database examples.  The schema is based on the simplest form of
relational model, which would probably support most use cases.  It could
as well be put into the terminology of SQL-2008 using SQL-schema,
SQL-table, -column, -row, etc.

I hesitate to include constraints in this schema.  They would be better
expressed in RIF.

> 
> Actually, this little example raises some questions. See below.
> 
> Does R2ML want to map the Data Definition Language to some generated
> ontology?

I share Alexandre's confusion on this point.  The example doesn't define
a good target ontology.

I have only recently started following the group again.  At the end of
the XG I thought the direction was to use RIF to handle the mapping into
a well-defined domain ontology.  I couldn't find in the archives any
discussion about why RIF was not suitable.  Does someone have a pointer
to the relevant discussions?

> 
> If we take SQL types into account, do we want to know the constraints?
> That means: is type(char) enough or do I need type(char(10))?

It would be good to have a standard mechanism to refer to all the
standard SQL datatypes and datatype families (e.g., char(n)), perhaps
using OWL datatype definition facilities.

> 
> Also, one can assume that the built AST comes from valid SQL CREATE
> TABLE / INSERT. But I think it would be safer to make some assumptions
> explicit, like for example: "for any tuple, for any (attribute → value)
> within this tuple, the declared type in the header and the actual type
> for the value MUST be the same". If it's not the case, well, the mapping
> does not make any sense :-) One can implement that as a light type
> system on top of the AST, or we can also decide to make it part of the
> mapping.

Again I would ask why not use RIF for expressing these constraints.

Regards,
--Paul

> 
> > The semantics can then be expressed in Datalog.
> 
> I was wondering what people call "semantics" for such a mapping and what
> can kind of statements they expect in the case of R2ML?
> 
> I was taught that datalog was just a subset of Prolog, used to define
> new relations from other relations using deductive logic. Here, we just
> want to go from one model (RDB) to another one (RDF).
> 
> Alexandre.
> 
> > All the best, Ashok
> > 
> > On 10/15/2010 12:48 PM, Eric Prud'hommeaux wrote:
> > > * Michael Hausenblas<michael.hausenblas@deri.org>  [2010-10-15 13:44+0100]
> > >> All,
> > >>
> > >> Below the agenda for our next week's meeting. We now focus on addressing the
> > >> remaining issues (such as document structure, etc.) and the mapping
> > >> semantics in a high-level, non-formal way. The goal is to publish the FPWD
> > >> next week.
> > > I'd also like to get some feedback on whether
> > >    http://www.w3.org/2010/10/12-Direct-Tests
> > > match the WG's expectations of what the generated graphs would look like.
> > >
> > >> Cheers,
> > >>        Michael
> > >>
> > >> ---------------------------------------------------------
> > >> AGENDA Teleconference
> > >> W3C RDB2RDF Working Group telephone conference 2010-10-19
> > >> ----------------------------------------------------------
> > >> Tuesday, 19 October *16:00-17:00 UTC* Local time:
> > >> http://www.timeanddate.com/worldclock/fixedtime.html?month=10&day=19&year=20
> > >> 10&hour=16&min=00&sec=0
> > >> Bridge US: +1-617-761-6200 (Zakim) Conference code : 7322733# (spells
> > >> "RDB2RDF")
> > >> Duration : 60 minutes
> > >> -------------------------------------------------------------------
> > >> IRC channel : #RDB2RDF on irc.w3.org:6665 W3C IRC Web Client :
> > >> http://www.w3.org/2001/01/cgi-irc
> > >> Zakim information : http://www.w3.org/2002/01/UsingZakim
> > >> Zakim bridge monitor : http://www.w3.org/1998/12/bridge/Zakim.html
> > >> Zakim IRC bot : http://www.w3.org/2001/12/zakim-irc-bot.html
> > >> -------------------------------------------------------------------
> > >>
> > >> Chair: Michael
> > >> Scribe: Zakim, pick a victim
> > >>
> > >> 1. Admin
> > >> PROPOSAL: Accept the minutes of last meeting, see
> > >> http://www.w3.org/2010/10/12-rdb2rdf-minutes.html
> > >>
> > >> Review open actions, see
> > >> http://www.w3.org/2001/sw/rdb2rdf/track/actions/open
> > >>
> > >> 2. FPWD "Relational Database to RDF Mapping Language"
> > >> http://www.w3.org/2001/sw/rdb2rdf/r2rml/
> > >>
> > >> Comments see following threads:
> > >> http://lists.w3.org/Archives/Public/public-rdb2rdf-wg/2010Oct/0028.html
> > >>
> > >> 3. AOB
> > >>
> > >> Cheers,
> > >>        Michael
> > >>
> > >> -- 
> > >> Dr. Michael Hausenblas
> > >> LiDRC - Linked Data Research Centre
> > >> DERI - Digital Enterprise Research Institute
> > >> NUIG - National University of Ireland, Galway
> > >> Ireland, Europe
> > >> Tel. +353 91 495730
> > >> http://linkeddata.deri.ie/
> > >> http://sw-app.org/about.html
> > >>
> > >>
> > >>
> > 
> > 
> 

@prefix ex: <http://www.w3.org/2001/sw/rdb2rdf/r2rml/DBex/> .
@prefix ex-dt: <http://www.w3.org/2001/sw/rdb2rdf/r2rml/datatypes/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdb: <http://www.paulhtyson.org/rdb2rdf/rdb#> .
@prefix xs: <http://www.w3.org/2001/XMLSchema/> .

ex:DEPT a rdb:Relation ;
	rdb:relationName "DEPT" ;
	rdb:primaryKey ex:DEPT.deptno ;
	rdb:header <http://www.w3.org/2001/sw/rdb2rdf/r2rml/DBex/DEPT#header> ;
	rdb:body <http://www.w3.org/2001/sw/rdb2rdf/r2rml/DBex/DEPT#body> .

<http://www.w3.org/2001/sw/rdb2rdf/r2rml/DBex/DEPT#header> 
    a rdb:RelationHeader ;
    rdfs:member ex:DEPT.deptno ;
    rdfs:member ex:DEPT.dname ;
    rdfs:member ex:DEPT.loc .
ex:DEPT.deptno a rdb:TypeDefinition ;
     rdb:typeName "deptno" ;
     rdb:underlyingType xs:number .
ex:DEPT.dname a rdb:TypeDefinition ;
    rdb:typeName "dname" ;
    rdb:underlyingType ex-dt:varchar2-30 .
ex:DEPT.loc a rdb:TypeDefinition ;
    rdb:typeName "loc" ;
    rdb:underlyingType ex-dt:varchar2-100 .

<http://www.w3.org/2001/sw/rdb2rdf/r2rml/DBex/DEPT#body> 
    a rdb:RelationBody ;
    rdfs:member [a rdb:Tuple ; 
                rdfs:member [a rdb:TypedValue ; 
                            rdb:value 10 ;
			    rdb:type ex:DEPT.deptno ] ,
                           [a rdb:TypedValue ;
		            rdb:value "APPSERVER" ;
			    rdb:type ex:DEPT.dname ] ,
		           [a rdb:TypedValue ;
		            rdb:value "New York" ;
			    rdb:type ex:DEPT.loc ] ] .

ex:EMP a rdb:Relation ;
    rdb:relationName "EMP" ;
    rdb:primaryKey ex:EMP.empno ;
    rdb:foreignKey [rdb:domesticType ex:DEPT.deptno ;
    		    rdb:foreignRelation ex:DEPT;
                    rdb:foreignType ex:DEPT.deptno ] ;
    rdb:header <http://www.w3.org/2001/sw/rdb2rdf/r2rml/DBex/EMP#header> ;
    rdb:body <http://www.w3.org/2001/sw/rdb2rdf/r2rml/DBex/EMP#body> .

<http://www.w3.org/2001/sw/rdb2rdf/r2rml/DBex/EMP#header> 
    a rdb:RelationHeader ;
    rdfs:member ex:EMP.empno ;
    rdfs:member ex:EMP.ename ;
    rdfs:member ex:EMP.job ;
    rdfs:member ex:DEPT.deptno ;
    rdfs:member ex:EMP.etype .
ex:EMP.empno a rdb:TypeDefinition ;
     rdb:typeName "empno" ;
     rdb:underlyingType xs:number .
ex:EMP.ename a rdb:TypeDefinition ;
    rdb:typeName "ename" ;
    rdb:underlyingType ex-dt:varchar2-100 .
ex:EMP.job a rdb:TypeDefinition ;
    rdb:typeName "job" ;
    rdb:underlyingType ex-dt:varchar2-30 .
ex:EMP.etype a rdb:TypeDefinition ;
    rdb:typeName "etype" ;
    rdb:underlyingType ex-dt:varchar2-30 .

<http://www.w3.org/2001/sw/rdb2rdf/r2rml/DBex/EMP#body> 
    a rdb:RelationBody ;
    rdfs:member [a rdb:Tuple ; 
                rdfs:member [a rdb:TypedValue ; 
                            rdb:value 10 ;
			    rdb:type ex:DEPT.deptno ] ,
                           [a rdb:TypedValue ;
		            rdb:value "SMITH" ;
			    rdb:type ex:EMP.ename ] ,
		           [a rdb:TypedValue ;
		            rdb:value 7369 ;
			    rdb:type ex:EMP.empno ] ,
                           [a rdb:TypedValue ;
			    rdb:value "CLERK" ;
			    rdb:type ex:EMP.job ] ,
			   [a rdb:TypedValue ;
			    rdb:value "PART_TIME" ;
			    rdb:type ex:EMP.etype ] ] .

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdb: <http://www.paulhtyson.org/rdb2rdf/rdb#> .
@prefix xs: <http://www.w3.org/2001/XMLSchema/> .

rdb:Relation a rdfs:Class . # a database table
rdb:relationName a rdf:Property ; # the table name
	rdfs:domain rdb:Relation ; 
	rdfs:range xs:string .
rdb:primaryKey a rdf:Property ; # identifies primary key(s) in a Relation
	rdfs:domain rdb:Relation ;
	rdfs:range rdb:TypeDefinition .
rdb:foreignKey a rdf:Property ; # reference to foreign typeName
	rdfs:domain rdb:Relation ;
	rdfs:range rdf:Resource . # bnode
rdb:foreignRelation a rdf:Property ; # foreign Relation
        rdfs:domain rdf:Resource ; # bnode
        rdfs:range rdb:Relation .
rdb:foreignType a rdf:Property ; # target of foreign key relationship
        rdfs:domain rdf:Resource ; # bnode
        rdfs:range rdb:TypeDefinition .
rdb:domesticType a rdf:Property ; # tail of foreign key relationship
        rdfs:domain rdf:Resource ; # bnode
        rdfs:range rdb:TypeDefinition .

rdb:header a rdf:Property ;
	rdfs:domain rdb:Relation ;
	rdfs:range rdb:RelationHeader .
rdb:RelationHeader a rdfs:Bag . # of TypeDefinitions
rdb:TypeDefinition a rdfs:Class .
rdb:typeName a rdf:Property ; # of a TypeDefinition or TypedValue
	rdfs:domain rdb:TypeDefinition ;
	rdfs:domain rdb:TypedValue ;
	rdfs:range xs:string .
rdb:underlyingType a rdf:Property ; # of a TypeDefinition
	rdfs:domain rdb:TypeDefinition ;
	rdfs:range rdf:Resource .

rdb:body a rdf:Property ;
	rdfs:domain rdb:Relation ;
	rdfs:range rdb:RelationBody .
rdb:RelationBody a rdfs:Bag . # of Tuples
rdb:Tuple a rdfs:Bag . # of TypedValues
rdb:TypedValue a rdfs:Class .
rdb:value a rdf:Property ; # of a TypedValue
	rdfs:domain rdb:TypedValue;
	rdfs:range rdf:Resource .
Received on Sunday, 17 October 2010 21:37:03 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:00:21 UTC