Module: WikidataAdaptor::RestApi::Aliases
- Included in:
- WikidataAdaptor::RestApi
- Defined in:
- lib/wikidata_adaptor/rest_api/aliases.rb
Overview
Instance Method Summary collapse
-
#get_item_alias(item_id, lang_code) ⇒ Array<String>
Retrieve an Item's alias in a specific language.
-
#get_item_aliases(item_id) ⇒ Hash
Retrieve an Item's aliases.
-
#get_property_alias(property_id, lang_code) ⇒ Array<String>
Retrieve a Property's aliases in a specific language.
-
#get_property_aliases(property_id) ⇒ Hash
Retrieve a Property's aliases.
-
#patch_item_aliases(item_id, payload) ⇒ Hash
Apply JSON Patch operations to an Item's aliases.
-
#patch_property_aliases(property_id, payload) ⇒ Hash
Apply JSON Patch operations to a Property's aliases.
-
#post_item_aliases(item_id, lang_code, payload) ⇒ Array<String>
Add aliases to an Item in a specific language.
-
#post_property_aliases(property_id, lang_code, payload) ⇒ Array<String>
Add aliases to a Property in a specific language.
Instance Method Details
#get_item_alias(item_id, lang_code) ⇒ Array<String>
Retrieve an Item's alias in a specific language.
22 23 24 |
# File 'lib/wikidata_adaptor/rest_api/aliases.rb', line 22 def get_item_alias(item_id, lang_code) get_json("#{endpoint}/v1/entities/items/#{CGI.escape(item_id)}/aliases/#{lang_code}") end |
#get_item_aliases(item_id) ⇒ Hash
Retrieve an Item's aliases.
12 13 14 |
# File 'lib/wikidata_adaptor/rest_api/aliases.rb', line 12 def get_item_aliases(item_id) get_json("#{endpoint}/v1/entities/items/#{CGI.escape(item_id)}/aliases") end |
#get_property_alias(property_id, lang_code) ⇒ Array<String>
Retrieve a Property's aliases in a specific language.
52 53 54 |
# File 'lib/wikidata_adaptor/rest_api/aliases.rb', line 52 def get_property_alias(property_id, lang_code) get_json("#{endpoint}/v1/entities/properties/#{CGI.escape(property_id)}/aliases/#{lang_code}") end |
#get_property_aliases(property_id) ⇒ Hash
Retrieve a Property's aliases.
42 43 44 |
# File 'lib/wikidata_adaptor/rest_api/aliases.rb', line 42 def get_property_aliases(property_id) get_json("#{endpoint}/v1/entities/properties/#{CGI.escape(property_id)}/aliases") end |
#patch_item_aliases(item_id, payload) ⇒ Hash
Apply JSON Patch operations to an Item's aliases.
73 74 75 |
# File 'lib/wikidata_adaptor/rest_api/aliases.rb', line 73 def patch_item_aliases(item_id, payload) patch_json("#{endpoint}/v1/entities/items/#{CGI.escape(item_id)}/aliases", payload) end |
#patch_property_aliases(property_id, payload) ⇒ Hash
Apply JSON Patch operations to a Property's aliases.
83 84 85 |
# File 'lib/wikidata_adaptor/rest_api/aliases.rb', line 83 def patch_property_aliases(property_id, payload) patch_json("#{endpoint}/v1/entities/properties/#{CGI.escape(property_id)}/aliases", payload) end |
#post_item_aliases(item_id, lang_code, payload) ⇒ Array<String>
Add aliases to an Item in a specific language.
33 34 35 |
# File 'lib/wikidata_adaptor/rest_api/aliases.rb', line 33 def post_item_aliases(item_id, lang_code, payload) post_json("#{endpoint}/v1/entities/items/#{CGI.escape(item_id)}/aliases/#{lang_code}", payload) end |
#post_property_aliases(property_id, lang_code, payload) ⇒ Array<String>
Add aliases to a Property in a specific language.
63 64 65 |
# File 'lib/wikidata_adaptor/rest_api/aliases.rb', line 63 def post_property_aliases(property_id, lang_code, payload) post_json("#{endpoint}/v1/entities/properties/#{CGI.escape(property_id)}/aliases/#{lang_code}", payload) end |