hi,
I am working on a tool that performs edits in wikidata. I'd like to add a tag to the performed edits identifying my application. How and where can I apply for that?
hi,
I am working on a tool that performs edits in wikidata. I'd like to add a tag to the performed edits identifying my application. How and where can I apply for that?
So, if you are using OAUth for authentication for users using your tool, and you are making edit through the user accounts then this should be automatically done for you.
If you want to add other tags then I believe you'll need to wait for https://phabricator.wikimedia.org/T155109
I am making edits through the user account and I was not able to use the tags
parameter.
I'd like to apply for a token like wikidata-for-firefox
In the "Possible errorrs" chapter it is written that the error for a given module are visible using action=paraminfo&modules=modulename
, but this is not true.
By calling the paraminfo
action, only parameters are shown. Can anyone point to the right action to get errors?
Thanks
I'm trying to make a statement with a property that does not exist yet.
let claim = {
type: "statement",
mainsnak: {
snaktype: "value",
property: 'P370',
datavalue: {
type: "string",
value: 'foo',
}
},
id: "Q4115189", // ← do I have to use a guid here? A guid of what?
rank: "normal"
}
but the answer is $serialization does not have the correct number of parts
. What am I doing wrong? What is a part?
Yes, the ID here is the GUID. Q4115189 doesn't have enough parts to be a GUID (a bit before and after a $).
You can use wbcreateclaim to create a statement without needing to create the JSON https://www.wikidata.org/w/api.php?action=help&modules=wbcreateclaim
If you want to use wbsetclaim then you have to create your own valid GUID locally before submitting.
The possible values of wbeuaspect are S, L, D, T, C, X, O. I guess L is for Label, D is for Description, S is probability for sitelink or statement, what about the others?
const SITELINK_USAGE = 'S';
const LABEL_USAGE = 'L';
const DESCRIPTION_USAGE = 'D';
const TITLE_USAGE = 'T';
const STATEMENT_USAGE = 'C';
const ALL_USAGE = 'X';
const OTHER_USAGE = 'O';
I've tried wbsearchentities
(I personally prefer this) and wbsearch
, searching for test
, but they all contains entities such as Test1
, Testa
, etc. Is there any way I can find an exact match for my query, something similar to Special:ItemDisambiguation
, if it were not been disabled by task T195756?
At d:Q3107406#P161, I like to retrieve all statements with d:Property:P161 and then add them with property d:Property:P5030. Once done, delete all P161. Ideally in just 1 or 2 edits, and 2 or 3 api requests. I could do 1200 edits with Quickstatements, but I'd rather not.
It's possible with a single API request via wbeditentity
. The data=
will look like:
{'claims':[ {'id': '<the id of the claim to remove>', 'remove': ''}, {<data of the claim>}, [...] ]}
<data of the claim>
is JSON of each claim, where you have to replace all P161
to P5030
and remove 'id'
key.
Thanks. I will give it a try. I got a test working: .
It would slightly easier if the api sandbox had a json input box (even with formatting).
I'm trying to use wbsetclaim. However, I always get this error:
{"error":{"code":"internal_api_error_Deserializers\\Exceptions\\MissingTypeException","info":"[XAG4RQpAEDcAADvq7GUAAAAR] Caught exception of type Deserializers\\Exceptions\\MissingTypeException"},"servedby":"mw1290"}
My claim is:
{
"id": "Q4115189$ffa51229-4877-3135-a2e2-a22fe9b7039d",
"snaktype":"value",
"property":"p1",
"datavalue": {
"value":"bot test",
"type":"string"
}
}
Hello! AFAIK you are missing the DataType. Here you are an example:
"snaktype": "value", "property": "P1", "datavalue": { "value": "bot test", "type": "string" }, "datatype": "string"
Actually this is described in the Wikibase/DataModel/JSON#Snaks page but you can also look at existing claims with the wbgetentities API query.
in example 'Set a label (will overwrite)' filed "data" has value invalid value.
It should be either '{"labels":{"no":{"language":"no","value":"Bar"}}}' or '{"labels":[{"language":"no","value":"Bar"}]}'
Just out of my curiosity, what does the word "snak" mean in mainsnak
? I met this word when trying to get claims from Wikibase API
"P3221": [ { "mainsnak": { "snaktype": "value", "property": "P3221", "hash": "983e9e5d4a43d9f321e1104fa31b23cbb52d772f", "datavalue": { "value": "destination/mount-everest", "type": "string" }, "datatype": "external-id" }, "type": "statement", "id": "Q513$7DFFB96C-0A8D-4024-97EA-23A1A77CAFD2", "rank": "normal" } ],
Another question: will there be some other "snak"s that are not "mainsnak"? If not, can I treat claims and snaks as 1:1 pairs? Thanks.
Hi @CXuesong, take a look @ Wikibase/DataModel#Snaks
also https://www.wikidata.org/wiki/Help:Statements and look for the word snak.
> The core part of a statement without references and ranks is also called claim. A claim without qualifiers is also referred to as snak.
You can find the PHP interface @ https://github.com/wmde/WikibaseDataModel/blob/master/src/Snak/Snak.php