Hi Versant,
Some information you're looking for is stored within the Wikibase documentation, notably:
and
but it must be read with reference to the main MediaWiki documentation, e.g.
https://mediawiki.org/wiki/Manual:Revision_table
As I understand it, primary entity storage is the same as other MediaWiki page content storage, but using JSON blobs, with slightly different [content] types for items and properties - the formats described at
the second URL you gave.
Wikibase does not attempt to fully decompose an entity into SQL normal form, as you might expect from a typical SQL data store. The same applies to references, qualifiers, etc. A corollary of this is that it is inadvisable to store too much
data on any single entity if it can be avoided, as it requires JSON parsing and creation proportional to the entity size, even if just one aspect is modified.
There are however secondary tables to support entities' different roles within Wikibase's editing and display interface (e.g. property information required to turn external links into URLs), and for performance
- some shared between items and properties where requirements overlap, such as for labels; somewhat analogous to indexes on the JSON, some of which are updated after the blob itself. (If PostgreSQL's hstore or jsonb had been used, I'd imagine some being real
indexes or at least automatically-derived fields.)
This storage is separate from any representation in WDQS, that derives from higher-level access to Wikibase entities, and which is more suitable for querying details otherwise stored within JSON. I believe this is described more in
https://mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format
- although said format may well differ from what is actually inside Blazegraph.
Hopefully people more experienced with the internals could chip in if you have more specific questions, after considering the above.
--
Laurence 'GreenReaper' Parry - WBUG
_______________________________________________