Module: WikidataAdaptor::RestApi::Properties
- Included in:
- WikidataAdaptor::RestApi
- Defined in:
- lib/wikidata_adaptor/rest_api/properties.rb
Overview
Instance Method Summary collapse
-
#get_property(property_id) ⇒ Hash
Retrieve a single Wikibase Property by ID.
-
#patch_property(property_id, payload) ⇒ Hash
Apply JSON Patch operations to a Property.
-
#post_property(payload) ⇒ Hash
Create a Wikibase Property.
Instance Method Details
#get_property(property_id) ⇒ Hash
Retrieve a single Wikibase Property by ID.
12 13 14 |
# File 'lib/wikidata_adaptor/rest_api/properties.rb', line 12 def get_property(property_id) get_json("#{endpoint}/v1/entities/properties/#{CGI.escape(property_id)}") end |
#patch_property(property_id, payload) ⇒ Hash
Apply JSON Patch operations to a Property.
31 32 33 |
# File 'lib/wikidata_adaptor/rest_api/properties.rb', line 31 def patch_property(property_id, payload) patch_json("#{endpoint}/v1/entities/properties/#{CGI.escape(property_id)}", payload) end |
#post_property(payload) ⇒ Hash
Create a Wikibase Property.
21 22 23 |
# File 'lib/wikidata_adaptor/rest_api/properties.rb', line 21 def post_property(payload) post_json("#{endpoint}/v1/entities/properties", payload) end |