Skip to content

Pair every query with a continuous version - #2

Open
estebanzimanyi wants to merge 1 commit into
mainfrom
fix/query-pairs-discrete-continuous
Open

Pair every query with a continuous version#2
estebanzimanyi wants to merge 1 commit into
mainfrom
fix/query-pairs-discrete-continuous

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

Every query of the four scripts has a discrete and a continuous version that runs, and both versions report their answer in the same shape, so the two counts are directly comparable. Each script has a _new copy carrying the same queries annotated with the mechanism behind every difference, and QUERIES.md maps the queries of the paper to the queries of this repository.

All counts below come from a run against the delhi and paris databases.

API and query statement

  • atValue is the form that takes a scalar second argument
  • the part-of-day query over the temporal tour segments uses segments() and startTimestamp(), and returns the discrete answer
  • the distance to a point of interest is measured at the start of the step with valueAtTimestamp()
  • the Paris tour queries read the TourPoI view of paris_tours.sql
  • Query 9 restricts the trip to Pm25 > 125 and temperature above 20 degrees before it searches the episodes, as the last line of its own pattern requires
  • Query 16 requires the trip to enter the district through its boundary and to leave through it
  • the discrete district queries read the point-based sequence, and the sequence derived from the trajectory is the continuous input
  • the before of a tour pattern is <<#, since < orders temporal values by bounding box and agrees with before only while the steps are disjoint

What the pairs show

Complete trips agree almost everywhere (708/708, 94/94, 8/8, 71/71), as neither side aggregates. That agreement is what attributes the grid divergences to the per-cell averaging rather than to the query language:

  • averaging invents monotone runs: Query 9 gives 149 trips discrete against 20 continuous, and the complete-trip version of the same query, discrete but unaveraged, gives 19
  • averaging hides threshold crossings: Query 10 gives 10 against 182
  • a cell traversed without an observation creates variable-length matches (Query 13, 10478 against 10631) and destroys fixed-length ones (Query 14, 63 against 0), so the two react to the same gap in opposite directions

Districts show the same effect at a larger granularity: 8957/9262 overlapping, 1891/1906 disjoint, 9903/10201 any-length. Query 16 has no discrete version and admits none: of the 7087619 observations, none lies on a district boundary, so Meets is never observed, and a tolerance yields 14397, 148525 or 640954 candidates at 1 m, 10 m and 50 m.

Naming

Complete trips use Q8..Q12, the grid GQ8..GQ14, districts Q15 and Q16. The grid carries the G prefix throughout because the bare names collide with the complete-trip script in the same database.

Each query of the four scripts now has a discrete and a continuous version
that run and whose answers are reported in the same shape, so that the two
counts are directly comparable. A `_new` copy of each script carries the same
queries annotated with the mechanism behind every difference, and QUERIES.md
maps the queries of the paper to the queries of the repository.

Queries that did not run
- `atValues(tbool, value)` -> `atValue`, which is the form taking a scalar
- the part-of-day query over the temporal tour segments, which was left
  unfinished, written with segments() and startTimestamp()
- `p.BufferGeom` -> the geometry of the point of interest, and the distance
  measured at the start of the step with valueAtTimestamp() instead of at the
  start of the whole tour

Queries that did not state the query
- Query 9 restricts the trip to Pm25 > 125 and temperature > 20 before the
  episodes are searched, as the last line of its pattern requires
- Query 16 requires the trip to enter the district through its boundary as
  well as to leave through it
- the discrete district queries read the point-based sequence; the sequence
  derived from the trajectory belongs to the continuous version
- the before of a tour pattern is `<<#`; comparing two temporal values with
  `<` orders them by bounding box and only coincides with before when the
  steps are disjoint

Naming
- complete trips use Q8..Q12, the grid uses GQ8..GQ14 so that the two scripts
  do not collide in the same database, districts use Q15 and Q16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant