Mimir should be able to replicate both MayBMS and MCDB query semantics.
I propose the following semantics:
SELECT N WORLDS
MayBMS Possible Queries
SELECT POSSIBLE A, B, ... FROM ...
Computes and returns the full set of results that could appear from
SELECT A, B, ... FROM ... in any possible world. Each tuple (each distinct lineage formula) is emitted exactly once, regardless of how many possible worlds it appears in (although different tuples with the same values may be emitted). An optional
CONF() function call emits the confidence of the row.
- This isn’t always possible. For Discrete models, we could use something like a Table-Generating Function to emit all possible values of a given VGTerm. However, for queries that depend on continuous models (and can’t be discretized, like if the model only influences a selection predicate), we might need to do something like emit a placeholder value instead.
- This is going to completely mess with aggregation…
MCDB Sample Queries
SELECT 10 WORLDS A, B, ... FROM ...
Computes the values of 10 possible results for the query
SELECT A, B, ... FROM .... In contrast to
SELECT WORLDS emits 10 distinct sets of (possibly overlapping) results. An optional
WORLD_ID()function call emits the world ID (a value from 0 to the number of worlds requested).