wikibase-sdk
Advanced tools
Comparing version 7.0.8 to 7.0.9
@@ -18,2 +18,3 @@ # CHANGELOG | ||
* `getWikidataIdsFromWikipediaTitles` (use `getEntitiesFromSitelinks`) | ||
* `getWikidataIdsFromSitelinks` (use `getEntitiesFromSitelinks`) | ||
@@ -20,0 +21,0 @@ ## 6.7.0 - 2019-05-26 |
@@ -14,17 +14,31 @@ const { isPlainObject } = require('./utils/utils') | ||
const { instance, sparqlEndpoint } = config | ||
validateEndpoint('instance', instance) | ||
validateEndpoint('sparqlEndpoint', sparqlEndpoint) | ||
const buildUrl = require('./utils/build_url')(instance) | ||
return Object.assign({}, common, { | ||
const wikibaseApiFunctions = { | ||
searchEntities: require('./queries/search_entities')(buildUrl), | ||
getEntities: require('./queries/get_entities')(buildUrl), | ||
getManyEntities: require('./queries/get_many_entities')(buildUrl), | ||
sparqlQuery: require('./queries/sparql_query')(sparqlEndpoint), | ||
getReverseClaims: require('./queries/get_reverse_claims')(sparqlEndpoint), | ||
getRevisions: require('./queries/get_revisions')(buildUrl), | ||
getEntityRevision: require('./queries/get_entity_revision')(instance), | ||
getEntitiesFromSitelinks: require('./queries/get_entities_from_sitelinks')(buildUrl) | ||
}) | ||
} | ||
var wikibaseQueryServiceFunctions | ||
if (sparqlEndpoint) { | ||
validateEndpoint('sparqlEndpoint', sparqlEndpoint) | ||
wikibaseQueryServiceFunctions = { | ||
sparqlQuery: require('./queries/sparql_query')(sparqlEndpoint), | ||
getReverseClaims: require('./queries/get_reverse_claims')(sparqlEndpoint) | ||
} | ||
} else { | ||
wikibaseQueryServiceFunctions = { | ||
sparqlQuery: missingSparqlEndpoint('sparqlQuery'), | ||
getReverseClaims: missingSparqlEndpoint('getReverseClaims') | ||
} | ||
} | ||
return Object.assign({}, common, wikibaseApiFunctions, wikibaseQueryServiceFunctions) | ||
} | ||
@@ -42,2 +56,6 @@ | ||
const missingSparqlEndpoint = name => () => { | ||
throw new Error(`${name} requires a sparqlEndpoint to be set in configuration object`) | ||
} | ||
module.exports = WBK |
{ | ||
"name": "wikibase-sdk", | ||
"version": "7.0.8", | ||
"version": "7.0.9", | ||
"description": "A javascript tool-suite to query wikibase and simplify its results", | ||
@@ -5,0 +5,0 @@ "main": "lib/wikibase-sdk.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61988
978