google / badwolf

Temporal graph store abstraction layer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"BETWEEN start_date, end_date" should return an error if "start_date > end_date"

rogerlucena opened this issue · comments

When using the BETWEEN keyword, if a sloppy user miswrite the start date in a way it becomes a date past the given end date of that interval, BW should return an error warning the user about it instead of silently returning an empty result (as it is the case nowadays, which is a little misleading).

To illustrate, given the query below:

SELECT ?p, ?o
FROM ?test
WHERE {
  /u<peter> ?p ?o
}
BETWEEN 2016-04-01T00:00:00-08:00, 2016-02-01T00:00:00-08:00;

And a ?test graph with triples:

/u<peter> "bought"@[2016-01-01T00:00:00-08:00] /c<mini>
/u<peter> "bought"@[2016-03-01T00:00:00-08:00] /c<model s>

The query nowadays just silently returns an empty result:

Result:
OK

Which can be misleading for the user as it will make she believe that the given interval is valid and there are no triples in the ?test graph satisfying it, whereas the truth is that the typed interval is not valid (which should be pointed as an error) as the user miswrote something while typing it.