Module: WikidataAdaptor::RestApi::SearchProperty
- Included in:
- WikidataAdaptor::RestApi
- Defined in:
- lib/wikidata_adaptor/rest_api/search_property.rb
Overview
Instance Method Summary collapse
-
#search_properties(query, lang, limit: 10, offset: 0) ⇒ Hash
Simple Property search by label and aliases.
-
#suggest_properties(query, lang, limit: 10, offset: 0) ⇒ Hash
Simple Property search by prefix, for labels and aliases.
Instance Method Details
#search_properties(query, lang, limit: 10, offset: 0) ⇒ Hash
Simple Property search by label and aliases
15 16 17 18 19 20 21 22 23 |
# File 'lib/wikidata_adaptor/rest_api/search_property.rb', line 15 def search_properties(query, lang, limit: 10, offset: 0) params = { q: query, lang: lang, limit: limit, offset: offset } get_json("#{endpoint}/v0/search/properties", params: params) end |
#suggest_properties(query, lang, limit: 10, offset: 0) ⇒ Hash
Simple Property search by prefix, for labels and aliases
33 34 35 36 37 38 39 40 41 |
# File 'lib/wikidata_adaptor/rest_api/search_property.rb', line 33 def suggest_properties(query, lang, limit: 10, offset: 0) params = { q: query, lang: lang, limit: limit, offset: offset } get_json("#{endpoint}/v0/suggest/properties", params: params) end |