CommonsMedia#
- class wikibaseintegrator.datatypes.commonsmedia.CommonsMedia(value=None, **kwargs)[source]#
Bases:
URLImplements the Wikibase data type for Wikimedia commons media files
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 RDF representation is the full Wikimedia Commons URL of the file (e.g. http://commons.wikimedia.org/wiki/Special:FilePath/Example%20file.jpg), only the file name is kept. Without this, the URL implementation inherited by this class would store the whole URL, which would never match the file name held by a local claim.
- get_sparql_value(**kwargs)[source]#
The IRI of the file in the RDF export: its Special:FilePath URL on Wikimedia Commons, with the file name encoded like PHP’s rawurlencode() (a space is %20), e.g. <http://commons.wikimedia.org/wiki/Special:FilePath/Example%20file.jpg>
- DTYPE = 'commonsMedia'#
- PTYPE = 'http://wikiba.se/ontology#CommonsMedia'#
- SPARQL_IRI_PREFIX = 'http://commons.wikimedia.org/wiki/Special:FilePath/'#