Currently it is quite complicated to get data from wikibase. To get data regarding item Q5 one needs an SQL statement similar to
SELECT old_text from page
JOIN revision on page_id = rev_page
JOIN content on rev_sha1 = content_sha1
JOIN text on old_id = Substr(content_address,4)
where page_title = 'Q5'which is not very efficient. Then one can start parsing the json and extract the data.
I think it would be more efficient to use ExternalStore (manual) to store the revisions. Codesearch showed that the extension Flow had used external storage in the past. However, they seem to have used a relational database.
Anyhow, it seems to be more obvious to store wikibase items in a triple store directly and query that triple store (or a derivative of that) rather than keeping a separate triple store in sync with the latest revisions.
What am I missing?