Git Product home page Git Product logo

wikidataapigem's Introduction

Wikidata API Gem

Build Status

A library for interacting with the Wikidata API from Ruby. Extends the MediaWiki API Gem.

Installation

Add this line to your application's Gemfile:

gem 'mediawiki_api-wikidata'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mediawiki_api-wikidata

Usage

require "mediawiki_api/wikidata"

wikidata_client = MediawikiApi::Wikidata::WikidataClient.new "http://127.0.0.1/w/api.php" #instantiate new client
wikidata_client.log_in "username", "password" #log in via the API
wikidata_client.create_item "data" #create a new item specified by "data"
wikidata_client.create_property "data" #create a new property specified by "data"
wikidata_client.add_sitelink "Q1234", "enwiki", "Berlin" #add a new sitelink enwiki/Berlin to item Q1234
wikidata_client.remove_sitelink "Q1234", "enwiki" #remove enwiki sitelink from item Q1234
wikidata_client.sitelink_exists? "enwiki", "Berlin" #returns true if enwiki/Berlin sitelink exists, false otherwise
wikidata_client.create_claim "Q1234", "value", "P1234", '"test"' #adds claim with property P1234 and value "test" to item Q1234
wikidata_client.search_entities "test", "en", "item" #searches for items containing the string "test" in their english labels, descriptions and aliases

Release notes

0.3.0 (2021-06-08)

  • Compatible with mediawiki_api 7.0
  • Compatible with Ruby 2.5
  • Support for several API actions.

0.2.1 (2016-05-26)

0.2.0 (2015-10-09)

0.1.0 (2014-10-09)

0.0.2 (2014-10-09)

  • Support adding sitelinks
  • Support changing sitelinks
  • Support removing sitelinks
  • Support checking for existing sitelinks
  • Provide separate methods for creating items and properties
  • Removed custom edit summaries

0.0.1 (2014-09-29)

  • Initial version
  • Supports creation of entities via wbeditentity

wikidataapigem's People

Contributors

tobijat avatar tgr avatar ladsgroup avatar manicki avatar takahashim avatar mariushoch avatar thiemowmde avatar addshore avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.