| Hall1467 added a comment. |
If we choose to go the database route instead of EventLogging, my initial thoughts would be to create a new table containing (modeled after @Halfak's reference and the current entity usage documentation: https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/docs/usagetracking.wiki):
- page_id(UNSIGNED INT) -- Wikipedia page using the entity's data
- entity_id(UNSIGNED INT) -- the entity id
- property_id(UNSIGNED INT) -- the property used by the entity
However, since a given entity-property pair might have multiple associated statements, we should also track which statement(s) are being used for that pair. I'm not exactly sure how that would be stored -- does a statement have a unique id? Could a field be a list of statements associated with a property id?
We might also consider tracking qualifiers for statements -- and I'm also not entirely sure how to best store this data. Perhaps one field could contain a list of qualifiers, indexed by the specific statement they are applied to -- this would be some sort of dictionary data structure in a field (sort of like an hstore in Postgres: https://www.postgresql.org/docs/9.1/static/hstore.html). Any insight into how to efficiently store qualifiers would be helpful.
I plan to spend some time figuring out an upper bound on how many rows this table would have as well
Cc: Halfak, jcrespo, TomT0m, Hall1467, hoo, zhuyifei1999, Eloquence, Lydia_Pintscher, Sannita, Ainali, Liuxinyu970226, MZMcBride, Ricordisamoa, Micru, jayvdb, Daniel_Mietchen, Tobi_WMDE_SW, Legoktm, Abraham, Wikidata-bugs, liangent, jeremyb, aude, Candalua, Bianjiang, Aklapper, DixonD, daniel, D3r1ck01, Izno, Mbch331
_______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
