Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grammar doc doesn't show SQL querying #11

Open
VladimirAlexiev opened this issue Jan 5, 2017 · 2 comments
Open

grammar doc doesn't show SQL querying #11

VladimirAlexiev opened this issue Jan 5, 2017 · 2 comments

Comments

@VladimirAlexiev
Copy link
Contributor

The doc grammars at https://github.com/semantalytics/xsparql/blob/master/doc/ do not show that XSPARQL can query RDBMS using SQL, something extremely useful and which is used to implement RDB2RDF DM and R2RML.
It starts with sqlForClause in the Antlr grammar XSPARQL.g.

Note: grammar.html is the source doc, and the others are derived from it:

  • grammar-nonterminals.ebnf, grammar.ebnf: plain text
  • grammar-nonterminals.xhtml, grammar.xhtml: railroad diagrams

Are there any other omissions in the doc grammars?

@VladimirAlexiev
Copy link
Contributor Author

The SQL syntax is shown in the paper On the semantics of heterogeneous querying of relational, XML, and RDF data with XSPARQL (October 2011), Fig6 "Extension of the XSPARQL syntax (partial)":

XSPARQLExpr ::= (FLWORExpr | SPARQLForClause | SQLForClause)
                            (ReturnClause | ConstructClause)
SQLForClause ::= "for" SelectSpec RelationList SQLWhereClause?
SelectSpec ::= AttrSpecList | "*" | "row" VarRef
AttrSpecList ::= AttrSpec AttrNameSpec? ("," AttrSpec AttrNameSpec?)*
AttrSpec ::= attrName | VarRef | relationName.attrName |
VarRef.attrName | relationName.VarRef | VarRef.VarRef
AttrNameSpec ::= "as" VarRef
RelationList ::= "from" TableSelector ("," TableSelector)*
TableSelector ::= TableName ("as" TableAlias)? | VarRef ("as" TableAlias)?
SQLWhereClause ::= "where" WhereSpecList
WhereSpecList ::= "(" WhereSpecList BooleanOp WhereSpecList ")" |
                              AttrSpec ComparisonOp AttrSpec | AttrSpec ComparisonOp Constant
BooleanOp ::= "and" | "or"
ComparisonOp ::= "=" | "!=" | "!=" | "<" | "<=" | ">" | "=>"

Can someone confirm whether this is accurate, and maybe complete it?

@VladimirAlexiev VladimirAlexiev changed the title the grammar doesn't show SQL querying grammar doc doesn't show SQL querying Jan 8, 2017
@VladimirAlexiev
Copy link
Contributor Author

I think this: AKSW@35336c1#diff-f0c7ce010c23322d880114070859e659R247 fixes the bug that a fake let is required before construct in function definitions.
@chile12 How to reflect this fix in the grammar doc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants