Page MenuHomePhabricator

Add mw.wikibase.getEntityIdForCurrentPage for items which link to a currnt page through specific property
Closed, DuplicatePublic

Description

Sitelinks from Wikidata to Commons are very unpredictable sometimes linking to categories sometimes to galleries and sometimes to other pages. On the other hand properties are very precise:

  • Commons category (P373) links to categories
  • Commons Creator page (P1472) links to creator pages
  • Commons gallery (P935) links to geleries
  • Commons Institution page (P1612) links to institution pages
  • image (P18) links to images

The problem is that those Commons pages are not aware that there are being linked to. I would like to have a function in LUA that when called from c:Creator:Leonardo_da_Vinci with mw.wikibase.getEntityIdForCurrentPage('P1472') would return Q762

Event Timeline

I'm inclined to close this as invalid: This suggests to add some sugar on top of T74815 in a rather Wikimedia specific manner.

If we actually want to have something like this, we probably want to change the properties use another (new) data type.

It is not that similar to T74815. T74815 seeks to look up Q-ID of arbitrary page based on if it is used as a sitelink. This request is for Q-ID lookup of current page based on if it is used as a property. I guess we could make it so it can look up Q-ID of arbitrary page based on if it is used as a property. That would be fine with me too.

So you actually want a lookup for a the item that has P1472 with a certain value. That would be (at least very similar to) T99899, I guess.

Yes that is basically T99899 except for the "identifier" part. AFAIK, identifiers, like VIAF, are a special homogeneous subset of properties. Links to pages on other wikipedia would be another, links to wikidata items would be another, sitelinks like in T74815 would be yet another. We could join this task with T99899 if the scope of T99899 was expanded, I do not know how big of a difference it makes to the solution.

Yes that is basically T99899 except for the "identifier" part. AFAIK, identifiers, like VIAF, are a special homogeneous subset of properties. Links to pages on other wikipedia would be another, links to wikidata items would be another, sitelinks like in T74815 would be yet another. We could join this task with T99899 if the scope of T99899 was expanded, I do not know how big of a difference it makes to the solution.

The difference is very small (external id statements are also strings which are only being handled slightly different by the software in regards of formatting right now). The potential problem here is that T99899 assumes we can do a 1:1 mapping of lookup string -> entity, that might not be possible (or even desirable?) here. If that is not an issue, I don't think this task has much value over T99899.

The properties I care about (P373, P1472 and P1612) all have distinctive single value constraint, so 1:1 is true. (VIAF identifier P214 has the same constraint but there are thousands of violations which can not be resolved on Wikidata without fixing VIAF database. ). So yes I agree with this understanding this task is the same as T99899.

I will try to figure out how to merge them.