Hi! I can't figure out how a claim can be created with the wbsetclaim API module. It would be convenient to have a single implementation for creating and updating. Please help me. Regards, Zoltán L.
Hi Zoltán,
We also plan to support writing API access in Wikidata Toolkit soon [1]. Wikidata Toolkit already has a Java implementation of all Wikidata data objects, so one can represent statements and claims. We also will soon start working on JSON serialization of these objects (which you need to write claims through the API). Work on API access has just started.
So it will be another two weeks at least until this will be fully functional. Meanwhile, you can also look at the API sandbox [2] and especially at "examples" to see how things are done in principle, and maybe create a first prototype implementation that would help us to figure out how to do some other related things (how to log in, how to get and reuse the edit tokens properly). This could help us to speed up the process.
Cheers,
Markus
[1] https://github.com/Wikidata/Wikidata-Toolkit [2] https://test.wikidata.org/wiki/Special:ApiSandbox
On 25/02/14 16:02, JWbot wrote:
Hi! I can't figure out how a claim can be created with the wbsetclaim API module. It would be convenient to have a single implementation for creating and updating. Please help me. Regards, Zoltán L.
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
If your using php take a look at https://github.com/addwiki/wikibase-api Really simple and easy interaction with the api.
As for wbsetclaim specifically see the following link https://www.mediawiki.org/wiki/Extension:Wikibase_Repository/API#wbsetclaim
Addshore
On 25 February 2014 17:15, Markus Krötzsch markus@semantic-mediawiki.orgwrote:
Hi Zoltán,
We also plan to support writing API access in Wikidata Toolkit soon [1]. Wikidata Toolkit already has a Java implementation of all Wikidata data objects, so one can represent statements and claims. We also will soon start working on JSON serialization of these objects (which you need to write claims through the API). Work on API access has just started.
So it will be another two weeks at least until this will be fully functional. Meanwhile, you can also look at the API sandbox [2] and especially at "examples" to see how things are done in principle, and maybe create a first prototype implementation that would help us to figure out how to do some other related things (how to log in, how to get and reuse the edit tokens properly). This could help us to speed up the process.
Cheers,
Markus
[1] https://github.com/Wikidata/Wikidata-Toolkit [2] https://test.wikidata.org/wiki/Special:ApiSandbox
On 25/02/14 16:02, JWbot wrote:
Hi! I can't figure out how a claim can be created with the wbsetclaim API module. It would be convenient to have a single implementation for creating and updating. Please help me. Regards, Zoltán L.
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
Thank you for your answers. I already edited Wikidata data with Java program using the APIs. I just don't know how to create a claim with wbsetclaim. Does anyone? I think it's not possible or I miss the trick. Zoltán
2014-02-25 17:38 GMT+01:00 addshorewiki addshorewiki@gmail.com:
If your using php take a look at https://github.com/addwiki/wikibase-api Really simple and easy interaction with the api.
As for wbsetclaim specifically see the following link https://www.mediawiki.org/wiki/Extension:Wikibase_Repository/API#wbsetclaim
Addshore
On 25 February 2014 17:15, Markus Krötzsch markus@semantic-mediawiki.orgwrote:
Hi Zoltán,
We also plan to support writing API access in Wikidata Toolkit soon [1]. Wikidata Toolkit already has a Java implementation of all Wikidata data objects, so one can represent statements and claims. We also will soon start working on JSON serialization of these objects (which you need to write claims through the API). Work on API access has just started.
So it will be another two weeks at least until this will be fully functional. Meanwhile, you can also look at the API sandbox [2] and especially at "examples" to see how things are done in principle, and maybe create a first prototype implementation that would help us to figure out how to do some other related things (how to log in, how to get and reuse the edit tokens properly). This could help us to speed up the process.
Cheers,
Markus
[1] https://github.com/Wikidata/Wikidata-Toolkit [2] https://test.wikidata.org/wiki/Special:ApiSandbox
On 25/02/14 16:02, JWbot wrote:
Hi! I can't figure out how a claim can be created with the wbsetclaim API module. It would be convenient to have a single implementation for creating and updating. Please help me. Regards, Zoltán L.
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
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
Using wbcreateclaim might be easier :) For example:
api.php?action=wbcreateclaim&entity=Q42&property=P9003&snaktype=value&value={"entity-type":"item","numeric-id":1}
On 25 February 2014 21:08, JWbot ght81.wikipedia@gmail.com wrote:
Thank you for your answers. I already edited Wikidata data with Java program using the APIs. I just don't know how to create a claim with wbsetclaim. Does anyone? I think it's not possible or I miss the trick. Zoltán
2014-02-25 17:38 GMT+01:00 addshorewiki addshorewiki@gmail.com:
If your using php take a look at https://github.com/addwiki/wikibase-api
Really simple and easy interaction with the api.
As for wbsetclaim specifically see the following link
https://www.mediawiki.org/wiki/Extension:Wikibase_Repository/API#wbsetclaim
Addshore
On 25 February 2014 17:15, Markus Krötzsch <markus@semantic-mediawiki.org
wrote:
Hi Zoltán,
We also plan to support writing API access in Wikidata Toolkit soon [1]. Wikidata Toolkit already has a Java implementation of all Wikidata data objects, so one can represent statements and claims. We also will soon start working on JSON serialization of these objects (which you need to write claims through the API). Work on API access has just started.
So it will be another two weeks at least until this will be fully functional. Meanwhile, you can also look at the API sandbox [2] and especially at "examples" to see how things are done in principle, and maybe create a first prototype implementation that would help us to figure out how to do some other related things (how to log in, how to get and reuse the edit tokens properly). This could help us to speed up the process.
Cheers,
Markus
[1] https://github.com/Wikidata/Wikidata-Toolkit [2] https://test.wikidata.org/wiki/Special:ApiSandbox
On 25/02/14 16:02, JWbot wrote:
Hi! I can't figure out how a claim can be created with the wbsetclaim API module. It would be convenient to have a single implementation for creating and updating. Please help me. Regards, Zoltán L.
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
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
You can't set rank, qualifiers, references with wbcreateclaim. My question is if it is possible to create a claim with wbsetclaim?
2014-02-25 21:11 GMT+01:00 addshorewiki addshorewiki@gmail.com:
Using wbcreateclaim might be easier :) For example:
api.php?action=wbcreateclaim&entity=Q42&property=P9003&snaktype=value&value={"entity-type":"item","numeric-id":1}
On 25 February 2014 21:08, JWbot ght81.wikipedia@gmail.com wrote:
Thank you for your answers. I already edited Wikidata data with Java program using the APIs. I just don't know how to create a claim with wbsetclaim. Does anyone? I think it's not possible or I miss the trick. Zoltán
2014-02-25 17:38 GMT+01:00 addshorewiki addshorewiki@gmail.com:
If your using php take a look at https://github.com/addwiki/wikibase-api
Really simple and easy interaction with the api.
As for wbsetclaim specifically see the following link
https://www.mediawiki.org/wiki/Extension:Wikibase_Repository/API#wbsetclaim
Addshore
On 25 February 2014 17:15, Markus Krötzsch < markus@semantic-mediawiki.org> wrote:
Hi Zoltán,
We also plan to support writing API access in Wikidata Toolkit soon [1]. Wikidata Toolkit already has a Java implementation of all Wikidata data objects, so one can represent statements and claims. We also will soon start working on JSON serialization of these objects (which you need to write claims through the API). Work on API access has just started.
So it will be another two weeks at least until this will be fully functional. Meanwhile, you can also look at the API sandbox [2] and especially at "examples" to see how things are done in principle, and maybe create a first prototype implementation that would help us to figure out how to do some other related things (how to log in, how to get and reuse the edit tokens properly). This could help us to speed up the process.
Cheers,
Markus
[1] https://github.com/Wikidata/Wikidata-Toolkit [2] https://test.wikidata.org/wiki/Special:ApiSandbox
On 25/02/14 16:02, JWbot wrote:
Hi! I can't figure out how a claim can be created with the wbsetclaim API module. It would be convenient to have a single implementation for creating and updating. Please help me. Regards, Zoltán L.
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
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
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
Hey,
you can create claims with wbsetclaim. But you would need to create a valid GUID [1] yourself. The claim-GUID you send with your request needs to be <entityId>$<GUID> (e.g. Q2$5627445f-43cb-ed6d-3adb-760e66bd17ee).
cheers, tobi
[1] http://en.wikipedia.org/wiki/Globally_unique_identifier
On Tue, Feb 25, 2014 at 9:17 PM, JWbot ght81.wikipedia@gmail.com wrote:
You can't set rank, qualifiers, references with wbcreateclaim. My question is if it is possible to create a claim with wbsetclaim?
2014-02-25 21:11 GMT+01:00 addshorewiki addshorewiki@gmail.com:
Using wbcreateclaim might be easier :)
For example:
api.php?action=wbcreateclaim&entity=Q42&property=P9003&snaktype=value&value={"entity-type":"item","numeric-id":1}
On 25 February 2014 21:08, JWbot ght81.wikipedia@gmail.com wrote:
Thank you for your answers. I already edited Wikidata data with Java program using the APIs. I just don't know how to create a claim with wbsetclaim. Does anyone? I think it's not possible or I miss the trick. Zoltán
2014-02-25 17:38 GMT+01:00 addshorewiki addshorewiki@gmail.com:
If your using php take a look at https://github.com/addwiki/wikibase-api
Really simple and easy interaction with the api.
As for wbsetclaim specifically see the following link
https://www.mediawiki.org/wiki/Extension:Wikibase_Repository/API#wbsetclaim
Addshore
On 25 February 2014 17:15, Markus Krötzsch < markus@semantic-mediawiki.org> wrote:
Hi Zoltán,
We also plan to support writing API access in Wikidata Toolkit soon [1]. Wikidata Toolkit already has a Java implementation of all Wikidata data objects, so one can represent statements and claims. We also will soon start working on JSON serialization of these objects (which you need to write claims through the API). Work on API access has just started.
So it will be another two weeks at least until this will be fully functional. Meanwhile, you can also look at the API sandbox [2] and especially at "examples" to see how things are done in principle, and maybe create a first prototype implementation that would help us to figure out how to do some other related things (how to log in, how to get and reuse the edit tokens properly). This could help us to speed up the process.
Cheers,
Markus
[1] https://github.com/Wikidata/Wikidata-Toolkit [2] https://test.wikidata.org/wiki/Special:ApiSandbox
On 25/02/14 16:02, JWbot wrote:
Hi! I can't figure out how a claim can be created with the wbsetclaim API module. It would be convenient to have a single implementation for creating and updating. Please help me. Regards, Zoltán L.
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
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
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
Thank you. :)
2014-02-26 10:33 GMT+01:00 Tobi Gritschacher < tobias.gritschacher@wikimedia.de>:
Hey,
you can create claims with wbsetclaim. But you would need to create a valid GUID [1] yourself. The claim-GUID you send with your request needs to be <entityId>$<GUID> (e.g. Q2$5627445f-43cb-ed6d-3adb-760e66bd17ee).
cheers, tobi
[1] http://en.wikipedia.org/wiki/Globally_unique_identifier
On Tue, Feb 25, 2014 at 9:17 PM, JWbot ght81.wikipedia@gmail.com wrote:
You can't set rank, qualifiers, references with wbcreateclaim. My question is if it is possible to create a claim with wbsetclaim?
2014-02-25 21:11 GMT+01:00 addshorewiki addshorewiki@gmail.com:
Using wbcreateclaim might be easier :)
For example:
api.php?action=wbcreateclaim&entity=Q42&property=P9003&snaktype=value&value={"entity-type":"item","numeric-id":1}
On 25 February 2014 21:08, JWbot ght81.wikipedia@gmail.com wrote:
Thank you for your answers. I already edited Wikidata data with Java program using the APIs. I just don't know how to create a claim with wbsetclaim. Does anyone? I think it's not possible or I miss the trick. Zoltán
2014-02-25 17:38 GMT+01:00 addshorewiki addshorewiki@gmail.com:
If your using php take a look at
https://github.com/addwiki/wikibase-api Really simple and easy interaction with the api.
As for wbsetclaim specifically see the following link
https://www.mediawiki.org/wiki/Extension:Wikibase_Repository/API#wbsetclaim
Addshore
On 25 February 2014 17:15, Markus Krötzsch < markus@semantic-mediawiki.org> wrote:
Hi Zoltán,
We also plan to support writing API access in Wikidata Toolkit soon [1]. Wikidata Toolkit already has a Java implementation of all Wikidata data objects, so one can represent statements and claims. We also will soon start working on JSON serialization of these objects (which you need to write claims through the API). Work on API access has just started.
So it will be another two weeks at least until this will be fully functional. Meanwhile, you can also look at the API sandbox [2] and especially at "examples" to see how things are done in principle, and maybe create a first prototype implementation that would help us to figure out how to do some other related things (how to log in, how to get and reuse the edit tokens properly). This could help us to speed up the process.
Cheers,
Markus
[1] https://github.com/Wikidata/Wikidata-Toolkit [2] https://test.wikidata.org/wiki/Special:ApiSandbox
On 25/02/14 16:02, JWbot wrote:
> Hi! > I can't figure out how a claim can be created with the wbsetclaim API > module. It would be convenient to have a single implementation for > creating and updating. Please help me. > Regards, > Zoltán L. > > > > _______________________________________________ > 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
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
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
-- Tobi Gritschacher Software Developer - Wikidata - http://www.wikidata.org
Imagine a world, in which every single human being can freely share in the sum of all knowledge. That's our commitment.
Wikimedia Deutschland e.V. | Tempelhofer Ufer 23-24 | 10963 Berlin Phone +49 (0)30 219 158 260
http://wikimedia.de http://www.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/681/51985.
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
Am 26.02.2014 10:33, schrieb Tobi Gritschacher:
Hey,
you can create claims with wbsetclaim. But you would need to create a valid GUID [1] yourself. The claim-GUID you send with your request needs to be <entityId>$<GUID> (e.g. Q2$5627445f-43cb-ed6d-3adb-760e66bd17ee).
Uh, didn't we fix this a long time ago? Client-Supplied GUIDs are evil :(
-- daniel
On 26/02/14 13:45, Daniel Kinzler wrote:
Am 26.02.2014 10:33, schrieb Tobi Gritschacher:
Hey,
you can create claims with wbsetclaim. But you would need to create a valid GUID [1] yourself. The claim-GUID you send with your request needs to be <entityId>$<GUID> (e.g. Q2$5627445f-43cb-ed6d-3adb-760e66bd17ee).
Uh, didn't we fix this a long time ago? Client-Supplied GUIDs are evil :(
Yep, I was thinking the same when I read this. Requests with GUIDs that are not associated with any Statement should be rejected (this typically would happen if somebody tries to modify a statement that meanwhile has been deleted; this should rather fail than lead to the silent recreation of the deleted statement). A special GUID value (empty?) should be used to "create a new GUID for me"; the new GUID should then be returned in the reply so that the caller can continue to work with this statement.
Markus
At this time it has no entity parameter like wbgetclaims.
2014-02-26 14:51 GMT+01:00 Markus Krötzsch markus@semantic-mediawiki.org:
On 26/02/14 13:45, Daniel Kinzler wrote:
Am 26.02.2014 10:33, schrieb Tobi Gritschacher:
Hey,
you can create claims with wbsetclaim. But you would need to create a valid GUID [1] yourself. The claim-GUID you send with your request needs to be <entityId>$<GUID> (e.g. Q2$5627445f-43cb-ed6d-3adb-760e66bd17ee).
Uh, didn't we fix this a long time ago? Client-Supplied GUIDs are evil :(
Yep, I was thinking the same when I read this. Requests with GUIDs that are not associated with any Statement should be rejected (this typically would happen if somebody tries to modify a statement that meanwhile has been deleted; this should rather fail than lead to the silent recreation of the deleted statement). A special GUID value (empty?) should be used to "create a new GUID for me"; the new GUID should then be returned in the reply so that the caller can continue to work with this statement.
Markus
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
Hey,
you can create claims with wbsetclaim. But you would need to create a
valid
GUID [1] yourself. The claim-GUID you send with your request needs to be <entityId>$<GUID> (e.g. Q2$5627445f-43cb-ed6d-3adb-760e66bd17ee).
Uh, didn't we fix this a long time ago? Client-Supplied GUIDs are evil :(
This has come up at some point, and as far as I recall, we dropped the requirement to provide the GUID. So I suspect one can provide a claim without a GUID, else something went wrong somewhere.
Requests with GUIDs that are not associated with any Statement should be
rejected
Not allowing specifying GUIDs is another topic altogether. Disallowing them is not the intention of the current system, and needs discussion before that is changed. This seems to be both out of scope of this thread and be way to low on the priority list (after all, where is the problem, its been working just fine) to spend time on.
Cheers
-- Jeroen De Dauw http://www.bn2vs.com Don't panic. Don't be evil. ~=[,,_,,]:3 --
Am 26.02.2014 18:41, schrieb Jeroen De Dauw:
Uh, didn't we fix this a long time ago? Client-Supplied GUIDs are evil :(
This has come up at some point, and as far as I recall, we dropped the requirement to provide the GUID. So I suspect one can provide a claim without a GUID, else something went wrong somewhere.
I have filed https://bugzilla.wikimedia.org/show_bug.cgi?id=61950 now.
-- daniel
On 26/02/14 18:41, Jeroen De Dauw wrote:
Hey,
you can create claims with wbsetclaim. But you would need to create
a valid
GUID [1] yourself. The claim-GUID you send with your request needs to be <entityId>$<GUID> (e.g. Q2$5627445f-43cb-ed6d-3adb-760e66bd17ee).
Uh, didn't we fix this a long time ago? Client-Supplied GUIDs are evil :(
This has come up at some point, and as far as I recall, we dropped the requirement to provide the GUID. So I suspect one can provide a claim without a GUID, else something went wrong somewhere.
Requests with GUIDs that are not associated with any Statement should
be rejected
Not allowing specifying GUIDs is another topic altogether. Disallowing them is not the intention of the current system, and needs discussion before that is changed. This seems to be both out of scope of this thread and be way to low on the priority list (after all, where is the problem, its been working just fine) to spend time on.
As Daniel said: "Client-Supplied GUIDs are evil :(". My only point was that one should never use such GUIDs for new statements. Returning an error seems better than just creating a new GUID, but both would work. Mainly, we should not use externally provided GUIDs. For example, if somebody is mistaken to believe that any string of the proper format can be used, then we might get bot code where the "GUID" is based on a constant. Wikibase should better make sure that it uses quality GUIDs, which are as random as a GUID is supposed to be.
Markus
Looking at the code it is indeed impossible to pass an empty guid in currently in SetClaim.php The ChangeOpClaim class that SetClaim uses can actually handle no guid in a claim and will create one for such a claim but it looks like we don't use this in SetClaim, and can't. The reason we can not accept an empty GUID is that wbsetclaim then has no way of knowing where you would intend to create the claim.
If you take a look at the wbeditentity module you should be able to do everything through there! i.e. pass in a claim with no guid and it will be created.
Addshore
On 26 February 2014 19:01, Markus Krötzsch markus@semantic-mediawiki.orgwrote:
On 26/02/14 18:41, Jeroen De Dauw wrote:
Hey,
you can create claims with wbsetclaim. But you would need to create
a valid
GUID [1] yourself. The claim-GUID you send with your request needs to
be
<entityId>$<GUID> (e.g. Q2$5627445f-43cb-ed6d-3adb-760e66bd17ee).
Uh, didn't we fix this a long time ago? Client-Supplied GUIDs are evil
:(
This has come up at some point, and as far as I recall, we dropped the requirement to provide the GUID. So I suspect one can provide a claim without a GUID, else something went wrong somewhere.
Requests with GUIDs that are not associated with any Statement should
be rejected
Not allowing specifying GUIDs is another topic altogether. Disallowing them is not the intention of the current system, and needs discussion before that is changed. This seems to be both out of scope of this thread and be way to low on the priority list (after all, where is the problem, its been working just fine) to spend time on.
As Daniel said: "Client-Supplied GUIDs are evil :(". My only point was that one should never use such GUIDs for new statements. Returning an error seems better than just creating a new GUID, but both would work. Mainly, we should not use externally provided GUIDs. For example, if somebody is mistaken to believe that any string of the proper format can be used, then we might get bot code where the "GUID" is based on a constant. Wikibase should better make sure that it uses quality GUIDs, which are as random as a GUID is supposed to be.
Markus
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
I realise I should probably have included the example that is in the API doc so here it goes:
Creates a new claim on the item for the property P56 and a value of "ExampleString":action=wbeditentity&id=Q42&data={"claims":[{"mainsnak":{"snaktype":"value","property":"P56","datavalue":{"value":"ExampleString","type":"string"}},"type":"statement","rank":"normal"}]} http://www.wikidata.org/w/api.php?action=wbeditentity&id=Q42&data={%22claims%22:[{%22mainsnak%22:{%22snaktype%22:%22value%22,%22property%22:%22P56%22,%22datavalue%22:{%22value%22:%22ExampleString%22,%22type%22:%22string%22}},%22type%22:%22statement%22,%22rank%22:%22normal%22}]}
Removes the claims from the item with the guids q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F and q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X:action=wbeditentity&id=Q42&data={"claims":[{"id":"Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F","remove":""},{"id":"Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X","remove":""}]} http://www.wikidata.org/w/api.php?action=wbeditentity&id=Q42&data={%22claims%22:[{%22id%22:%22Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F%22,%22remove%22:%22%22},{%22id%22:%22Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X%22,%22remove%22:%22%22}]}
Sets the claim with the GUID to the value of the claim:action=wbeditentity&id=Q42&data={"claims":[{"id":"Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X","mainsnak":{"snaktype":"value","property":"P56","datavalue":{"value":"ChangedString","type":"string"}},"type":"statement","rank":"normal"}]} http://www.wikidata.org/w/api.php?action=wbeditentity&id=Q42&data={%22claims%22:[{%22id%22:%22Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X%22,%22mainsnak%22:{%22snaktype%22:%22value%22,%22property%22:%22P56%22,%22datavalue%22:{%22value%22:%22ChangedString%22,%22type%22:%22string%22}},%22type%22:%22statement%22,%22rank%22:%22normal%22}]}
Addshore
On 26 February 2014 19:01, Markus Krötzsch markus@semantic-mediawiki.orgwrote:
On 26/02/14 18:41, Jeroen De Dauw wrote:
Hey,
you can create claims with wbsetclaim. But you would need to create
a valid
GUID [1] yourself. The claim-GUID you send with your request needs to
be
<entityId>$<GUID> (e.g. Q2$5627445f-43cb-ed6d-3adb-760e66bd17ee).
Uh, didn't we fix this a long time ago? Client-Supplied GUIDs are evil
:(
This has come up at some point, and as far as I recall, we dropped the requirement to provide the GUID. So I suspect one can provide a claim without a GUID, else something went wrong somewhere.
Requests with GUIDs that are not associated with any Statement should
be rejected
Not allowing specifying GUIDs is another topic altogether. Disallowing them is not the intention of the current system, and needs discussion before that is changed. This seems to be both out of scope of this thread and be way to low on the priority list (after all, where is the problem, its been working just fine) to spend time on.
As Daniel said: "Client-Supplied GUIDs are evil :(". My only point was that one should never use such GUIDs for new statements. Returning an error seems better than just creating a new GUID, but both would work. Mainly, we should not use externally provided GUIDs. For example, if somebody is mistaken to believe that any string of the proper format can be used, then we might get bot code where the "GUID" is based on a constant. Wikibase should better make sure that it uses quality GUIDs, which are as random as a GUID is supposed to be.
Markus
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
Ok, here is my suggestion for wbsetclaim:
* we introduce a new optional parameter "id" * if a guid is set inside the claim serialization, change that claim if it exists and return an error if that claim is unknown. * if no guid is set in the claim serialization, create a new claim for the entity identified by the new parameter "id". if "id" is not set, return an error.
This would be a breaking change for all users that are creating claims through wbsetclaim at the moment. This would not break for any other user.
comments?
cheers, tobi
On Wed, Feb 26, 2014 at 8:19 PM, addshorewiki addshorewiki@gmail.comwrote:
I realise I should probably have included the example that is in the API doc so here it goes:
Creates a new claim on the item for the property P56 and a value of "ExampleString":action=wbeditentity&id=Q42&data={"claims":[{"mainsnak":{"snaktype":"value","property":"P56","datavalue":{"value":"ExampleString","type":"string"}},"type":"statement","rank":"normal"}]} http://www.wikidata.org/w/api.php?action=wbeditentity&id=Q42&data=%7B%22claims%22:[%7B%22mainsnak%22:%7B%22snaktype%22:%22value%22,%22property%22:%22P56%22,%22datavalue%22:%7B%22value%22:%22ExampleString%22,%22type%22:%22string%22%7D%7D,%22type%22:%22statement%22,%22rank%22:%22normal%22%7D]%7D
Removes the claims from the item with the guids q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F and q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X:action=wbeditentity&id=Q42&data={"claims":[{"id":"Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F","remove":""},{"id":"Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X","remove":""}]} http://www.wikidata.org/w/api.php?action=wbeditentity&id=Q42&data=%7B%22claims%22:[%7B%22id%22:%22Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F%22,%22remove%22:%22%22%7D,%7B%22id%22:%22Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X%22,%22remove%22:%22%22%7D]%7D
Sets the claim with the GUID to the value of the claim:action=wbeditentity&id=Q42&data={"claims":[{"id":"Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X","mainsnak":{"snaktype":"value","property":"P56","datavalue":{"value":"ChangedString","type":"string"}},"type":"statement","rank":"normal"}]} http://www.wikidata.org/w/api.php?action=wbeditentity&id=Q42&data=%7B%22claims%22:[%7B%22id%22:%22Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X%22,%22mainsnak%22:%7B%22snaktype%22:%22value%22,%22property%22:%22P56%22,%22datavalue%22:%7B%22value%22:%22ChangedString%22,%22type%22:%22string%22%7D%7D,%22type%22:%22statement%22,%22rank%22:%22normal%22%7D]%7D
Addshore
On 26 February 2014 19:01, Markus Krötzsch markus@semantic-mediawiki.orgwrote:
On 26/02/14 18:41, Jeroen De Dauw wrote:
Hey,
you can create claims with wbsetclaim. But you would need to create
a valid
GUID [1] yourself. The claim-GUID you send with your request needs
to be
<entityId>$<GUID> (e.g. Q2$5627445f-43cb-ed6d-3adb-760e66bd17ee).
Uh, didn't we fix this a long time ago? Client-Supplied GUIDs are
evil :(
This has come up at some point, and as far as I recall, we dropped the requirement to provide the GUID. So I suspect one can provide a claim without a GUID, else something went wrong somewhere.
Requests with GUIDs that are not associated with any Statement should
be rejected
Not allowing specifying GUIDs is another topic altogether. Disallowing them is not the intention of the current system, and needs discussion before that is changed. This seems to be both out of scope of this thread and be way to low on the priority list (after all, where is the problem, its been working just fine) to spend time on.
As Daniel said: "Client-Supplied GUIDs are evil :(". My only point was that one should never use such GUIDs for new statements. Returning an error seems better than just creating a new GUID, but both would work. Mainly, we should not use externally provided GUIDs. For example, if somebody is mistaken to believe that any string of the proper format can be used, then we might get bot code where the "GUID" is based on a constant. Wikibase should better make sure that it uses quality GUIDs, which are as random as a GUID is supposed to be.
Markus
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
Parameter name should be consistent with wbgetclaims. It is "entity" there.
2014-02-26 21:22 GMT+01:00 Tobi Gritschacher < tobias.gritschacher@wikimedia.de>:
Ok, here is my suggestion for wbsetclaim:
- we introduce a new optional parameter "id"
- if a guid is set inside the claim serialization, change that claim if it
exists and return an error if that claim is unknown.
- if no guid is set in the claim serialization, create a new claim for the
entity identified by the new parameter "id". if "id" is not set, return an error.
This would be a breaking change for all users that are creating claims through wbsetclaim at the moment. This would not break for any other user.
comments?
cheers, tobi
On Wed, Feb 26, 2014 at 8:19 PM, addshorewiki addshorewiki@gmail.comwrote:
I realise I should probably have included the example that is in the API doc so here it goes:
Creates a new claim on the item for the property P56 and a value of "ExampleString":action=wbeditentity&id=Q42&data={"claims":[{"mainsnak":{"snaktype":"value","property":"P56","datavalue":{"value":"ExampleString","type":"string"}},"type":"statement","rank":"normal"}]} http://www.wikidata.org/w/api.php?action=wbeditentity&id=Q42&data=%7B%22claims%22:[%7B%22mainsnak%22:%7B%22snaktype%22:%22value%22,%22property%22:%22P56%22,%22datavalue%22:%7B%22value%22:%22ExampleString%22,%22type%22:%22string%22%7D%7D,%22type%22:%22statement%22,%22rank%22:%22normal%22%7D]%7D
Removes the claims from the item with the guids q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F and q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X:action=wbeditentity&id=Q42&data={"claims":[{"id":"Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F","remove":""},{"id":"Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X","remove":""}]} http://www.wikidata.org/w/api.php?action=wbeditentity&id=Q42&data=%7B%22claims%22:[%7B%22id%22:%22Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F%22,%22remove%22:%22%22%7D,%7B%22id%22:%22Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X%22,%22remove%22:%22%22%7D]%7D
Sets the claim with the GUID to the value of the claim:action=wbeditentity&id=Q42&data={"claims":[{"id":"Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X","mainsnak":{"snaktype":"value","property":"P56","datavalue":{"value":"ChangedString","type":"string"}},"type":"statement","rank":"normal"}]} http://www.wikidata.org/w/api.php?action=wbeditentity&id=Q42&data=%7B%22claims%22:[%7B%22id%22:%22Q42$GH678DSA-01PQ-28XC-HJ90-DDFD9990126X%22,%22mainsnak%22:%7B%22snaktype%22:%22value%22,%22property%22:%22P56%22,%22datavalue%22:%7B%22value%22:%22ChangedString%22,%22type%22:%22string%22%7D%7D,%22type%22:%22statement%22,%22rank%22:%22normal%22%7D]%7D
Addshore
On 26 February 2014 19:01, Markus Krötzsch <markus@semantic-mediawiki.org
wrote:
On 26/02/14 18:41, Jeroen De Dauw wrote:
Hey,
you can create claims with wbsetclaim. But you would need to create
a valid
GUID [1] yourself. The claim-GUID you send with your request needs
to be
<entityId>$<GUID> (e.g. Q2$5627445f-43cb-ed6d-3adb-760e66bd17ee).
Uh, didn't we fix this a long time ago? Client-Supplied GUIDs are
evil :(
This has come up at some point, and as far as I recall, we dropped the requirement to provide the GUID. So I suspect one can provide a claim without a GUID, else something went wrong somewhere.
Requests with GUIDs that are not associated with any Statement should
be rejected
Not allowing specifying GUIDs is another topic altogether. Disallowing them is not the intention of the current system, and needs discussion before that is changed. This seems to be both out of scope of this thread and be way to low on the priority list (after all, where is the problem, its been working just fine) to spend time on.
As Daniel said: "Client-Supplied GUIDs are evil :(". My only point was that one should never use such GUIDs for new statements. Returning an error seems better than just creating a new GUID, but both would work. Mainly, we should not use externally provided GUIDs. For example, if somebody is mistaken to believe that any string of the proper format can be used, then we might get bot code where the "GUID" is based on a constant. Wikibase should better make sure that it uses quality GUIDs, which are as random as a GUID is supposed to be.
Markus
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
-- Tobi Gritschacher Software Developer - Wikidata - http://www.wikidata.org
Imagine a world, in which every single human being can freely share in the sum of all knowledge. That's our commitment.
Wikimedia Deutschland e.V. | Tempelhofer Ufer 23-24 | 10963 Berlin Phone +49 (0)30 219 158 260
http://wikimedia.de http://www.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/681/51985.
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
Hey,
* we introduce a new optional parameter "id"
- if a guid is set inside the claim serialization, change that claim if it
exists and return an error if that claim is unknown.
- if no guid is set in the claim serialization, create a new claim for the
entity identified by the new parameter "id". if "id" is not set, return an error.
This is fine for me - barring naming nitpicks and whatnot.
Cheers
-- Jeroen De Dauw http://www.bn2vs.com Don't panic. Don't be evil. ~=[,,_,,]:3 --
Couldn't an alternative to be deprecate and get rid of wbsetclaim as you can do everything it can do and more through wbeditentity with little more knowledge of the serialization format..
i.e. in wbsetclaim I enter:
{"mainsnak":{"snaktype":"value","property":"P56","datavalue":{"value":"ExampleString","type":"string"}},"type":"statement","rank":"normal"}
in wbeditentity I have to enter:
{"claims":[{"mainsnak":{"snaktype":"value","property":"P56","datavalue":{"value":"ExampleString","type":"string"}},"type":"statement","rank":"normal"}]}
I am sure people could cope with that..?
This would also mean getting rid of 200 lines of codes and 299 lines of tests that in my eyes are not really needed.
Addshore
On 26 February 2014 22:26, Jeroen De Dauw jeroendedauw@gmail.com wrote:
Hey,
- we introduce a new optional parameter "id"
- if a guid is set inside the claim serialization, change that claim if
it exists and return an error if that claim is unknown.
- if no guid is set in the claim serialization, create a new claim for
the entity identified by the new parameter "id". if "id" is not set, return an error.
This is fine for me - barring naming nitpicks and whatnot.
Cheers
-- Jeroen De Dauw http://www.bn2vs.com Don't panic. Don't be evil. ~=[,,_,,]:3 --
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
Am 26.02.2014 22:59, schrieb addshorewiki:
Couldn't an alternative to be deprecate and get rid of wbsetclaim as you can do everything it can do and more through wbeditentity with little more knowledge of the serialization format..
If so, we should get rid of *all* the editing modules, and do everything through editentity. I think when we last discussed this, we decided to keep the more specific modules because they are better "verbs" in the REST sense. They could perhaps be re-implemented as a think layer on top of editentity. Since all of them use ChangeOps by now, we wouldn't gain terribly much, i guess.
-- daniel
Hey,
Couldn't an alternative to be deprecate and get rid of wbsetclaim as you can do
everything it can do and more through wbeditentity with little more
knowledge of
the serialization format..
If so, we should get rid of *all* the editing modules
Damn, seems I was to late to have addshore assassinated, and now this discussion is starting again. The end is near!
I think when we last discussed this, we decided to keep the more specific
modules because they are better "verbs" in the REST sense.
AFAIK this was because we want fine grained actions and interfaces for them, not because of similarity to HTTP vebs. (I see what you are getting at, though think HTTP verbs are a bad example here.)
They could
perhaps be re-implemented as a think layer on top of editentity. Since all of them use ChangeOps by now, we wouldn't gain terribly much, i guess.
Agree, there should not be much of a difference. And if there is, the solution lies with fixing the code, not changing the web API.
At the same time I agree with addshore that there is some cost in maintaining this code, though if this little glue code is all that is needed to provide a feature that is actually in demand, I think we can all agree on it being well worth the maintenance.
Cheers
-- Jeroen De Dauw http://www.bn2vs.com Don't panic. Don't be evil. ~=[,,_,,]:3 --
wikidata-tech@lists.wikimedia.org