ISSUE-32: Remove the use of curly braces in joinCondition

curly braces in joinCondition

Remove the use of curly braces in joinCondition

State:
CLOSED
Product:
R2RML
Raised by:
David McNeil
Opened on:
2011-03-10
Description:
Section 3.9.1.2 of the R2RML draft describes rr:joinCondition syntax as:

"Case-sensitive column names must be enclosed within curly braces. Also, the column names specified must follow either "child." or "parent.""

The use of curly braces here does not seem helpful and in fact from an implementation perspective we see it as harmful.

1) It diverges from the rest of the R2RML spec which follows section 1.3 "In places where SQL expressions are allowed, these MUST conform to Core SQL 2008."

2) Leaving off the curly braces allows the joinCondition to be parsed as SQL (rather than requiring either a parser for a custom grammar, or a pre-processing step that removes the curly braces).

3) The usage of curly braces in joinCondition seems particularly odd since they are used to delimit the column names, but the column names are not what needs to be changed. It is the table names that need to be changed in order to execute the SQL.

I suspect that the motivation for introducing the curly braces is to avoid parsing the joinCondition (i.e. "just do a search and replace"), but this is not a generally correct approach (e.g. the SQL query could include "{x}" in a string literal). If an implementor wants to do search and replace then they could just do search and replace on "child." and "parent." One could argue that this is more likely to give a wrong answer than using curly braces, but it is just an odds game, they are both incorrect solutions in general. Also note that the "search and replace" solution is severely hampered by the fact that the curly braces are around the column identifier rather than the table identifier.

A correct solution to processing the joinCondition requires parsing the joinCondition. Using a standard grammar for the joinCondition means a standard parser can be used to parse it. Therefore, we suggest changing the spec to remove the use of curly braces in joinCondition.

NOTE: This discussion is based on the premise described in http://www.w3.org/2001/sw/rdb2rdf/track/issues/24 that the joinCondition can include arbitrarily complex SQL expressions, not just the simple "child.{x} = parent.{x}".
Related Actions Items:
Related emails:
  1. Minutes of 2011-07-12 telecon (from michael.hausenblas@deri.org on 2011-07-12)
  2. Re: Agenda for July 12 Telcon (from michael.hausenblas@deri.org on 2011-07-12)
  3. Re: Agenda for July 12 Telcon (from juanfederico@gmail.com on 2011-07-12)
  4. Re: Agenda for July 12 Telcon (from privera.salas@gmail.com on 2011-07-12)
  5. Re: Agenda for July 12 Telcon (from marcelo.arenas1@gmail.com on 2011-07-12)
  6. Agenda for July 12 Telcon (from ashok.malhotra@oracle.com on 2011-07-09)
  7. Re: Agenda for June 28 Telcon (Today) (from richard@cyganiak.de on 2011-06-28)
  8. Re: Housekeeping on open/raised issues, with PROPOSAL (from dmcneil@revelytix.com on 2011-06-21)
  9. Housekeeping on open/raised issues, with PROPOSAL (from richard@cyganiak.de on 2011-06-21)
  10. Re: ISSUE-32 resolution implemented (rr:joinCondition) (from me@alexdeleon.name on 2011-05-31)
  11. Re: Reviewing some issues (from dmcneil@revelytix.com on 2011-05-31)
  12. Reviewing some issues (from richard@cyganiak.de on 2011-05-30)
  13. Re: ISSUE-32 resolution implemented (rr:joinCondition) (from me@alexdeleon.name on 2011-05-25)
  14. ISSUE-32 resolution implemented (rr:joinCondition) (from richard@cyganiak.de on 2011-05-24)
  15. Re: Proposal for ISSUE-32, curly braces in joinCondition (from dmcneil@revelytix.com on 2011-05-11)
  16. Re: Proposal for ISSUE-32, curly braces in joinCondition (from dmcneil@revelytix.com on 2011-05-11)
  17. Re: Proposal for ISSUE-32, curly braces in joinCondition (from dmcneil@revelytix.com on 2011-05-11)
  18. Re: Proposal for ISSUE-32, curly braces in joinCondition (from richard@cyganiak.de on 2011-05-11)
  19. Re: Proposal for ISSUE-32, curly braces in joinCondition (from rscanlon@revelytix.com on 2011-05-10)
  20. Re: Proposal for ISSUE-32, curly braces in joinCondition (from richard@cyganiak.de on 2011-05-10)
  21. Re: Proposal for ISSUE-32, curly braces in joinCondition (from dmcneil@revelytix.com on 2011-05-10)
  22. Re: Proposal for ISSUE-32, curly braces in joinCondition (from richard@cyganiak.de on 2011-05-10)
  23. Re: Proposal for ISSUE-32, curly braces in joinCondition (from dmcneil@revelytix.com on 2011-05-10)
  24. Proposal for ISSUE-32, curly braces in joinCondition (from richard@cyganiak.de on 2011-05-10)
  25. Re: RDB2RDF WG agenda for 2011-05-10 meeting 1600 UTC (from marcelo.arenas1@gmail.com on 2011-05-09)
  26. RDB2RDF WG agenda for 2011-05-10 meeting 1600 UTC (from michael.hausenblas@deri.org on 2011-05-07)
  27. Minutes of 2011-04-19 telecon (from michael.hausenblas@deri.org on 2011-04-19)
  28. Issues mentioned in R2RML draft (from richard@cyganiak.de on 2011-03-22)
  29. Re: RDB2RDF WG agenda for 2011-03-22 meeting 1600 UTC (from michael.hausenblas@deri.org on 2011-03-21)
  30. Re: RDB2RDF WG agenda for 2011-03-22 meeting 1600 UTC (from richard@cyganiak.de on 2011-03-21)
  31. Re: Minutes of 2011-03-15 telecon (from eric@w3.org on 2011-03-17)
  32. Minutes of 2011-03-15 telecon (from michael.hausenblas@deri.org on 2011-03-15)
  33. Re: ISSUE-32 (curly braces in joinCondition): Remove the use of curly braces in joinCondition [R2RML] (from dmcneil@revelytix.com on 2011-03-10)
  34. ISSUE-32 (curly braces in joinCondition): Remove the use of curly braces in joinCondition [R2RML] (from sysbot+tracker@w3.org on 2011-03-10)

Related notes:

The motivation for use of curly braces was indeed to avoid parsing the join condition. However, we agree that curly braces around the column names is not necessary in the value for rr:joinCondition and edited the document accordingly.

Regarding the parent and child alias, we have replaced them with requiring use of {rr:parentAlias.} and {rr:childAlias.} respectively. This makes replacing this pattern (as long as none of the enclosing curly braces are preceded by backslash) with the appropriate table alias.

Souripriya Das, 15 Mar 2011, 14:50:34

Resolved as described here:
http://lists.w3.org/Archives/Public/public-rdb2rdf-wg/2011May/0173.html

Richard Cyganiak, 24 May 2011, 19:23:55

The solution was to use a syntax like this for joinCondition:

[] rr:joinCondition [
rr:child "deptno";
rr:parent "deptno";
].

I think this issue can be closed.

David McNeil, 31 May 2011, 13:27:30

This was clarified in the spec as:

"R2RML-generated blank nodes are scoped to a single graph. If the same blank node identifier occurs in triples that are in the same graph, then the triples will share the same single blank node. If, however, the same blank node identifier occurs in multiple graphs, then a distinct blank node is created for each graph. An R2RML-generated blank node can never be shared by two triples in two different graphs."

I think this issue can be closed.

David McNeil, 31 May 2011, 13:28:14

Please disregard my last comment on this ticket, I entered it on the wrong ticket. Sorry for the noise.

David McNeil, 31 May 2011, 13:31:55

Resolved to CLOSE; it has been addressed as per comments above
http://lists.w3.org/Archives/Public/public-rdb2rdf-wg/2011Jul/0074.html

Richard Cyganiak, 12 Jul 2011, 18:13:45

Display change log ATOM feed


Ashok Malhotra <ashok.malhotra@oracle.com>, Michael Hausenblas <michael.hausenblas@deri.org>, Chairs, Eric Prud'hommeaux <eric@w3.org>, Ivan Herman <ivan@w3.org>, Staff Contacts
Tracker: documentation, (configuration for this group), originally developed by Dean Jackson, is developed and maintained by the Systems Team <w3t-sys@w3.org>.
$Id: 32.html,v 1.1 2012/10/16 16:28:36 vivien Exp $