daniel added a comment.

I have confirmed locally that the current situations prevents access to MediaInfo entities using the {{#statements}} (nor presumably from Lua, which uses the same underlying mechanism). This means that MediaInfo cannot be used on file description pages as intended, until this is resolved.

Depending on configuration, it is possible to access MediaInfo entities from wikitext using the "commons:" prefix, but only if the statements in the MediaInfo entities use prefixed property IDs (so the main snak have property IDs like "wikidata:P17" instead of just "P17" - more about this in another comment to follow).

Example wikitext:

  • From P1 of Q4: {{#statements:P1|from=Q4}} <!-- this works as expected -->
  • From P1 of wikidata:Q4: {{#statements:P1|from=wikidata:Q4}} <!-- this does not work, the "wikidata" prefix is not used by client code -->
  • From P1 of commons:M3: {{#statements:P1|from=commons:M3}} <!-- this works, since client code knows has a repo defined for the "commons" prefix (however using cross-wiki access, not recognizing it as the local wiki). Note that the statement must use "wikidata:P1" as the property ID internally, and the repo definition must have a mapping for "wikidata" to "". -->
  • From wikidata:P1 of commons:M3: {{#statements:wikidata:P1|from=commons:M3}} <!-- this fails, since client code does not have a repo defined for the "wikidata" prefix; it then tries to find a property with the label 'wikidata:P1', and fails. -->
  • From P1 of M3: {{#statements:P1|from=M3}} <!-- this does not work, since client code does not have a namespace or slot defined to look up MediaInfo entities. -->

Output:

  • From P1 of Q4: Four
  • From P1 of wikidata:Q4:
  • From P1 of commons:M3: a test with prefix
  • From wikidata:P1 of commons:M3:

Failed to render property wikidata:P1: Property not found for label 'wikidata:P1' and language 'en'

Relevant config:

$wmgWikibaseClientEntityNamespaces = [
	'item' => 0,
	'property' => 120,
];

$wmgWikibaseClientRepoNamespaces = [
	'item' => '',
	'property' => 'Property',
];

$wmgWikibaseClientRepositories = [
	'' => [
		'repoDatabase' => 'wikidata',
		'entityNamespaces' => [
			'item' => 0,
			'property' => 120,
			'lexeme' => 146,
		],
		'baseUri' => 'http://wikidata.web.mw.localhost:8080/entity/',
		'prefixMapping' => [ '' => '' ],
	],
	'commons' => [
		'repoDatabase' => 'commons',
		'entityNamespaces' => [ 'mediainfo' => '6/mediainfo' ],
		'baseUri' => 'http://commons.web.mw.localhost:8080/entity/',
		'prefixMapping' => [
			'wikidata' => ''
		],
	],
];

$wmgWikibaseForeignRepositories = [
	'wikidata' => [
		'repoDatabase' => 'wikidata',
		'baseUri' => 'http://wikidata.web.mw.localhost:8080/entity/',
		'supportedEntityTypes' => [ 'item', 'property' ],
		'prefixMapping' => [],
		'entityNamespaces' => [ 'item' => 0, 'property' => 120 ]
	],
];

TASK DETAIL
https://phabricator.wikimedia.org/T211800

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: daniel
Cc: WMDE-leszek, Cparle, Jdforrester-WMF, Abit, EBjune, Ramsey-WMF, Aklapper, daniel, Nandana, JKSTNK, Lahi, PDrouin-WMF, Gq86, E1presidente, Anooprao, SandraF_WMF, GoranSMilovanovic, QZanden, Tramullas, Acer, LawExplorer, Silverfish, Poyekhali, _jensen, D3r1ck01, Susannaanas, Wong128hk, Jane023, Wikidata-bugs, Base, matthiasmullie, aude, El_Grafo, Dinoguy1000, Ricordisamoa, Wesalius, Lydia_Pintscher, Fabrice_Florin, Raymond, Steinsplitter, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to