All Projects → maxlath → Wikibase Sdk

maxlath / Wikibase Sdk

Licence: mit
JS utils functions to query a Wikibase instance and simplify its results

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Wikibase Sdk

Fredr
An R client for the Federal Reserve Economic Data (FRED) API
Stars: ✭ 61 (-75.7%)
Mutual labels:  api, data
Core
Open source Dota 2 data platform
Stars: ✭ 1,266 (+404.38%)
Mutual labels:  api, data
Covid19
JSON time-series of coronavirus cases (confirmed, deaths and recovered) per country - updated daily
Stars: ✭ 1,177 (+368.92%)
Mutual labels:  api, data
Mundaneum
A clojure wrapper around WikiData
Stars: ✭ 54 (-78.49%)
Mutual labels:  wikidata, sparql
Apis
Making data readily available to anyone interested
Stars: ✭ 143 (-43.03%)
Mutual labels:  api, data
Rtimes
R wrapper for NYTimes API for government data - ABANDONED
Stars: ✭ 55 (-78.09%)
Mutual labels:  api, data
Zhihu Oauth
尝试解析出知乎官方未开放的 OAuth2 接口,并提供优雅的使用方式,作为 zhihu-py3 项目的替代者,目前还在实验阶段
Stars: ✭ 1,237 (+392.83%)
Mutual labels:  api, data
Ckan
CKAN is an open-source DMS (data management system) for powering data hubs and data portals. CKAN makes it easy to publish, share and use data. It powers catalog.data.gov, open.canada.ca/data, data.humdata.org among many other sites.
Stars: ✭ 3,223 (+1184.06%)
Mutual labels:  api, data
Reddit Detective
Play detective on Reddit: Discover political disinformation campaigns, secret influencers and more
Stars: ✭ 129 (-48.61%)
Mutual labels:  api, data
Scholia
Wikidata scholarly profiles
Stars: ✭ 115 (-54.18%)
Mutual labels:  wikidata, sparql
Generator Http Fake Backend
Yeoman generator for building a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 49 (-80.48%)
Mutual labels:  api, data
Pygeoapi
pygeoapi is a Python server implementation of the OGC API suite of standards. The project emerged as part of the next generation OGC API efforts in 2018 and provides the capability for organizations to deploy a RESTful OGC API endpoint using OpenAPI, GeoJSON, and HTML. pygeoapi is open source and released under an MIT license.
Stars: ✭ 178 (-29.08%)
Mutual labels:  api, data
Octo Cli
CLI tool to expose data from any database as a serverless web service.
Stars: ✭ 653 (+160.16%)
Mutual labels:  api, data
Openrefine
OpenRefine is a free, open source power tool for working with messy data and improving it
Stars: ✭ 8,531 (+3298.8%)
Mutual labels:  wikidata, data
React Refetch
A simple, declarative, and composable way to fetch data for React components
Stars: ✭ 3,418 (+1261.75%)
Mutual labels:  api, data
Hydrogen
🎈 Hydrogen. Voted (by me) the world's lightest static-site generator built with TypeScript ❤ It uses 🔥 lit-html inspired templating for super duper performant template generation.
Stars: ✭ 80 (-68.13%)
Mutual labels:  api, data
SPARQL
Lib PHP for SPARQL 1.1
Stars: ✭ 23 (-90.84%)
Mutual labels:  sparql, wikidata
WikidataQueryServiceR
An R package for the Wikidata Query Service API
Stars: ✭ 23 (-90.84%)
Mutual labels:  sparql, wikidata
Rgbif
Interface to the Global Biodiversity Information Facility API
Stars: ✭ 113 (-54.98%)
Mutual labels:  api, data
Ncov2019 data crawler
疫情数据爬虫,2019新型冠状病毒数据仓库,轨迹数据,同乘数据,报道
Stars: ✭ 175 (-30.28%)
Mutual labels:  api, data

wikibase-sdk

JS utils functions to query a Wikibase instance and simplify its results

This package was primarily developed as wikidata-sdk but has now being generalized to support any Wikibase instance: wikidata.org among others.

This project received a Wikimedia Project Grant.

wikibase           wikidata

NPM NPM

License Node JavaScript Style Guide

Summary

Changelog

See CHANGELOG.md for version info

Dependencies

This module uses JavaScript ES6, which means NodeJS >= v6.4.0 or not too outdated web browsers.

For older version, you can use ES5 bundles.

Install

as a module

Install via npm to be able to use the module with require (CommonJS) or import (ES6 Modules)

npm install wikibase-sdk

Then in your javascript:

const WBK = require('wikibase-sdk')
const wbk = WBK({
  instance: 'https://my-wikibase-instan.se',
  sparqlEndpoint: 'https://query.my-wikibase-instan.se/sparql'
})

The wdk object of previous versions of this documentation - from the time this module was bound to wikidata.org only - thus corresponds to the following:

const WBK = require('wikibase-sdk')
const wdk = WBK({
  instance: 'https://www.wikidata.org',
  sparqlEndpoint: 'https://query.wikidata.org/sparql'
})

For convenience, and for the sake of retro-compatibility, that same wdk object can be obtain with:

// After having run `npm install wikidata-sdk`
const wdk = require('wikidata-sdk')

and instance-independant helper functions are directly available from the module root:

const { simplify, parse, isEntityId, isPropertyId, ... } = require('wikibase-sdk')

download pre-bundled files

If you just want to import the lib from an HTML file and don't have a setup that can import with CommonJS or ES6 Modules, you can simply download those pre-bundled files:

wget https://raw.githubusercontent.com/maxlath/wikibase-sdk/dist/dist/wikibase-sdk.js
wget https://raw.githubusercontent.com/maxlath/wikibase-sdk/dist/dist/wikidata-sdk.js
wget https://raw.githubusercontent.com/maxlath/wikibase-sdk/dist/dist/wikibase-sdk.min.js
wget https://raw.githubusercontent.com/maxlath/wikibase-sdk/dist/dist/wikidata-sdk.min.js

then you can import it in your html:

<script src="/path/to/wikibase-sdk.js"></script>
<script>console.log('can access WBK', WBK)</script>
<script src="/path/to/wikidata-sdk.js"></script>
<script>console.log('can access wdk, the wikidata.org bound product of WBK', wdk)</script>

Features

Wikibase API

A set of functions to make read queries to a Wikibase instance API (see Wikidata API documentation). For write operations, see wikibase-edit.

Wikibase Query

There are additional functions for Wikibase instances that have a SPARQL Query Service (such as Wikidata Query for wikidata.org). SPARQL can be a weird thing at first, but the Wikidata team and community really puts lots of efforts to make things easy with a super rich Wikidata Query Help page, an awesome tool to test you queries and visualize the result, and lots of examples!

General helpers

Contributing

Context

This library had for primary purpose to serve the needs of the inventaire project but extending its capabilities to other needs it totally possible: feel welcome to post your suggestions as issues or pull requests!

Design constraints

  • wikibase-sdk should stay "small" and dependency-free, so that a web application can include it in its bundle without paying a too high cost for it. A consequence is that the lib generates URLs where other libs would integrate doing the request and parsing it's response. But that actually feels quite right to do this way: simply generating the URLs let's users free to handle requests as they like (with callbacks, promises, async/await, whatever!)
  • Therefore, it should focus on providing basic, general helper functions most application working with a Wikibase instance would need.
  • Write operations should go into wikibase-edit as it involves working with Wikibase credentials/tokens.
  • General command-line interface tools should go to wikibase-cli, very specific ones — wikidata-filter, import-wikidata-dump-to-couchdb, and alikes — should get their own modules.

Donate

We are developing and maintaining tools to work with Wikidata from NodeJS, the browser, or simply the command line, with quality and ease of use at heart. Any donation will be interpreted as a "please keep going, your work is very much needed and awesome. PS: love". Donate

See Also

You may also like

inventaire banner

Do you know Inventaire? It's a web app to share books with your friends, built on top of Wikidata! And its libre software too.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].