JSQLParser - ConstantB/ontop-spatial GitHub Wiki

SQLParser

The parser used is JSQLParser Version 0.9

SQLParser efficiency

  1. Functions and constants are currently not supported by the parser.
  2. We do not support subqueries. Except for simple subselect as
select * from (select * from tb_books) as CHILD, (select * from tb_authors) as PARENT WHERE CHILD.bk_code = PARENT.bk_code  

These subqueries are necessaries to support R2RML mappings. They are simple because do not have joins or where conditions.

  • When a query is not supported a view is created.
When a view is created the case of unquoted identifiers is changed based on the database used.

We remove quotes present in the query, so it is not possible to distinguish between queries of the form

SELECT "column", COLUMN FROM table
if two columns have the same name at least one of them should use a different alias.

Regular expressions

We support REGEX in Oracle, MySQL, PostgresSQL and H2. Regex in SQL is not standard. DB2 and MsSQL do not provide an operator for regular expressions, while the other databases handle it differently.

If the query contains an unknown regex operator, our SQL parser will create a view of the query.

The supported operators for regular expressions are:

  • in MySQL REGEXP [BINARY]
  • in H2 and Postgres ~, ~*, !~, !~*
  • in Oracle REGEXP_LIKE
See Regex SPARQL filter for more information on the behaviour of regex in the different databases.
⚠️ **GitHub.com Fallback** ⚠️