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

Re: Strawman for a custom R2RML syntax

From: Harry Halpin <hhalpin@w3.org>
Date: Sun, 29 Aug 2010 23:12:30 +0100 (BST)
Message-ID: <08939409052a684343225c2c3bd27b67.squirrel@webmail-mit.w3.org>
To: "Richard Cyganiak" <richard@cyganiak.de>
Cc: "RDB2RDF WG" <public-rdb2rdf-wg@w3.org>
> Orri has asserted in a previous thread that RDF and XML are both
unsuitable for being read or written by humans, and that a custom syntax
is needed. I don't agree with these viewpoints, but I'm curious about
the potential of a custom syntax, so today spent a few hours on a plane
to come up with a strawman of my own.
> This custom syntax combines ideas from Souri's approach (use a full-
blown SQL query for transformations) with ideas from Virtuoso RDF Views
(Turtle-like templates in the spirit of SPARQL CONSTRUCT;
> definition of URI patterns as “functions”). The general flavour of the
RDF Views syntax is quite SQL-like; I tried to give it a more SPARQL-
like feel.
> The strawman is here:
> http://www.w3.org/2001/sw/rdb2rdf/wiki/R2RML_in_a_custom_syntax
> It's indeed quite concise, which is nice.
> I'm NOT proposing any concrete action related to this, but thought it
might be interesting for those who want to explore different
> alternatives in the syntax area.
> An example that is roughly equivalent to Souri's latest XML example is
attached at the end of this mapping. Can you read it and understand
what's going on? Think about SPARQL's CONSTRUCT queries when reading it

I quite like this syntax. The question should be asked:

1) What is the advantage of storing the mapping as RDF?

One answer could be that you could SPARQL the RDB2RDF mapping and store
them at SPARQL endpoints, but I can't think of any reason for doing that
really. Any other reasons?

2) What is the advantage of storing the mapping as XML?

Developers off the street understand XML much more so than RDF, and the
tooling is much more mature. But there aren't *many* database developers
out there. Also, XML Schema allows us to easily validate and find broken

The real key I think would be the audience: the audience will likely be
database maintainers who know a *little* about RDF, think Linked Data/RDF
is interesting or have theiir boss tell them to export it, and want to do
so quickly as possible.

Do we expect this audience to author these config files *by hand*? I would
guess so. The idea that "tools" will do this (for the Semantic Web at
least) seems to have never really matured. I usually author ant files and
make files by hand. Therefore, maybe it makes sense to have a simple
human-readable syntax that is neither RDF or XML. IMHO, it must be made as
easy as possible for the target audience of the mapping language while not
sacrificing expressivity. So, I'm still open for all three options. Any
more arguments?

> Best,
> Richard
> PREFIX biz: <http://biz.example.org/biz-ontology#>
> BASE <http://example.com/>
> IRIPATTERN deptIRI AS <dept/{1}>
> IRIPATTERN empIRI AS <emp/{1}>
> ID :empMap
> SQL {
>      Select deptno, dname, loc from dept
> }
> UNIQUE KEY ?deptno
> GRAPH <data/departments>
>      deptIRI(?deptno) a biz:Department;
>          biz:name ?dname;
>          biz:location ?loc .
> }
> ID :deptMap
> SQL {
>      Select empno, job, etype, ename, deptno from emp
> }
> UNIQUE KEY ?empno
> FOREIGN KEY ?deptno REFERENCES ID :empMap(?deptno)
> GRAPH <data/{?job}/{?etype}>
>      empIRI(?empno) a biz:Employee;
>          a <jobs/{?job}>;
>          a <etypes/{?etype}>;
>          biz:employeeNumber ?empno;
>          biz:name ?ename;
>          biz:department deptIRI(?deptno);
> }
Received on Sunday, 29 August 2010 22:12:33 UTC

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