Addshore has uploaded a new change for review. https://gerrit.wikimedia.org/r/82262
Change subject: Uppercase Api Examples ...................................................................... Uppercase Api Examples As EntityId now will set things with uppercase we should reflect this in all of our examples. Everything will still accept bother upper and lower case. Change-Id: I7d58eb154257c49be30cd17e105a2428549328ea --- M repo/includes/api/CreateClaim.php M repo/includes/api/EditEntity.php M repo/includes/api/GetClaims.php M repo/includes/api/GetEntities.php M repo/includes/api/RemoveClaims.php M repo/includes/api/RemoveQualifiers.php M repo/includes/api/RemoveReferences.php M repo/includes/api/SetAliases.php M repo/includes/api/SetClaim.php M repo/includes/api/SetClaimValue.php M repo/includes/api/SetDescription.php M repo/includes/api/SetQualifier.php M repo/includes/api/SetReference.php M repo/includes/api/SetStatementRank.php 14 files changed, 51 insertions(+), 51 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/62/82262/1 diff --git a/repo/includes/api/CreateClaim.php b/repo/includes/api/CreateClaim.php index cd6ee90..3c4375e 100644 --- a/repo/includes/api/CreateClaim.php +++ b/repo/includes/api/CreateClaim.php @@ -159,14 +159,14 @@ */ protected function getExamples() { return array( - 'api.php?action=wbcreateclaim&entity=q42&property=p9001&snaktype=novalue' - =>'Creates a claim for item q42 of property p9001 with a novalue snak.', - 'api.php?action=wbcreateclaim&entity=q42&property=p9002&snaktype=value&value="itsastring"' - => ' Creates a claim for item q42 of property p9002 with string value "itsastring"', - 'api.php?action=wbcreateclaim&entity=q42&property=p9003&snaktype=value&value={"entity-type":"item","numeric-id":1}' - => 'Creates a claim for item q42 of property p9003 with a value of item q1', - 'api.php?action=wbcreateclaim&entity=q42&property=p9004&snaktype=value&value={"latitude":40.748433,"longitude":-73.985656,"globe":"http://www.wikidata.org/entity/Q2"}' - => 'Creates a claim for item q42 of property p9004 with a coordinate snak value', + 'api.php?action=wbcreateclaim&entity=Q42&property=P9001&snaktype=novalue' + =>'Creates a claim for item Q42 of property P9001 with a novalue snak.', + 'api.php?action=wbcreateclaim&entity=Q42&property=P9002&snaktype=value&value="itsastring"' + => ' Creates a claim for item Q42 of property P9002 with string value "itsastring"', + 'api.php?action=wbcreateclaim&entity=Q42&property=P9003&snaktype=value&value={"entity-type":"item","numeric-id":1}' + => 'Creates a claim for item Q42 of property P9003 with a value of item Q1', + 'api.php?action=wbcreateclaim&entity=Q42&property=P9004&snaktype=value&value={"latitude":40.748433,"longitude":-73.985656,"globe":"http://www.wikidata.org/entity/Q2"}' + => 'Creates a claim for item Q42 of property P9004 with a coordinate snak value', ); } } diff --git a/repo/includes/api/EditEntity.php b/repo/includes/api/EditEntity.php index b81826d..321dbd8 100644 --- a/repo/includes/api/EditEntity.php +++ b/repo/includes/api/EditEntity.php @@ -506,13 +506,13 @@ return array( 'api.php?action=wbeditentity&new=item&data={}' => 'Create a new empty item, returns extended with the item structure', - 'api.php?action=wbeditentity&clear=true&id=q42&data={}' - => 'Clear item with id q42', + 'api.php?action=wbeditentity&clear=true&id=Q42&data={}' + => 'Clear item with id Q42', 'api.php?action=wbeditentity&new=item&data={"labels":{"de":{"language":"de","value":"de-value"},"en":{"language":"en","value":"en-value"}}}' => 'Create a new item and set labels for de and en', 'api.php?action=wbeditentity&new=property&data={"labels":{"en-gb":{"language":"en-gb","value":"Propertylabel"}},"descriptions":{"en-gb":{"language":"en-gb","value":"Propertydescription"}},"datatype":"string"}' => 'Create a new property containing the json data, returns extended with the item structure', - 'api.php?action=wbeditentity&id=q42&data={"sitelinks":{"nowiki":{"site":"nowiki","title":"København"}}}' + 'api.php?action=wbeditentity&id=Q42&data={"sitelinks":{"nowiki":{"site":"nowiki","title":"København"}}}' => 'Sets sitelink for nowiki, overwriting it if it already exists', ); } diff --git a/repo/includes/api/GetClaims.php b/repo/includes/api/GetClaims.php index 8d2f525..d7cd810 100644 --- a/repo/includes/api/GetClaims.php +++ b/repo/includes/api/GetClaims.php @@ -307,10 +307,10 @@ */ protected function getExamples() { return array( - "api.php?action=wbgetclaims&entity=q42" => "Get claims for item with ID q42", - "api.php?action=wbgetclaims&entity=q42&property=p2" => "Get claims for item with ID q42 and property with ID p2", - "api.php?action=wbgetclaims&entity=q42&rank=normal" => "Get claims for item with ID q42 that are ranked as normal", - 'api.php?action=wbgetclaims&claim=q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F' => 'Get claim with GUID of q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F', + "api.php?action=wbgetclaims&entity=Q42" => "Get claims for item with ID Q42", + "api.php?action=wbgetclaims&entity=Q42&property=P2" => "Get claims for item with ID Q42 and property with ID P2", + "api.php?action=wbgetclaims&entity=Q42&rank=normal" => "Get claims for item with ID Q42 that are ranked as normal", + 'api.php?action=wbgetclaims&claim=Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F' => 'Get claim with GUID of Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F', ); } diff --git a/repo/includes/api/GetEntities.php b/repo/includes/api/GetEntities.php index f0f3bd8..6bd366f 100644 --- a/repo/includes/api/GetEntities.php +++ b/repo/includes/api/GetEntities.php @@ -335,22 +335,22 @@ */ protected function getExamples() { return array( - "api.php?action=wbgetentities&ids=q42" - => "Get entity with ID q42 with all available attributes in all available languages", - "api.php?action=wbgetentities&ids=p2" - => "Get entity with ID p2 with all available attributes in all available languages", - "api.php?action=wbgetentities&ids=q42|p2" - => "Get entities with IDs q42 and p2 with all available attributes in all available languages", - "api.php?action=wbgetentities&ids=q42&languages=en" - => "Get entity with ID q42 with all available attributes in English language", - "api.php?action=wbgetentities&ids=q42&props=labels" - => "Get entity with ID q42 showing all labels in all available languages", - "api.php?action=wbgetentities&ids=p2|p3&props=datatype" - => "Get entities with IDs p2 and p3 showing only datatypes", - "api.php?action=wbgetentities&ids=q42&props=aliases&languages=en" - => "Get entity with ID q42 showing all aliases in English language", - "api.php?action=wbgetentities&ids=q1|q42&props=descriptions&languages=en|de|fr" - => "Get entities with IDs q1 and q42 showing descriptions in English, German and French languages", + "api.php?action=wbgetentities&ids=Q42" + => "Get entity with ID Q42 with all available attributes in all available languages", + "api.php?action=wbgetentities&ids=P2" + => "Get entity with ID P2 with all available attributes in all available languages", + "api.php?action=wbgetentities&ids=Q42|P2" + => "Get entities with IDs Q42 and p2 with all available attributes in all available languages", + "api.php?action=wbgetentities&ids=Q42&languages=en" + => "Get entity with ID Q42 with all available attributes in English language", + "api.php?action=wbgetentities&ids=Q42&props=labels" + => "Get entity with ID Q42 showing all labels in all available languages", + "api.php?action=wbgetentities&ids=P2|P3&props=datatype" + => "Get entities with IDs P2 and P3 showing only datatypes", + "api.php?action=wbgetentities&ids=Q42&props=aliases&languages=en" + => "Get entity with ID Q42 showing all aliases in English language", + "api.php?action=wbgetentities&ids=Q1|Q42&props=descriptions&languages=en|de|fr" + => "Get entities with IDs Q1 and Q42 showing descriptions in English, German and French languages", 'api.php?action=wbgetentities&sites=enwiki&titles=Berlin&languages=en' => 'Get the item for page "Berlin" on the site "enwiki", with language attributes in English language', 'api.php?action=wbgetentities&sites=enwiki&titles=berlin&normalize=' diff --git a/repo/includes/api/RemoveClaims.php b/repo/includes/api/RemoveClaims.php index 5233362..7075a83 100644 --- a/repo/includes/api/RemoveClaims.php +++ b/repo/includes/api/RemoveClaims.php @@ -222,7 +222,7 @@ */ protected function getExamples() { return array( - 'api.php?action=wbremoveclaims&claim=q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0N&token=foobar&baserevid=7201010' => 'Remove claim with GUID of "q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0N"', + 'api.php?action=wbremoveclaims&claim=Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0N&token=foobar&baserevid=7201010' => 'Remove claim with GUID of "Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0N"', ); } diff --git a/repo/includes/api/RemoveQualifiers.php b/repo/includes/api/RemoveQualifiers.php index 10f49a8..b8e907a 100644 --- a/repo/includes/api/RemoveQualifiers.php +++ b/repo/includes/api/RemoveQualifiers.php @@ -206,7 +206,7 @@ */ protected function getExamples() { return array( - 'api.php?action=wbremovequalifiers&statement=q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F&references=1eb8793c002b1d9820c833d234a1b54c8e94187e&token=foobar&baserevid=7201010' => 'Remove qualifier with hash "1eb8793c002b1d9820c833d234a1b54c8e94187e" from claim with GUID of "q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F"', + 'api.php?action=wbremovequalifiers&statement=Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F&references=1eb8793c002b1d9820c833d234a1b54c8e94187e&token=foobar&baserevid=7201010' => 'Remove qualifier with hash "1eb8793c002b1d9820c833d234a1b54c8e94187e" from claim with GUID of "Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F"', ); } } diff --git a/repo/includes/api/RemoveReferences.php b/repo/includes/api/RemoveReferences.php index 3a6551e..dfaa150 100644 --- a/repo/includes/api/RemoveReferences.php +++ b/repo/includes/api/RemoveReferences.php @@ -211,7 +211,7 @@ */ protected function getExamples() { return array( - 'api.php?action=wbremovereferences&statement=q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F&references=455481eeac76e6a8af71a6b493c073d54788e7e9&token=foobar&baserevid=7201010' => 'Remove reference with hash "455481eeac76e6a8af71a6b493c073d54788e7e9" from claim with GUID of "q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F"', + 'api.php?action=wbremovereferences&statement=Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F&references=455481eeac76e6a8af71a6b493c073d54788e7e9&token=foobar&baserevid=7201010' => 'Remove reference with hash "455481eeac76e6a8af71a6b493c073d54788e7e9" from claim with GUID of "Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F"', ); } } diff --git a/repo/includes/api/SetAliases.php b/repo/includes/api/SetAliases.php index 9232c42..b1da80a 100644 --- a/repo/includes/api/SetAliases.php +++ b/repo/includes/api/SetAliases.php @@ -235,17 +235,17 @@ */ protected function getExamples() { return array( - 'api.php?action=wbsetaliases&language=en&id=q1&set=Foo|Bar' - => 'Set the English aliases for the entity with id q1 to Foo and Bar', + 'api.php?action=wbsetaliases&language=en&id=Q1&set=Foo|Bar' + => 'Set the English aliases for the entity with id Q1 to Foo and Bar', - 'api.php?action=wbsetaliases&language=en&id=q1&add=Foo|Bar' - => 'Add Foo and Bar to the list of English aliases for the entity with id q1', + 'api.php?action=wbsetaliases&language=en&id=Q1&add=Foo|Bar' + => 'Add Foo and Bar to the list of English aliases for the entity with id Q1', - 'api.php?action=wbsetaliases&language=en&id=q1&remove=Foo|Bar' - => 'Remove Foo and Bar from the list of English aliases for the entity with id q1', + 'api.php?action=wbsetaliases&language=en&id=Q1&remove=Foo|Bar' + => 'Remove Foo and Bar from the list of English aliases for the entity with id Q1', - 'api.php?action=wbsetaliases&language=en&id=q1&remove=Foo&add=Bar' - => 'Remove Foo from the list of English aliases for the entity with id q1 while adding Bar to it', + 'api.php?action=wbsetaliases&language=en&id=Q1&remove=Foo&add=Bar' + => 'Remove Foo from the list of English aliases for the entity with id Q1 while adding Bar to it', ); } diff --git a/repo/includes/api/SetClaim.php b/repo/includes/api/SetClaim.php index 2901c58..3b09813 100644 --- a/repo/includes/api/SetClaim.php +++ b/repo/includes/api/SetClaim.php @@ -238,8 +238,8 @@ */ protected function getExamples() { return array( - 'api.php?action=wbsetclaim&claim={"id":"q2$5627445f-43cb-ed6d-3adb-760e85bd17ee","type":"claim","mainsnak":{"snaktype":"value","property":"p1","datavalue":{"value":"City","type":"string"}}}' - => 'Set the claim with the given id to property p1 with a string value of "City', + 'api.php?action=wbsetclaim&claim={"id":"Q2$5627445f-43cb-ed6d-3adb-760e85bd17ee","type":"claim","mainsnak":{"snaktype":"value","property":"P1","datavalue":{"value":"City","type":"string"}}}' + => 'Set the claim with the given id to property P1 with a string value of "City', ); } diff --git a/repo/includes/api/SetClaimValue.php b/repo/includes/api/SetClaimValue.php index b845760..d126f87 100644 --- a/repo/includes/api/SetClaimValue.php +++ b/repo/includes/api/SetClaimValue.php @@ -155,7 +155,7 @@ */ protected function getExamples() { return array( - 'api.php?action=wbsetclaimvalue&claim=q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F&snaktype=value&value={"entity-type":"item","numeric-id":1}&token=foobar&baserevid=7201010' => 'Sets the claim with the GUID of q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F to a value of q1', + 'api.php?action=wbsetclaimvalue&claim=Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F&snaktype=value&value={"entity-type":"item","numeric-id":1}&token=foobar&baserevid=7201010' => 'Sets the claim with the GUID of Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F to a value of Q1', ); } } diff --git a/repo/includes/api/SetDescription.php b/repo/includes/api/SetDescription.php index c5aca4d..683a46b 100644 --- a/repo/includes/api/SetDescription.php +++ b/repo/includes/api/SetDescription.php @@ -107,9 +107,9 @@ protected function getExamples() { return array( 'api.php?action=wbsetdescription&id=Q42&language=en&value=An%20encyclopedia%20that%20everyone%20can%20edit' - => 'Set the string "An encyclopedia that everyone can edit" for page with id "Q42" as a decription in English language', + => 'Set the string "An encyclopedia that everyone can edit" for page with id "Q42" as a description in English language', 'api.php?action=wbsetdescription&site=enwiki&title=Wikipedia&language=en&value=An%20encyclopedia%20that%20everyone%20can%20edit' - => 'Set the string "An encyclopedia that everyone can edit" as a decription in English language for page with a sitelink to enwiki:Wikipedia', + => 'Set the string "An encyclopedia that everyone can edit" as a description in English language for page with a sitelink to enwiki:Wikipedia', ); } diff --git a/repo/includes/api/SetQualifier.php b/repo/includes/api/SetQualifier.php index 5b440b8..80a6100 100644 --- a/repo/includes/api/SetQualifier.php +++ b/repo/includes/api/SetQualifier.php @@ -228,7 +228,7 @@ */ protected function getExamples() { return array( - 'api.php?action=wbsetqualifier&claim=q2$4554c0f4-47b2-1cd9-2db9-aa270064c9f3&property=p1&value=GdyjxP8I6XB3&snaktype=value&token=foobar' => 'Set the qualifier for the given claim with property p1 to string value GdyjxP8I6XB3', + 'api.php?action=wbsetqualifier&claim=Q2$4554c0f4-47b2-1cd9-2db9-aa270064c9f3&property=P1&value=GdyjxP8I6XB3&snaktype=value&token=foobar' => 'Set the qualifier for the given claim with property P1 to string value GdyjxP8I6XB3', ); } } diff --git a/repo/includes/api/SetReference.php b/repo/includes/api/SetReference.php index 1d5780a..66ce0b7 100644 --- a/repo/includes/api/SetReference.php +++ b/repo/includes/api/SetReference.php @@ -281,8 +281,8 @@ */ protected function getExamples() { return array( - 'api.php?action=wbsetreference&statement=q76$D4FDE516-F20C-4154-ADCE-7C5B609DFDFF&snaks={"p39":[{"snaktype":"value","property":"p14","datavalue":{"type":"string","value":"wikipedia"}}}&baserevid=7201010&token=foobar' => 'Create a new reference for claim with GUID q76$D4FDE516-F20C-4154-ADCE-7C5B609DFDFF', - 'api.php?action=wbsetreference&statement=q76$D4FDE516-F20C-4154-ADCE-7C5B609DFDFF&reference=1eb8793c002b1d9820c833d234a1b54c8e94187e&snaks={"p39":[{"snaktype":"value","property":"p14","datavalue":{"type":"string","value":"wikipedia"}}}&baserevid=7201010&token=foobar' => 'Set reference for claim with GUID q76$D4FDE516-F20C-4154-ADCE-7C5B609DFDFF which has hash of 1eb8793c002b1d9820c833d234a1b54c8e94187e', + 'api.php?action=wbsetreference&statement=Q76$D4FDE516-F20C-4154-ADCE-7C5B609DFDFF&snaks={"P39":[{"snaktype":"value","property":"P14","datavalue":{"type":"string","value":"wikipedia"}}}&baserevid=7201010&token=foobar' => 'Create a new reference for claim with GUID Q76$D4FDE516-F20C-4154-ADCE-7C5B609DFDFF', + 'api.php?action=wbsetreference&statement=Q76$D4FDE516-F20C-4154-ADCE-7C5B609DFDFF&reference=1eb8793c002b1d9820c833d234a1b54c8e94187e&snaks={"P39":[{"snaktype":"value","property":"P14","datavalue":{"type":"string","value":"wikipedia"}}}&baserevid=7201010&token=foobar' => 'Set reference for claim with GUID Q76$D4FDE516-F20C-4154-ADCE-7C5B609DFDFF which has hash of 1eb8793c002b1d9820c833d234a1b54c8e94187e', ); } } diff --git a/repo/includes/api/SetStatementRank.php b/repo/includes/api/SetStatementRank.php index 18c7734..129c42f 100644 --- a/repo/includes/api/SetStatementRank.php +++ b/repo/includes/api/SetStatementRank.php @@ -184,7 +184,7 @@ */ protected function getExamples() { return array( - 'api.php?action=wbsetstatementrank&format=json&statement=q2$4554c0f4-47b2-1cd9-2db9-aa270064c9f3&rank=normal&token=foobar' => 'Set the rank for the given statement to normal', + 'api.php?action=wbsetstatementrank&format=json&statement=Q2$4554c0f4-47b2-1cd9-2db9-aa270064c9f3&rank=normal&token=foobar' => 'Set the rank for the given statement to normal', ); } } -- To view, visit https://gerrit.wikimedia.org/r/82262 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7d58eb154257c49be30cd17e105a2428549328ea Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Addshore <addshorew...@gmail.com> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits