Page MenuHomePhabricator

Implement "Monolingual text" in Pywikibot
Closed, ResolvedPublic


I wanted to play around with the new title ( but I noticed we haven't implemented "Monolingual text" yet. The other datatypes at seem to be implemented.

The data type has two parts:

  • a string
  • the language code (mandatory)

See for example

Or in json:

"P1476": [

        "snaktype": "value",
        "property": "P1476",
        "datatype": "monolingualtext",
        "datavalue": {
            "value": {
                "text": "List of United States counties and county equivalents",
                "language": "en"
            "type": "monolingualtext"

(from )

We should probably create pywikibot.WbMonolingualtext for this.

Related Objects

Event Timeline

Multichill raised the priority of this task from to Needs Triage.
Multichill updated the task description. (Show Details)
Multichill added a subscriber: Multichill.
jayvdb triaged this task as High priority.Dec 28 2014, 5:32 AM

Does Wikidata use an authority for the list of language codes? Or does it include 'mediawiki' language codes also?

Multichill set Security to None.

Hi Wikidata team, could you please answer jayvdb's question so we correctly implement this data type?

It is currently not consistent between backend and frontend which is a huge problem. I'll add the task for that as blocking.

Change 232406 had a related patch set uploaded (by Smalyshev):
T85385: implement support for monolingual text

The patch does not solve the language problem but at least allows to read/save entities with monolingual values/qualifiers/references.

Change 232406 had a related patch set uploaded (by John Vandenberg):
Implement support for monolingual text

Please review the patch again, I've updated it.

Change 232406 merged by jenkins-bot:
Implement support for monolingual text values

Smalyshev claimed this task.

I think this is resolved now?

We may also want to take a look at for the list of languages.

Change 269936 had a related patch set uploaded (by Xqt):
[fix] enable 'monolingualtext' for WikibaseKnownTypesTests.test_datatypes

Change 269936 merged by jenkins-bot:
[fix] enable 'monolingualtext' for WikibaseKnownTypesTests.test_datatypes