LocalMedia#
- class wikibaseintegrator.datatypes.extra.localmedia.LocalMedia(value=None, **kwargs)[source]#
Bases:
StringImplements the Wikibase data type for Wikibase Local Media extension. More info at https://www.mediawiki.org/wiki/Extension:Wikibase_Local_Media
Constructor, calls the superclass BaseDataType
- from_sparql_value(sparql_value)[source]#
Parse data returned by a SPARQL endpoint and set the value to the object
The extension writes the URL of the file page on the instance (e.g. https://wiki.example.org/wiki/File:Bunny_rabbit.jpg, or index.php?title=File:Bunny_rabbit.jpg), only the file name is kept: without the namespace, which can be localized (Fichier:…), and with spaces instead of underscores.
The partial load of the fast run mode (without cache) still queries the file name as a literal, which matches nothing: building the URL needs the article path of the instance.
- DTYPE = 'localMedia'#
- PTYPE = 'http://wikiba.se/ontology#LocalMedia'#