versions follow SemVer
-
simplify.claims
: addminTimePrecision
option
-
simplify.claims
: add support forentity-schema
snak values
BREAKING CHANGES:
- remove the
minimize
option fromsimplifySparqlResults
: that behavior is now handled byminimizeSimplifiedSparqlResults
simplifyEntity
: add support for MediaInfo entity type
- export the
wikimediaLanguageCodes
array
BREAKING CHANGES:
wikibase-sdk
now uses ES modules: to keep using CommonJS, you will need to usewikibase-sdk <= v9
- Some functions that were accepting arguments as several arguments were changed to accept arguments as an object only. The concerned functions are:
getReverseClaims
:getReverseClaims('P50', 'Q535')
should be replaced bygetReverseClaims({ properties: 'P50', values: 'Q535' })
getRevisions
:getRevisions('Q3548931', { limit: 10 })
should be replaced bygetRevisions({ ids: 'Q3548931', { limit: 10 })
- Functions that were accepting arguments either as several arguments or as an object now only accept arguments as an object. The concerned functions are:
simplify.claims
,simplify.propertyClaims
, andsimplify.claim
legacy interfaces were dropped: options are now expected in a single option object (rather than as several arguments)- Functions previously avaialble on
wbk.parsers.wb
andwbk.parsers.wd
— namelyentities
andpagesTitles
— are now directly onwbk.parsers
Other changes:
- The source code was converted to TypeScript to recover types declarations, and keep them maintained in the future. This change was taken as an opportunity to do a bit of cleanup in the function interfaces.
- The convenience module
wikidata-sdk
has been deprecated. Thewdk
object can now be imported fromwikibase-sdk/wikidata.org
:import wdk from 'wikibase-sdk/wikidata.org'
- new
simplify.siteliks
option:keepBadges
BREAKING CHANGE: use URLSearchParams
in NodeJS, which only is available in NodeJS >= v10.0.0
cirrusSearchPages
: added support forsrprop
parameter
- new
simplify.claims
option:keepNonDeprecated
- Added
wgScriptPath
to the initialization parameters
- Added
isEntitySchemaId
- Added
simplify.references
function
- Added
cirrusSearchPages
function
getEntityIdFromGuid
: added support for hyphenated GUIDs
- Added function aliases:
simplify.snak = simplify.claim
simplify.propertySnaks = simplify.propertyClaims
simplify.snaks = simplify.claims
- Added
getEntityIdFromGuid
function
- Added
isPropertyClaimsId
function
- Added
isHash
function
simplify.entity
/simplify.entities
function: added support for Lexemes- Added
simplify.lemmas
function - Added
simplify.glosses
function - Added
simplify.form
function - Added
simplify.forms
function - Added
simplify.sense
function - Added
simplify.senses
function - Added
isFormId
function - Added
isSenseId
function
getRevisions
: added support forrvprops
,rvuser
,rvexcludeuser
, andrvtag
parameters
- Make
getSitelinkData
accept full article URLs and return{ lang, project, key, title, url }
- Expose parsed instance URLs:
wbk.instance
Breaking Changes:
- The module initialization was restructured to support Wikibase instances other than wikidata.org. As a consequence, while
require('wikibase-sdk')
still produces the same object as before,require('wikibase-sdk')
returns a function that takes a config object, which then returns the equivalent of thewdk
object but customized for the desired Wikibase instance (see import documentation). - Dropping bower support as it has been deprecated for a while now: old versions of wikibase-sdk should still be available though
- Renamed:
wikidataTimeToEpochTime
=>wikibaseTimeToEpochTime
wikidataTimeToISOString
=>wikibaseTimeToISOString
wikidataTimeToSimpleDay
=>wikibaseTimeToSimpleDay
- Removed legacy aliases:
simplifyClaim
(usesimplify.claim
)simplifyPropertyClaims
(usesimplify.propertyClaims
)simplifyClaims
(usesimplify.claims
)simplifySparqlResults
(usesimplify.sparqlResults
)getWikidataIdsFromWikipediaTitles
(usegetEntitiesFromSitelinks
)getWikidataIdsFromSitelinks
(usegetEntitiesFromSitelinks
)
simplify.claims
customtimeConverter
: allow to pass a custom time converter function (PR by @simon04)
- Added
getEntityRevision
helper function - Added
isRevisionId
helper function
- Sitelink helpers: added support for wikimania sitelinks (PR by @noinkling)
searchEntities
: allow to set a value to the continue
parameter
simplify.claims
: Add support formusical-notation
datatype
- Allow to set the
redirects
parameter ingetEntities
,getManyEntities
, andgetEntitiesFromSitelinks
functions
- Added Typescript types (6d0ae70), thanks @EdJoPaTo and @noinkling!
- Added new options to
simplify.claims
:- to deal with claims with special snaktypes:
- to deal with ranks:
- to activate all the
keep
options at once:
BREAKING CHANGE
- swapping
simplify.qualifier
andsimplify.qualifiers
that were mistakenly inverted (fixed #47,ed0e7a4
) - Make
simplifySparqlResults
consistently outputs an array of objects, unless the optionminimize
is set totrue
, in which case direct, requests with a single variable will return an array of those variables values ((ddba9e2)). The easy migration fromv5.x.x
is to replacesimplifySparqlResults(results)
bysimplifySparqlResults(results, { minimize: true })
(This doesn't affect requests with several variablesSELECT
ed)
searchEntities
: accept atype
parameter
getReverseClaims
: Added ability to query entities by multiple property values
- Added simplify.qualifier, simplify.propertyQualifiers, simplify.qualifiers functions
- Added
isGuid
helper function - Make
simplifySparqlResults
format statement URIs as claims GUIDs
- Added
truthyClaims
andtruthyPropertyClaims
functions - Added
simplify.entities
- Added
getImageUrl
helper
- Added new option to
simplify.claims
:- keep types (thanks @moshest!)
Wikidata Time converters
now also accept a time value object to take in account the precision, which only makes a difference in the result forwikidataTimeToSimpleDay
- Added
wikidataTimeToSimpleDay
getReverseClaims
: allow to request values for several properties at once
- Added new sitelink helpers:
getSitelinkData
andisSitelinkKey
- Added new options to
simplify.sitelinks
: - Added new sitelink helper:
getSitelinkUrl
andisSitelinkKey
- Added a new option to
simplify.claims
:
- Added new options to
simplify.claims
:
- Added
getRevisions
- Added option
timeConverter
tosimplify.claims
functions
- Added
simplify.entity
- Added
simplify.labels
- Added
simplify.descriptions
- Added
simplify.aliases
- Added
simplify.sitelinks
Breaking Changes:
- (00e3c81) Fixed naming issues:
- renamed
isWikidataId
=>isEntityId
- renamed
isWikidataEntityId
=>isItemId
- renamed
isWikidataPropertyId
=>isPropertyId
- renamed
- (df4301a) Removed helpers that were only needed to work with the now-offline WDQ service that is, all helpers dealing with entities ids in there numeric id form:
normalizeId
,normalizeIds
,(those last removal were reverted by (2b5020e))isNumericId
,getNumericId
- (a5ae25f) Removed
normalizeWikidataTime
alias: use one ofwikidataTimeToDateObject
,wikidataTimeToEpochTime
,wikidataTimeToISOString
instead - (e2158f9)
simplifyClaims
functions now usewikidataTimeToISOString
as time normalizer instead ofwikidataTimeToEpochTime
- Added
limit
andcaseInsensitive
options togetReverseClaims
- Added the option to keep qualifiers to
simplifyClaims
functions
- Simplify claims functions now each accept a 2nd and 3rd optional arguments to specify entity and property id prefixes
- Completly removed uses and references to wdq:
- BREAKING CHANGE:
getReverseClaims
now returns a query to the SPARQL endpoint. Its result should thus be parsed withsimplifySparqlResults
instead ofwdk.parse.entities
. This parser was thus removed.
- BREAKING CHANGE:
- Added
simplifySparqlResults
function
- Added
getManyEntities
function
- Extracting "bin" executables (qlabel, wikiqid) to there own modules: wikidata-cli. Bumping the major version as it could be considered a breaking change (despite the fact that those executables weren't really part of wikibase-sdk and that they were added very recently)
- Added CLI tools: qlabel and wikiqid
- Added support for the uselang parameter in entities search
- Added a SPARQL query url generator:
sparqlQuery