maxlath / wikibase-edit

a lib to edit Wikibase from NodeJS
67 stars 25 forks source link

Support the new WikibaseLocalMedia extension datatype #76

Closed larjohn closed 2 years ago

larjohn commented 2 years ago

If I am not mistaken, the new data type should have the name localMedia (see https://github.com/ProfessionalWiki/WikibaseLocalMedia/blob/master/src/HookHandlers.php).

Can it be added to the known datatypes?

maxlath commented 2 years ago

Is there a public instance somewhere running with this extension? We could confirm the datatype name used from its wbgetentities endpoint

larjohn commented 2 years ago

I tried it in my fork and it worked locally. Can you provide a sample query URL to check it on my own instance?

maxlath commented 2 years ago

https://www.wikidata.org/w/api.php?action=wbgetentities&props=claims&format=json&ids=Q1

larjohn commented 2 years ago
"P10463": [
 {
  "mainsnak": {
   "snaktype": "value",
   "property": "P10463",
   "hash": "195da2f2a2305807603149bbfd5b74fb886420ac",
   "datavalue": {
    "value": "HTB15LVlSpXXXXaYXVXXq6xXFXXXl.jpg",
    "type": "string"
   },
   "datatype": "localMedia"
  },
  "type": "statement",
  "id": "Q5385$d72b0aad-4b7a-6ffb-569f-bcd148903bef",
  "rank": "normal"
 }
]
maxlath commented 2 years ago

Thanks, I added localMedia datatype in 385f096 and published it in v4.15.0: can you confirm that it works?

larjohn commented 2 years ago

I am currently running a batch script, I will try that tomorrow, by the time it has finished processing.

Thanks!

larjohn commented 2 years ago

Sorry about the delay, it is OK!