class Wikidata::Item
Constants
- DEFAULT_QUERIES
Public Class Methods
_find(finder = :ids, list = '', query = {})
click to toggle source
# File lib/wikidata/item.rb, line 25 def _find finder = :ids, list = '', query = {} q = DEFAULT_QUERIES[:find] .merge( query ) .merge( finder => Array(list).join('|') ) Wikidata::Client.new( q ).response.tap do |resp| return resp.results.first unless list.is_a?(Array) end end
find(ids, query = {})
click to toggle source
# File lib/wikidata/item.rb, line 17 def find ids, query = {} _find :ids, ids, query end
find_by_title(titles, query = {})
click to toggle source
# File lib/wikidata/item.rb, line 21 def find_by_title titles, query = {} _find :titles, titles, query end
search(search, query = {})
click to toggle source
# File lib/wikidata/item.rb, line 34 def search search, query = {} q = DEFAULT_QUERIES[:search].merge( srsearch: search ).merge(query) Wikidata::Client.new( q ).response end