Page MenuHomePhabricator

[Spike 2 days] Plan to access SDC data from Lua
Closed, ResolvedPublic0 Estimated Story PointsSpike

Description

Question we are trying to answer

Acceptance Criteria

  • Get a better understanding of Lua/Wikibase
  • Expand T223792 with concrete steps to implementation

Event Timeline

Restricted Application changed the subtype of this task from "Deadline" to "Task". · View Herald Transcript
Restricted Application changed the subtype of this task from "Deadline" to "Spike". · View Herald Transcript
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

There are two things here to untangle, which really have very little to do with
each other, though they may sound similar.

  1. Using Scribunto/Lua to access MediaInfo from within wikitext. This would

allow the wikitext part of the page to make use of information maintained in the
MediaInfo slot. This should be easy to do, since Wikibase already has support
for accessing entities via Lua. In fact I thought this was already possible. If
it is not, there is probably only a bit of glue missing. This has little to do
with MCR (*).

Note that this is a requirement for use of MediaInfo data in wikitext outside
the image page anyway. And if that is not possible, I agree with Marsupium: a
good part of SDC seems to be in vain. What good is structured data if you don't
have access to it from some kind of scripting language? Search only? Just use tags.

Estimate (for someone who knows Wikibase internals): two to four weeks (unless
I'm missing some major complication). And then the same again to work out kinks
once it's deployed ;)

As mentioned in T223792: Current Wikibase Lua support seems able to deal with MediaInfo entities already - it just can't find them.
If we start writing MediaInfo entities to wb_terms, it all starts to work.
However:

  • we'll need to run a maintenance script to populate the index for older entities: T227847
  • IIRC, wb_terms is currently undergoing redesign/migration - we need to figure out what that means for us (wait until that is done? migrate? how?) T227848

I've create new tickets for those things, and am considering this one done.