Page MenuHomePhabricator

Implement "Monolingual text" in Pywikibot
Closed, ResolvedPublic

Description

I wanted to play around with the new title (https://www.wikidata.org/wiki/Property:P1476) but I noticed we haven't implemented "Monolingual text" yet. The other datatypes at https://www.wikidata.org/wiki/Special:ListDatatypes seem to be implemented.

The data type has two parts:

  • a string
  • the language code (mandatory)

See for example https://www.wikidata.org/w/index.php?title=Q62&diff=prev&oldid=184166426

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 https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q62&props=claims )

We should probably create pywikibot.WbMonolingualtext for this.

Related Objects

Event Timeline

Multichill updated the task description. (Show Details)
Multichill raised the priority of this task from to Needs Triage.
Multichill added a subscriber: Multichill.
jayvdb added a subscriber: jayvdb.Dec 28 2014, 4:01 AM
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.

Restricted Application added a project: Wikidata. · View Herald TranscriptJul 6 2015, 12:45 AM
JanZerebecki moved this task from incoming to monitoring on the Wikidata board.Jul 23 2015, 9:12 PM

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

https://gerrit.wikimedia.org/r/232406

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

https://gerrit.wikimedia.org/r/232406

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

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

https://gerrit.wikimedia.org/r/232406

Smalyshev closed this task as Resolved.Jan 17 2016, 5:25 AM
Smalyshev claimed this task.

I think this is resolved now?

We may also want to take a look at https://github.com/inventaire/wikidata-lang for the list of languages.

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

https://gerrit.wikimedia.org/r/269936

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

https://gerrit.wikimedia.org/r/269936