This package has been deprecated

Author message:

Use wikibase-sdk with fetch instead

wikidata-sdk-got
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

wikidata-sdk-got

NPM Version node Dependency Status Peer Dependency Status Dev Dependency Status

Run wikidata-sdk requests from NodeJS without handling urls

When working with Wikidata you can use maxlath/wikidata-sdk. In order to stay small and useable on all platforms wikidata-sdk does not do requests on its own.

Why not use sindresorhus/got for it? As the code is the same all the time, this can be abstracted as it is done here 😎

Install

$ npm install wikidata-sdk wikidata-sdk-got

Usage

const wdkGot = require('wikidata-sdk-got');

await wdkGot.sparqlQuerySimplifiedMinified('SELECT * WHERE { ?item wdt:P50 wd:Q42. } LIMIT 3');
//=> ['Q721', 'Q25169', 'Q187655']
import * as wdkGot from 'wikidata-sdk-got';

await wdkGot.sparqlQuerySimplifiedMinified('SELECT * WHERE { ?item wdt:P50 wd:Q42. } LIMIT 3');
//=> ['Q721', 'Q25169', 'Q187655']

API

Check out maxlath/wikidata-sdk in general.

Not everything is present yet. Open an Issue or Pull Request in order to add whats missing.

getEntities(options, [gotOptions])

getEntitiesSimplified(options, [gotOptions])

Different methods for different simplification levels.

options

See wikidata-sdk Docs

gotOptions

Type: Object

See sindresorhus/got for this one.

Consider Caching.

searchEntities(options, [gotOptions])

options

See wikidata-sdk Docs

gotOptions

Type: Object

See sindresorhus/got for this one.

Consider Caching.

sparqlQuery(query, [gotOptions])

sparqlQuerySimplified(query, [gotOptions])

sparqlQuerySimplifiedMinified(query, [gotOptions])

Different methods for different simplification levels.

query

Type: string

SparQL Query to be run.

gotOptions

Type: Object

See sindresorhus/got for this one.

Consider Caching.

Readme

Keywords

Package Sidebar

Install

npm i wikidata-sdk-got

Weekly Downloads

8

Version

2.1.0

License

MIT

Unpacked Size

11.1 kB

Total Files

7

Last publish

Collaborators

  • edjopato