Re: Re: Strawman for a custom R2RML syntax

* Harry Halpin <hhalpin@w3.org> [2010-08-29 23:12+0100]
> > 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?

hmm, aren't there are as many reasons to use RDF as there are to put
any other data on the SemWeb? Five examples:

  I want to share it with query federation engines so they can direct
  appropriate traffic to my site.

  I use RIF, SWRL, SPIN, SILK, ... to enforce ACLs on my data.

  I'm about to execute a complex query and I want my infrastructure
  to figure out which execution plan on which services will get my
  results before the sun burns out.

  I want to use voiD to describe the exported data.

  I'm a user of the Semantic Web so I expect to be able to use RDF
  tools to transform, catalog, audit, store and exchange my data.


> 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
> mappings.
> 
> 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.

They do know enough to construct an interface graph for their
relational data. I don't believe that the higher familiarity
with RDF justifies making the folks who are designing the RDF
face of their databases think RDF while they write XML.

> 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?

We always hope that vendors will be motivated to develop nice expert
systems or GUI interfaces. Sometimes these take a long time and
sometimes they don't happen at all so we have to be sure that the
burden of a non-domain-specific-language is justified by the inter-
operability windfalls. To that end, D2R arguably looks closer to
Apache's configuration language than does any XML.

> 
> >
> > 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>
> > TEMPLATE {
> >      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}>
> > TEMPLATE {
> >      empIRI(?empno) a biz:Employee;
> >          a <jobs/{?job}>;
> >          a <etypes/{?etype}>;
> >          biz:employeeNumber ?empno;
> >          biz:name ?ename;
> >          biz:department deptIRI(?deptno);
> > }
> >
> >
> >
> 
> 
> 
> 

-- 
-ericP

Received on Monday, 30 August 2010 00:17:54 UTC