wikibase-cli 16.1.1 → 16.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/make_sparql_query.js
CHANGED
|
@@ -24,7 +24,7 @@ module.exports = (sparql, format = 'json') => {
|
|
|
24
24
|
|
|
25
25
|
const makeRequest = (url, format) => {
|
|
26
26
|
const acceptHeader = formatAcceptHeader[format]
|
|
27
|
-
if (!acceptHeader) throw new Error(`
|
|
27
|
+
if (!acceptHeader) throw new Error(`unknown format: ${format}`)
|
|
28
28
|
// Avoid making a POST request when not necessary as those aren't cached
|
|
29
29
|
// see https://www.mediawiki.org/wiki/Wikidata_Query_Service/User_Manual#SPARQL_endpoint
|
|
30
30
|
if (url.length < 5000) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Accept anything looking like an id:
|
|
2
2
|
// Q33977
|
|
3
|
+
// or q33977
|
|
3
4
|
// or wd:Q33977
|
|
4
5
|
// or 33977
|
|
5
6
|
// or https://www.wikidata.org/entity/Q33977
|
|
@@ -13,6 +14,7 @@ const nestedEntityIdPattern = /L[1-9][0-9]*-(F|S)[1-9][0-9]*/
|
|
|
13
14
|
const entitySchemaIdPattern = /(E)[1-9][0-9]*/
|
|
14
15
|
|
|
15
16
|
module.exports = (options = {}) => input => {
|
|
17
|
+
input = input.toUpperCase()
|
|
16
18
|
const { allowNestedIds = false, allowEntitiesSchemasIds = false } = options
|
|
17
19
|
|
|
18
20
|
if (allowNestedIds) {
|