Re: [Wikidata-tech] Wikidata API documentation

2020-04-01 Thread Thomas Arrow
Hi,

You might also find
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase/+/master/docs/topics/json.md
helpful.
It claims to be the canonical format but I can't right now say if that is
the case.

Best,
Tom

On Wed, 1 Apr 2020 at 17:13, Leszek Manicki 
wrote:

> Howdy,
>
> you could also try if consulting
> https://doc.wikimedia.org/mediawiki-extensions-Wikibase/master/php/md_docs_topics_changeop-serializations.html
> for items and properties, and (pretty rudimentary and
> still-not-markdown-nor-linkable-html-doc)
> https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/WikibaseLexeme/+/refs/heads/master/docs/change-op-serialization.wiki
> for some lexicographical-data-specific bits helps you in your case.
>
> Best
>
>
> On Wed, 1 Apr 2020 at 02:15, Michael F. Schönitzer 
> wrote:
>
>> Hello,
>>
>> Is there any documentation to "wbeditentity", except from the few
>> examples on the API-document-page?
>> Any documentation about the format/grammar of the data?
>>
>> And is there any API-documentation for lexicographical data at al?
>> The few bits on the source-code generated page aren't sufficient.
>>
>> Cheers,
>>  M
>>
>> --
>> Michael F. Schönitzer
>> Prochintalstr. 2
>> 80993 München
>> Mail: mich...@schoenitzer.de
>> Jabber: schoenit...@jabber.ccc.de
>> Tel: 089/37918949 - Mobil: 017657895702
>>
>> ___
>> Wikidata-tech mailing list
>> Wikidata-tech@lists.wikimedia.org
>> https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
>>
>
>
> --
> Leszek Manicki
> Engineering Manager
>
> Wikimedia Deutschland e. V. | Tempelhofer Ufer 23-24 | 10963 Berlin
> Phone: +49 (0)30 219 158 26-0
> http://wikimedia.de
>
> Imagine a world in which every single human being can freely share in the
> sum of all knowledge. Help us to achieve our vision!
> https://spenden.wikimedia.de
>
> Wikimedia Deutschland – Gesellschaft zur Förderung Freien Wissens e. V.
> Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter
> der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt für
> Körperschaften I Berlin, Steuernummer 27/029/42207.
> ___
> Wikidata-tech mailing list
> Wikidata-tech@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
>
___
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech


Re: [Wikidata-tech] Wikidata API documentation

2020-04-01 Thread Leszek Manicki
Howdy,

you could also try if consulting
https://doc.wikimedia.org/mediawiki-extensions-Wikibase/master/php/md_docs_topics_changeop-serializations.html
for items and properties, and (pretty rudimentary and
still-not-markdown-nor-linkable-html-doc)
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/WikibaseLexeme/+/refs/heads/master/docs/change-op-serialization.wiki
for some lexicographical-data-specific bits helps you in your case.

Best


On Wed, 1 Apr 2020 at 02:15, Michael F. Schönitzer 
wrote:

> Hello,
>
> Is there any documentation to "wbeditentity", except from the few
> examples on the API-document-page?
> Any documentation about the format/grammar of the data?
>
> And is there any API-documentation for lexicographical data at al?
> The few bits on the source-code generated page aren't sufficient.
>
> Cheers,
>  M
>
> --
> Michael F. Schönitzer
> Prochintalstr. 2
> 80993 München
> Mail: mich...@schoenitzer.de
> Jabber: schoenit...@jabber.ccc.de
> Tel: 089/37918949 - Mobil: 017657895702
>
> ___
> Wikidata-tech mailing list
> Wikidata-tech@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
>


-- 
Leszek Manicki
Engineering Manager

Wikimedia Deutschland e. V. | Tempelhofer Ufer 23-24 | 10963 Berlin
Phone: +49 (0)30 219 158 26-0
http://wikimedia.de

Imagine a world in which every single human being can freely share in the
sum of all knowledge. Help us to achieve our vision!
https://spenden.wikimedia.de

Wikimedia Deutschland – Gesellschaft zur Förderung Freien Wissens e. V.
Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter
der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt für
Körperschaften I Berlin, Steuernummer 27/029/42207.
___
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech


Re: [Wikidata-tech] Wikidata API documentation

2020-04-01 Thread Chen Xinyan
Hi Michael,

As the author of some MW client library, I cannot find the doc, either. Neither 
have I looked into lexicographical data, but I had some trials-and-fails on 
Wikibase entity/properties, and perhaps they can help ^_^

For Wikibase items, I think the essential part of the problem is how to compose 
"data=" parameter of the request. Basically you need to send a partial of 
serialized Wikibase Entity (see 
https://www.mediawiki.org/wiki/Wikibase/DataModel/JSON) as data parameter. Just 
put in the names/aliases/claims that you want to append/update, send the 
request, and it's done.

The tricky part is, when you want to remove a claim/qualifier or an alias, you 
need to specify "remove" attribute, along with some identifiable attributes 
(language, id, etc.) like this

{
"descriptions": {
"zh": {
"language": "zh",
"remove": ""
}
},
"aliases": {
"en": [
{
"language": "en",
"value": "alias 1",
"remove": ""
}
]
},
"sitelinks": {
"testwiki": {
"site": "testwiki",
"remove": ""
}
}
}

When you are removing a claim/qualifier, you need to identify them by snak id, 
like this.

{
"claims": {
"P95433": [
{
"id": "Q212134$49E9F6B8-9D73-43A8-B45C-0D74DBA92B16",
"remove": ""
}
]
}
}

You can actually combine all these components above in a single request, to 
change multiple traits of a Wikibase item. However, you may prefer wbset* 
actions (e.g. wbsetclaim) sometimes, because they generates user-friendly edit 
summary on what has been changed, at the expense of only being able to edit 1 
aspect of the Wikibase item in 1 request.

If it's possible, perhaps you can refer to my C# code for composing data 
parameter for wbeditentity request: 
https://github.com/CXuesong/WikiClientLibrary/blob/master/WikiClientLibrary.Wikibase/Entity.Editing.cs#L23:34

Hope that helps.

Thanks,
Xinyan


-Original Message-
From: Wikidata-tech  On Behalf Of 
Michael F. Sch?nitzer
Sent: Wednesday, April 1, 2020 8:15 AM
To: wikidata-tech@lists.wikimedia.org
Subject: [Wikidata-tech] Wikidata API documentation

Hello,

Is there any documentation to "wbeditentity", except from the few examples on 
the API-document-page?
Any documentation about the format/grammar of the data?

And is there any API-documentation for lexicographical data at al?
The few bits on the source-code generated page aren't sufficient.

Cheers,
 M

--
Michael F. Schönitzer
Prochintalstr. 2
80993 München
Mail: mich...@schoenitzer.de
Jabber: schoenit...@jabber.ccc.de
Tel: 089/37918949 - Mobil: 017657895702

___
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech