2
$\begingroup$

Mathematica Dataset is unfortunately no built on top of relational algebra principles. If it were all datasets would be relations and all operations on datasets would also return relations (non hierarchical datasets). If that were the case output from one operation could turn into the input to another operation, just as you chain arithmetic operations (closure).

An example of how this breaks Mathematica datasets comes form GroupBy and attempts at providing closure to it.

I was starting to lose hope on a clean, simple and out of the box solution on this when I discovered that Mathematica (12) now has a new EntityFramework that seems to behave in accordance with relational principles (no weird hierarchical results that cannot be chained... or so it seems).

There even appears to an easy (but unofficial) way to convert your dataset into an entity store. However, when it comes to querying, all examples I can find are for Entity stores that either come pre-built into Mathematica or that use a relational database in the backend.

Questions:

  1. Is there some tutorial somewhere starting with a CSV and ending with a complex closure using query that someone can share or write as answer to this question? (this starts in the right direction, but then deviates into uploading to Google, without demostrating how to run complex queries against it)
  2. Is it always needed to register the EntityStore with EntityRegister or is there a way to just create and query it as with datasets?
$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.