Jdforrester-WMF created this task.
Jdforrester-WMF added projects: SDC Engineering, Wikidata.
Restricted Application added a subscriber: Aklapper.

TASK DESCRIPTION

Right now, to pull the captions of a file, you need to do two things.

First, you map the titles to the mediainfo_entity values, via action=""> which gives you something like:

{
    "query": {
        "pages": [
            {
                "pageid": 1,
                "ns": 6,
                "title": "File:Foo.jpg",
                "pageprops": {
                    "mediainfo_entity": "M1"
                }
            },
            {
                "pageid": 2,
                "ns": 6,
                "title": "File:Bar.jpg",
                "pageprops": {
                    "mediainfo_entity": "M2"
                }
            }
        ]
    }
}

… and then you use the extracted values as the feed-in for the query to get the captions via action="">:

{
    "entities": {
        "M1": {
            "type": "mediainfo",
            "id": "M1",
            "labels": {
                "en": {
                    "language": "en",
                    "value": "Hello!"
                },
                "fr": {
                    "language": "fr",
                    "value": "Bonjour!"
                }
            },
            "statements": []
        },
        "M2": {
            "type": "mediainfo",
            "id": "M2",
            "labels": {
                "da": {
                    "language": "da",
                    "value": "hallo"
                },
                "is": {
                    "language": "is",
                    "value": "hæ"
                }
            },
            "statements": []
        }
    }
}

It might be nice to come up with a title-based generator for the wbentities query so that people would only have to do something like action="">





To: Jdforrester-WMF
Cc: Jdforrester-WMF, Aklapper, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to