Page MenuHomePhabricator

Support for all datatypes in the data extension service for Commons
Closed, ResolvedPublic

Description

At the moment, users will only be able to fetch SDC statements via the data extension service for properties which are entity-valued (such as "depicts").

SDC also relies on other properties, such as "relative position within image (P2677)" (string), "inception (P571)" (date), "coordinates of the point of view (P1257)" (geographical coordinates) and probably others!

Examples of queries and their expected responses:

Querying for dates

Fetching data on this file: https://commons.wikimedia.org/wiki/File:A591_road,_Lake_District_-_June_2009_Edit_1.jpg
Query:

{
    "ids": ["M9832159"],
    "properties": [
          {"id": "P571"}
    ]
}

Response:

{
    "meta": [...]
    "rows": {
       "M9832159": {
            "P571": [{"date":"2009-06-23"}]
    }
}

Querying for strings (such as external-ids)

Fetching data on this file: https://commons.wikimedia.org/wiki/File:Cat_figurine_MET_30.8.104_EGDP014435.jpg
Query:

{
    "ids": ["M60928935"],
    "properties": [
          {"id": "P3634"}
    ]
}

Response:

{
    "meta": [...]
    "rows": {
       "M60928935": {
            "P3634": [{"str":"572106"}]
    }
}

Querying for geographical coordinates

Fetching data on this file: https://commons.wikimedia.org/wiki/File:A591_road,_Lake_District_-_June_2009_Edit_1.jpg
Query:

{
    "ids": ["M9832159"],
    "properties": [
          {"id": "P1259"}
    ]
}

Response:

{
    "meta": [...]
    "rows": {
       "M9832159": {
            "P1259": [{"str":"54.43941,-2.972027"}]
    }
}

@Spinster would you have an example of a property with a "Quantity" datatype being used as main statement (not qualifier) on Commons?

Event Timeline

@Spinster would you have an example of a property with a "Quantity" datatype being used as main statement (not qualifier) on Commons?

Great question! Many of the properties that describe various characteristics of the camera used for a photo have the Quantity datatype. Frequently used, because these are sometimes added by a bot right after upload. Examples include:

See this file for instance.

Change 734271 had a related patch set uploaded (by Eugene233; author: Eugene233):

[labs/tools/commons-recon-service@main] Support for all datatypes in the data extension service for Commons

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

Change 734271 merged by jenkins-bot:

[labs/tools/commons-recon-service@main] Support for all datatypes in the data extension service for Commons

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

Spinster triaged this task as High priority.Jan 5 2022, 4:02 PM

Something for the current sprint (January 2021) :-)

@Spinster a change seems to have been submitted to complete this task. Could there be other datatypes we need to add to the ones already implemented? Then we can create a new ticket for this :)

I think we covered all datatypes! Closing this ticket as resolved. Thank you so much @Eugene233 :-D