wikibase-cli 19.4.2 → 20.1.0
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/README.md +2 -4
- package/bin/wb-claims.js +1 -1
- package/bin/wb-config.js +1 -1
- package/bin/wb-graph-path.js +85 -0
- package/bin/wb-props.js +1 -1
- package/bin/wb-query.js +6 -1
- package/bin/wb-search.js +1 -1
- package/lib/common_errors.js +1 -1
- package/lib/config/config.js +1 -1
- package/lib/config/credentials_config.js +1 -1
- package/lib/debug.js +1 -1
- package/lib/edit/assert_credentials.js +1 -1
- package/lib/edit/edit_command.js +1 -1
- package/lib/edit/init_credentials.js +1 -1
- package/lib/edit/prompt.js +1 -1
- package/lib/entity_attribute_command.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/exit_on_missing.js +1 -1
- package/lib/fetch_lang_props.js +1 -1
- package/lib/get_claims_texts.js +1 -3
- package/lib/log_claims.js +1 -1
- package/lib/log_command_examples.js +1 -1
- package/lib/make_sparql_query.js +1 -1
- package/lib/object_arg_parser.js +1 -1
- package/lib/output.js +1 -1
- package/lib/properties.js +1 -1
- package/lib/reset_properties.js +1 -1
- package/lib/summary_parser.js +2 -2
- package/lib/tabularize.js +1 -1
- package/metadata/add-alias.js +3 -3
- package/metadata/add-badge.js +1 -1
- package/metadata/add-claim.js +2 -2
- package/metadata/add-qualifier.js +7 -7
- package/metadata/add-reference.js +3 -3
- package/metadata/aliases.js +3 -3
- package/metadata/badges.js +1 -1
- package/metadata/claims.js +7 -7
- package/metadata/config.js +11 -11
- package/metadata/convert.js +4 -4
- package/metadata/create-entity.js +3 -3
- package/metadata/data.js +8 -8
- package/metadata/delete-entity.js +2 -2
- package/metadata/description.js +3 -3
- package/metadata/edit-entity.js +5 -5
- package/metadata/generate-template.js +6 -6
- package/metadata/graph-path.js +18 -0
- package/metadata/id.js +3 -3
- package/metadata/label.js +4 -4
- package/metadata/lang.js +3 -3
- package/metadata/lemma.js +3 -3
- package/metadata/merge-entity.js +1 -1
- package/metadata/move-claim.js +7 -7
- package/metadata/move-qualifier.js +3 -3
- package/metadata/open.js +12 -12
- package/metadata/props.js +10 -10
- package/metadata/query.js +15 -15
- package/metadata/remove-alias.js +3 -3
- package/metadata/remove-badge.js +1 -1
- package/metadata/remove-claim.js +2 -2
- package/metadata/remove-description.js +1 -1
- package/metadata/remove-label.js +1 -1
- package/metadata/remove-qualifier.js +3 -3
- package/metadata/remove-reference.js +3 -3
- package/metadata/remove-sitelink.js +1 -1
- package/metadata/revisions.js +5 -5
- package/metadata/search.js +5 -5
- package/metadata/set-alias.js +3 -3
- package/metadata/set-description.js +2 -2
- package/metadata/set-label.js +2 -2
- package/metadata/set-sitelink.js +1 -1
- package/metadata/sparql.js +9 -9
- package/metadata/summary.js +4 -4
- package/metadata/update-claim.js +3 -3
- package/metadata/update-qualifier.js +7 -7
- package/package.json +3 -3
- package/lib/chalk.js +0 -13
package/metadata/edit-entity.js
CHANGED
|
@@ -8,23 +8,23 @@ export default {
|
|
|
8
8
|
examples: [
|
|
9
9
|
{
|
|
10
10
|
args: "'{\"id\":\"Q4115189\",\"labels\":{\"en\":\"a label\",\"fr\":\"un label\"},\"descriptions\":{\"en\":\"some description\",\"fr\":\"une description\"},\"claims\":{\"P1775\":[\"Q3576110\",\"Q12206942\"],\"P2002\":\"bulgroz\"}}'",
|
|
11
|
-
comment: '
|
|
11
|
+
comment: 'Pass data as JSON',
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
args: './existing_item_data.json',
|
|
15
|
-
comment: '
|
|
15
|
+
comment: 'Pass data as a JSON file path',
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
args: './existing_item_data.js',
|
|
19
|
-
comment: '
|
|
19
|
+
comment: 'Pass data from a JS module exporting an object',
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
args: './existing_item_data.js Q123 abc 456',
|
|
23
|
-
comment: '
|
|
23
|
+
comment: 'Pass data from a JS module exporting a function (the additional arguments will be passed to the function)',
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
args: './existing_item_data.json --instance http://some/wikibase/instance/w/api.php --sparql-endpoint http://some/sparql/endpoint',
|
|
27
|
-
comment: '
|
|
27
|
+
comment: 'In case you use are not editing wikidata.org, make sure to specify the custom Wikibase instance and its SPARQL endpoint, as claims formatting and validation will depend on properties types that are retrieved from the SPARQL endpoint',
|
|
28
28
|
},
|
|
29
29
|
],
|
|
30
30
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
alias: 'gt',
|
|
3
3
|
args: '<entity>',
|
|
4
|
-
description: "
|
|
4
|
+
description: "Output the pre-formatted item's data optimized for edition with `wd edit-item`",
|
|
5
5
|
options: {
|
|
6
6
|
lang: false,
|
|
7
7
|
verbose: false,
|
|
@@ -11,10 +11,10 @@ export default {
|
|
|
11
11
|
sparqlEndpoint: false,
|
|
12
12
|
},
|
|
13
13
|
examples: [
|
|
14
|
-
{ args: 'Q123', comment: '
|
|
15
|
-
{ args: 'Q123 --props claims,sitelinks', comment: '
|
|
16
|
-
{ args: 'Q123 --props claims.P31,sitelinks.frwiki', comment: '
|
|
17
|
-
{ args: 'Q123 --format js', comment: '
|
|
18
|
-
{ args: 'Q123 Q124 Q125', comment: '
|
|
14
|
+
{ args: 'Q123', comment: 'Get Q123 pre-formatted data' },
|
|
15
|
+
{ args: 'Q123 --props claims,sitelinks', comment: 'Only get data required to edit the claims and sitelinks' },
|
|
16
|
+
{ args: 'Q123 --props claims.P31,sitelinks.frwiki', comment: 'Only get data required to edit the P31 claims and the frwiki sitelink' },
|
|
17
|
+
{ args: 'Q123 --format js', comment: 'Get the template in JS (easier to edit manually than JSON and still compatible with create-entity and edit-entity commands)' },
|
|
18
|
+
{ args: 'Q123 Q124 Q125', comment: 'Get several templates at once as NDJSON' },
|
|
19
19
|
],
|
|
20
20
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
alias: 'gp',
|
|
3
|
+
args: '<subject> <property> <object>',
|
|
4
|
+
description: 'Find the path between a subject and an object via a given property, on the entities relations graph',
|
|
5
|
+
options: {
|
|
6
|
+
lang: true,
|
|
7
|
+
verbose: true,
|
|
8
|
+
clipboard: false,
|
|
9
|
+
json: false,
|
|
10
|
+
instance: false,
|
|
11
|
+
sparqlEndpoint: true,
|
|
12
|
+
},
|
|
13
|
+
examples: [
|
|
14
|
+
{ args: 'Q336 P279 Q5891', comment: 'Find by which path science (Q336) is a subclass of (P279) philosophy (Q5891)' },
|
|
15
|
+
{ args: 'Q336 P279 Q5891,Q2198855,Q3326717,Q968159', comment: 'Find by which path science (Q336) is a subclass of (P279) either philosophy (Q5891), literary movement (Q3326717), or art movement (Q968159)' },
|
|
16
|
+
{ args: 'wd gp Q506259 P279 Q2509280 --format mermaid | mermaid-ascii -f -', comment: 'Output graph in the [mermaid format](https://mermaid.js.org/) and pipe it to [mermaid-ascii](https://github.com/AlexanderGrooff/mermaid-ascii) to visualize the graph in the terminal' },
|
|
17
|
+
],
|
|
18
|
+
}
|
package/metadata/id.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
args: '<title>',
|
|
3
|
-
description: '
|
|
3
|
+
description: 'Get a Wikidata id from a Wikipedia article title',
|
|
4
4
|
options: {
|
|
5
5
|
lang: true,
|
|
6
6
|
verbose: true,
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
sparqlEndpoint: false,
|
|
11
11
|
},
|
|
12
12
|
examples: [
|
|
13
|
-
{ args: 'Cantabria', comment: '
|
|
14
|
-
{ args: 'science politique --lang fr', comment: '
|
|
13
|
+
{ args: 'Cantabria', comment: 'Get the Wikidata id corresponding to the article "Cantabria" in Wikipedia' },
|
|
14
|
+
{ args: 'science politique --lang fr', comment: 'Get the Wikidata id corresponding to the article "science politique" in the French Wikipedia' },
|
|
15
15
|
],
|
|
16
16
|
}
|
package/metadata/label.js
CHANGED
|
@@ -3,11 +3,11 @@ import { entityAttributeCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'l',
|
|
5
5
|
args: '<entity>',
|
|
6
|
-
description: "
|
|
6
|
+
description: "Display the entity's label",
|
|
7
7
|
options: entityAttributeCommandsOptions,
|
|
8
8
|
examples: [
|
|
9
|
-
{ args: 'Q123', comment: '
|
|
10
|
-
{ args: 'Q123 --lang ja', comment: '
|
|
11
|
-
{ args: 'Q1 Q2 Q3 P6', comment: '
|
|
9
|
+
{ args: 'Q123', comment: 'Fetch the label for the entity Q123' },
|
|
10
|
+
{ args: 'Q123 --lang ja', comment: 'Fetch the label for the entity Q123 in Japanese' },
|
|
11
|
+
{ args: 'Q1 Q2 Q3 P6', comment: 'Fetch labels for several entities' },
|
|
12
12
|
],
|
|
13
13
|
}
|
package/metadata/lang.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
args: '<language code or wikidata id>',
|
|
3
|
-
description: '
|
|
3
|
+
description: 'Identify language code and return associated data',
|
|
4
4
|
options: {
|
|
5
5
|
lang: false,
|
|
6
6
|
verbose: false,
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
sparqlEndpoint: false,
|
|
11
11
|
},
|
|
12
12
|
examples: [
|
|
13
|
-
{ args: 'ak', comment: '
|
|
14
|
-
{ args: 'Q28026', comment: '
|
|
13
|
+
{ args: 'ak', comment: 'Find data associated with the Akan language from its language code' },
|
|
14
|
+
{ args: 'Q28026', comment: 'Find data associated with the Akan language from its Wikidata item id' },
|
|
15
15
|
],
|
|
16
16
|
}
|
package/metadata/lemma.js
CHANGED
|
@@ -2,10 +2,10 @@ import { entityAttributeCommandsOptions } from '#lib/common_options'
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
args: '<lexeme>',
|
|
5
|
-
description: "
|
|
5
|
+
description: "Display the lexeme's lemma",
|
|
6
6
|
options: entityAttributeCommandsOptions,
|
|
7
7
|
examples: [
|
|
8
|
-
{ args: 'L525', comment: '
|
|
9
|
-
{ args: 'L525 --lang ja', comment: '
|
|
8
|
+
{ args: 'L525', comment: 'Fetch the lemma for the lexeme L525' },
|
|
9
|
+
{ args: 'L525 --lang ja', comment: 'Fetch the lemma for the lexeme L525 in Japanese' },
|
|
10
10
|
],
|
|
11
11
|
}
|
package/metadata/merge-entity.js
CHANGED
package/metadata/move-claim.js
CHANGED
|
@@ -3,14 +3,14 @@ import { editCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'mc',
|
|
5
5
|
args: '<guid|property-claims-id> <target-entity-id> <target-property-id>',
|
|
6
|
-
description: '
|
|
6
|
+
description: 'Move claims from an entity to another and/or from a property to another',
|
|
7
7
|
options: editCommandsOptions,
|
|
8
8
|
examples: [
|
|
9
|
-
{ args: "'Q4115189$13681798-47F7-4D51-B3B4-BA8C7E044E1F' Q4115189 P20", comment: '
|
|
10
|
-
{ args: "'Q4115189$13681798-47F7-4D51-B3B4-BA8C7E044E1F' Q13406268 P19", comment: '
|
|
11
|
-
{ args: "'Q4115189$13681798-47F7-4D51-B3B4-BA8C7E044E1F' Q13406268 P20", comment: '
|
|
12
|
-
{ args: "'Q4115189#P19' Q4115189 P20", comment: '
|
|
13
|
-
{ args: "'Q4115189#P19' Q13406268 P19", comment: '
|
|
14
|
-
{ args: "'Q4115189#P19' Q13406268 P20", comment: '
|
|
9
|
+
{ args: "'Q4115189$13681798-47F7-4D51-B3B4-BA8C7E044E1F' Q4115189 P20", comment: 'Change the property of a claim (without changing entity)' },
|
|
10
|
+
{ args: "'Q4115189$13681798-47F7-4D51-B3B4-BA8C7E044E1F' Q13406268 P19", comment: 'Move the claim to another entity (without changing the property)' },
|
|
11
|
+
{ args: "'Q4115189$13681798-47F7-4D51-B3B4-BA8C7E044E1F' Q13406268 P20", comment: 'Move the claim to another entity and another property' },
|
|
12
|
+
{ args: "'Q4115189#P19' Q4115189 P20", comment: 'Move all Q4115189 P19 claims to P20 (without changing entity)' },
|
|
13
|
+
{ args: "'Q4115189#P19' Q13406268 P19", comment: 'Move all Q4115189 P19 claims to Q13406268 (without changing the property)' },
|
|
14
|
+
{ args: "'Q4115189#P19' Q13406268 P20", comment: 'Move all Q4115189 P19 claims to Q13406268 P20' },
|
|
15
15
|
],
|
|
16
16
|
}
|
|
@@ -3,10 +3,10 @@ import { editCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'mq',
|
|
5
5
|
args: '<guid> [hash] <old-property-id> <new-property-id>',
|
|
6
|
-
description: '
|
|
6
|
+
description: 'Move qualifiers of a claim from one property to another',
|
|
7
7
|
options: editCommandsOptions,
|
|
8
8
|
examples: [
|
|
9
|
-
{ args: "'Q4115189$13681798-47F7-4D51-B3B4-BA8C7E044E1F' P2310 P2311", comment: '
|
|
10
|
-
{ args: "'Q4115189$13681798-47F7-4D51-B3B4-BA8C7E044E1F' 90b9b567dc01112e7d9dee98eb5f5ad50ae803bb P2310 P2311", comment: '
|
|
9
|
+
{ args: "'Q4115189$13681798-47F7-4D51-B3B4-BA8C7E044E1F' P2310 P2311", comment: 'Move all P2310 qualifiers of this claim to P2311' },
|
|
10
|
+
{ args: "'Q4115189$13681798-47F7-4D51-B3B4-BA8C7E044E1F' 90b9b567dc01112e7d9dee98eb5f5ad50ae803bb P2310 P2311", comment: 'Move only the P2310 qualifier with this hash to P2311' },
|
|
11
11
|
],
|
|
12
12
|
}
|
package/metadata/open.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
alias: 'o',
|
|
3
3
|
args: '<entity>',
|
|
4
|
-
description: "
|
|
4
|
+
description: "Open the entity's page on Wikidata website",
|
|
5
5
|
options: {
|
|
6
6
|
lang: true,
|
|
7
7
|
verbose: true,
|
|
@@ -11,16 +11,16 @@ export default {
|
|
|
11
11
|
sparqlEndpoint: false,
|
|
12
12
|
},
|
|
13
13
|
examples: [
|
|
14
|
-
{ args: 'Q44559', comment: '
|
|
15
|
-
{ args: 'P123', comment: '
|
|
16
|
-
{ args: 'L525', comment: '
|
|
17
|
-
{ args: 'L525-F1', comment: '
|
|
18
|
-
{ args: 'L525-S1', comment: '
|
|
19
|
-
{ args: 'Q44559 --history', comment: '
|
|
20
|
-
{ args: 'Q44559 --revision 942578737', comment: '
|
|
21
|
-
{ args: 'Q44559 --wikipedia', comment: '
|
|
22
|
-
{ args: 'Q44559 --wikipedia --lang pt', comment: '
|
|
23
|
-
{ args: 'Q44559 --url', comment: '
|
|
24
|
-
{ args: 'Q44559 L525 P123', comment: '
|
|
14
|
+
{ args: 'Q44559', comment: 'Open https://www.wikidata.org/entity/Q44559 in your default browser' },
|
|
15
|
+
{ args: 'P123', comment: 'Open https://www.wikidata.org/entity/P123' },
|
|
16
|
+
{ args: 'L525', comment: 'Open https://www.wikidata.org/entity/L525' },
|
|
17
|
+
{ args: 'L525-F1', comment: 'Open https://www.wikidata.org/entity/L525-F1' },
|
|
18
|
+
{ args: 'L525-S1', comment: 'Open https://www.wikidata.org/entity/L525-S1' },
|
|
19
|
+
{ args: 'Q44559 --history', comment: 'Open the entity history page' },
|
|
20
|
+
{ args: 'Q44559 --revision 942578737', comment: 'Open the entity page at a given revision' },
|
|
21
|
+
{ args: 'Q44559 --wikipedia', comment: 'Open the article on Exoplanets in Wikipedia' },
|
|
22
|
+
{ args: 'Q44559 --wikipedia --lang pt', comment: 'Open the article on Exoplanets in the Portugese Wikipedia' },
|
|
23
|
+
{ args: 'Q44559 --url', comment: 'Outputs the URL without opening the browser' },
|
|
24
|
+
{ args: 'Q44559 L525 P123', comment: 'Open several pages at once' },
|
|
25
25
|
],
|
|
26
26
|
}
|
package/metadata/props.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
alias: 'p',
|
|
3
3
|
args: '',
|
|
4
|
-
description: '
|
|
4
|
+
description: 'Output the list of all Wikidata properties',
|
|
5
5
|
options: {
|
|
6
6
|
lang: true,
|
|
7
7
|
verbose: true,
|
|
@@ -11,14 +11,14 @@ export default {
|
|
|
11
11
|
sparqlEndpoint: true,
|
|
12
12
|
},
|
|
13
13
|
examples: [
|
|
14
|
-
{ args: '', comment: '
|
|
15
|
-
{ args: '--type', comment: '
|
|
16
|
-
{ args: '--details', comment: '
|
|
17
|
-
{ args: 'image', comment: '
|
|
18
|
-
{ args: '--type Url', comment: '
|
|
19
|
-
{ args: '--type Url ref', comment: '
|
|
20
|
-
{ args: '--lang sv', comment: '
|
|
21
|
-
{ args: '--no-cache', comment: '
|
|
22
|
-
{ args: '--reset', comment: '
|
|
14
|
+
{ args: '', comment: 'Output all the properties and their labels' },
|
|
15
|
+
{ args: '--type', comment: 'Output all properties, with their labels, types' },
|
|
16
|
+
{ args: '--details', comment: 'Output all properties, with their labels, types, descriptions, and aliases' },
|
|
17
|
+
{ args: 'image', comment: 'Filter the properties to keep only those with labels matching "image"' },
|
|
18
|
+
{ args: '--type Url', comment: 'Filter the properties to keep only those of type Url (other possible types: ExternalId, String, WikibaseItem, WikibaseProperty, Time, Monolingualtext, Quantity, CommonsMedia, GlobeCoordinate)' },
|
|
19
|
+
{ args: '--type Url ref', comment: 'Filter the properties to keep only those of type Url matching the pattern "ref"' },
|
|
20
|
+
{ args: '--lang sv', comment: 'Output all the properties with their label in Swedish' },
|
|
21
|
+
{ args: '--no-cache', comment: 'Ignore properties cache: fetch properties from the SPARQL endpoint, even if already cached' },
|
|
22
|
+
{ args: '--reset', comment: 'Delete all the cached properties files to get fresh versions on the next execution' },
|
|
23
23
|
],
|
|
24
24
|
}
|
package/metadata/query.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
alias: 'q',
|
|
3
3
|
args: '',
|
|
4
|
-
description: "
|
|
4
|
+
description: "Generate and run a simple SPARQL query by passing a statement's subject, property, or object, or a couple of those",
|
|
5
5
|
options: {
|
|
6
6
|
lang: true,
|
|
7
7
|
verbose: true,
|
|
@@ -11,20 +11,20 @@ export default {
|
|
|
11
11
|
sparqlEndpoint: true,
|
|
12
12
|
},
|
|
13
13
|
examples: [
|
|
14
|
-
{ args: '--property P2002 --object timberners_lee', comment: '
|
|
15
|
-
{ args: '--property P921 --object Q44559 --labels', comment: '
|
|
16
|
-
{ args: '--property P7476 --count', comment: '
|
|
17
|
-
{ args: '-p P921 -o Q44559 -a', comment: '
|
|
18
|
-
{ args: "-p P921 -o Q44559 -a | jq '.[]' -cr", comment: '
|
|
19
|
-
{ args: '-s Q15228 -p P674 -a', comment: '
|
|
20
|
-
{ args: '-s Q15228 -o Q177499 -a', comment: '
|
|
21
|
-
{ args: '-s Q177499 -a', comment: '
|
|
22
|
-
{ args: '.-p P31 -o Q44559 --format csv', comment: "
|
|
23
|
-
{ args: '-p P31 -o Q44559 --limit 5', comment: '
|
|
24
|
-
{ args: '-p P31 -o Q44559 --limit 5 --verbose', comment: '
|
|
25
|
-
{ args: '-p P31 -o Q44559 --limit 5 --dry', comment: '
|
|
26
|
-
{ args: '-p P31 -o Q44559 --limit 5 --open', comment: '
|
|
14
|
+
{ args: '--property P2002 --object timberners_lee', comment: 'Find out which entity as the twitter username (P2002) "timberners_lee"' },
|
|
15
|
+
{ args: '--property P921 --object Q44559 --labels', comment: 'Find out which works have exoplanets (Q44559) for main subject (P921)\n # and include labels' },
|
|
16
|
+
{ args: '--property P7476 --count', comment: 'Get a list of all the claims using the property (P7476)' },
|
|
17
|
+
{ args: '-p P921 -o Q44559 -a', comment: 'As always, you can also use the short options syntax' },
|
|
18
|
+
{ args: "-p P921 -o Q44559 -a | jq '.[]' -cr", comment: 'The output is valid JSON, so you can pipe it to any JSON parser you like\n # (here jq https://jqlang.github.io/jq/)' },
|
|
19
|
+
{ args: '-s Q15228 -p P674 -a', comment: 'Find out which are the characters (P674) in The Lord of The Ring (Q15228)' },
|
|
20
|
+
{ args: '-s Q15228 -o Q177499 -a', comment: 'Find out which property link The Lord of The Ring (Q15228) and Gandalf (Q177499)' },
|
|
21
|
+
{ args: '-s Q177499 -a', comment: 'Get the properties and objects for all the triples (subject, property, object) having Gandalf (Q177499) as subject' },
|
|
22
|
+
{ args: '.-p P31 -o Q44559 --format csv', comment: "Set an alternative output format: json, xml, tsv, csv, binrdf, table. Default: 'table' when 1 value is selected, 'json' otherwise" },
|
|
23
|
+
{ args: '-p P31 -o Q44559 --limit 5', comment: 'Use the limit option to get only 5 instances of exoplanets (Q44559)' },
|
|
24
|
+
{ args: '-p P31 -o Q44559 --limit 5 --verbose', comment: 'Use the verbose option to see the generated SPARQL and the generated query URL' },
|
|
25
|
+
{ args: '-p P31 -o Q44559 --limit 5 --dry', comment: 'Simply output the generated SPARQL, without running the query' },
|
|
26
|
+
{ args: '-p P31 -o Q44559 --limit 5 --open', comment: 'Open the query in the Query Service GUI' },
|
|
27
27
|
{ args: '--sample --sparql-endpoint https://bnb.data.bl.uk/sparql --format table', comment: 'Get a sample of triples from a triple store' },
|
|
28
|
-
{ args: '--sparql-endpoint https://bnb.data.bl.uk/sparql --describe http://bnb.data.bl.uk/id/person/OBrienJim1950- --format table', comment: '
|
|
28
|
+
{ args: '--sparql-endpoint https://bnb.data.bl.uk/sparql --describe http://bnb.data.bl.uk/id/person/OBrienJim1950- --format table', comment: 'Make a DESCRIBE request' },
|
|
29
29
|
],
|
|
30
30
|
}
|
package/metadata/remove-alias.js
CHANGED
|
@@ -3,10 +3,10 @@ import { editCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'ra',
|
|
5
5
|
args: '<entity> <language> <aliases>',
|
|
6
|
-
description: '
|
|
6
|
+
description: 'Remove one or several aliases from the list of aliases of an entity in a given language',
|
|
7
7
|
options: editCommandsOptions,
|
|
8
8
|
examples: [
|
|
9
|
-
{ args: 'Q4115189 fr foo', comment: "
|
|
10
|
-
{ args: 'Q4115189 fr "foo|bar|buzz', comment: "
|
|
9
|
+
{ args: 'Q4115189 fr foo', comment: "Remove 'foo' from the Sandbox entity (Q4115189) French aliases" },
|
|
10
|
+
{ args: 'Q4115189 fr "foo|bar|buzz', comment: "Remove 'foo', 'bar', and 'buzz' from the Sandbox entity (Q4115189) French aliases" },
|
|
11
11
|
],
|
|
12
12
|
}
|
package/metadata/remove-badge.js
CHANGED
|
@@ -3,7 +3,7 @@ import { editCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'rb',
|
|
5
5
|
args: '<entity> <site> [badges]',
|
|
6
|
-
description: '
|
|
6
|
+
description: 'Remove badges on an existing sitelink',
|
|
7
7
|
options: editCommandsOptions,
|
|
8
8
|
examples: [
|
|
9
9
|
{ args: 'Q4115189 enwikiquote Q17437796,Q17437798', comment: 'Remove Q17437796 and Q17437798 badges on Q4115189 enwikiquote sitelink' },
|
package/metadata/remove-claim.js
CHANGED
|
@@ -3,9 +3,9 @@ import { editCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'rc',
|
|
5
5
|
args: '<guids>',
|
|
6
|
-
description: '
|
|
6
|
+
description: 'Remove claims by their GUIDs',
|
|
7
7
|
options: editCommandsOptions,
|
|
8
8
|
examples: [
|
|
9
|
-
{ args: 'Q71$BD9A4A9F-E3F9-43D4-BFDB-484984A87FD7', comment: '
|
|
9
|
+
{ args: 'Q71$BD9A4A9F-E3F9-43D4-BFDB-484984A87FD7', comment: 'Remove this claim made on Q71' },
|
|
10
10
|
],
|
|
11
11
|
}
|
|
@@ -3,7 +3,7 @@ import { editCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'rd',
|
|
5
5
|
args: '<entity> <language>',
|
|
6
|
-
description: '
|
|
6
|
+
description: 'Remove a description on an entity for a given language',
|
|
7
7
|
options: editCommandsOptions,
|
|
8
8
|
examples: [
|
|
9
9
|
{ args: 'Q4115189 it', comment: 'Remove Q4115189 description in Italian' },
|
package/metadata/remove-label.js
CHANGED
|
@@ -3,7 +3,7 @@ import { editCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'rl',
|
|
5
5
|
args: '<entity> <language>',
|
|
6
|
-
description: '
|
|
6
|
+
description: 'Remove a label on an entity for a given language',
|
|
7
7
|
options: editCommandsOptions,
|
|
8
8
|
examples: [
|
|
9
9
|
{ args: 'Q4115189 it', comment: 'Remove Q4115189 label in Italian' },
|
|
@@ -3,10 +3,10 @@ import { editCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'rq',
|
|
5
5
|
args: '<claim-guid> <qualifiers-hashes>',
|
|
6
|
-
description: '
|
|
6
|
+
description: 'Remove qualifiers from a claim',
|
|
7
7
|
options: editCommandsOptions,
|
|
8
8
|
examples: [
|
|
9
|
-
{ args: "'Q4115189$E51978A1-D13A-4916-800E-74ACD2466970' '24aa18192de7051f81d88d1ab514826002d51c14'", comment: '
|
|
10
|
-
{ args: "'Q4115189$E51978A1-D13A-4916-800E-74ACD2466970' '24aa18192de7051f81d88d1ab514826002d51c14|f6c14e4eebb3d4f7595f0952c1ece0a34d85368b'", comment: '
|
|
9
|
+
{ args: "'Q4115189$E51978A1-D13A-4916-800E-74ACD2466970' '24aa18192de7051f81d88d1ab514826002d51c14'", comment: 'Remove a qualifier from this claim' },
|
|
10
|
+
{ args: "'Q4115189$E51978A1-D13A-4916-800E-74ACD2466970' '24aa18192de7051f81d88d1ab514826002d51c14|f6c14e4eebb3d4f7595f0952c1ece0a34d85368b'", comment: 'Remove several qualifiers from this claim' },
|
|
11
11
|
],
|
|
12
12
|
}
|
|
@@ -3,10 +3,10 @@ import { editCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'rr',
|
|
5
5
|
args: '<claim-guid> <references-hashes>',
|
|
6
|
-
description: '
|
|
6
|
+
description: 'Remove references from a claim',
|
|
7
7
|
options: editCommandsOptions,
|
|
8
8
|
examples: [
|
|
9
|
-
{ args: "'Q4115189$E51978A1-D13A-4916-800E-74ACD2466970' '72ea3cdd27062da9f0971c1feab6df32d729ecb3'", comment: '
|
|
10
|
-
{ args: "'Q4115189$E51978A1-D13A-4916-800E-74ACD2466970' '72ea3cdd27062da9f0971c1feab6df32d729ecb3|5e9840f6896948b13d6e9c6328169643229aa3db'", comment: '
|
|
9
|
+
{ args: "'Q4115189$E51978A1-D13A-4916-800E-74ACD2466970' '72ea3cdd27062da9f0971c1feab6df32d729ecb3'", comment: 'Remove a reference from this claim' },
|
|
10
|
+
{ args: "'Q4115189$E51978A1-D13A-4916-800E-74ACD2466970' '72ea3cdd27062da9f0971c1feab6df32d729ecb3|5e9840f6896948b13d6e9c6328169643229aa3db'", comment: 'Remove several references from this claim' },
|
|
11
11
|
],
|
|
12
12
|
}
|
|
@@ -3,7 +3,7 @@ import { editCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'rs',
|
|
5
5
|
args: '<entity> <site>',
|
|
6
|
-
description: '
|
|
6
|
+
description: 'Remove a sitelink on an entity for a given site',
|
|
7
7
|
options: editCommandsOptions,
|
|
8
8
|
examples: [
|
|
9
9
|
{ args: 'Q4115189 enwikiquote', comment: 'Remove the link from Q4115189 to any article in the English Wikiquote' },
|
package/metadata/revisions.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
alias: 'r',
|
|
3
3
|
args: '<entity>',
|
|
4
|
-
description: "
|
|
4
|
+
description: "Output the entity's revisions data",
|
|
5
5
|
options: {
|
|
6
6
|
lang: false,
|
|
7
7
|
verbose: false,
|
|
@@ -11,9 +11,9 @@ export default {
|
|
|
11
11
|
sparqlEndpoint: false,
|
|
12
12
|
},
|
|
13
13
|
examples: [
|
|
14
|
-
{ args: 'Q3548931', comment: "
|
|
15
|
-
{ args: 'Q3548931 -p content,user,ids,comment,timestamp,flags,oresscores', comment: "
|
|
16
|
-
{ args: 'Q3548931 -u InventaireBot', comment: "
|
|
17
|
-
{ args: 'Property:P31', comment: "
|
|
14
|
+
{ args: 'Q3548931', comment: "Fetch Q3548931's revisions data" },
|
|
15
|
+
{ args: 'Q3548931 -p content,user,ids,comment,timestamp,flags,oresscores', comment: "Fetch only certain attributes from Q3548931's revisions data" },
|
|
16
|
+
{ args: 'Q3548931 -u InventaireBot', comment: "Fetch Q3548931's revisions data from the user InventaireBot" },
|
|
17
|
+
{ args: 'Property:P31', comment: "Fetch P31's revisions data" },
|
|
18
18
|
],
|
|
19
19
|
}
|
package/metadata/search.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
alias: 'f',
|
|
3
3
|
args: '<search>',
|
|
4
|
-
description: '
|
|
4
|
+
description: 'Search entities',
|
|
5
5
|
options: {
|
|
6
6
|
lang: true,
|
|
7
7
|
verbose: true,
|
|
@@ -11,10 +11,10 @@ export default {
|
|
|
11
11
|
sparqlEndpoint: false,
|
|
12
12
|
},
|
|
13
13
|
examples: [
|
|
14
|
-
{ args: 'Ligo', comment: '
|
|
15
|
-
{ args: 'Harry Potter --limit 25', comment: '
|
|
16
|
-
{ args: 'Harry Potter --verbose', comment: '
|
|
17
|
-
{ args: 'Harry Potter --properties P577,P935', comment: '
|
|
14
|
+
{ args: 'Ligo', comment: 'Displays a list of entities matching "Ligo"' },
|
|
15
|
+
{ args: 'Harry Potter --limit 25', comment: 'Displays up to 25 results matching "Harry Potter"' },
|
|
16
|
+
{ args: 'Harry Potter --verbose', comment: 'Display rich results (aka summaries)' },
|
|
17
|
+
{ args: 'Harry Potter --properties P577,P935', comment: 'Request additional properties (separated by a comma) to be added to the results summaries' },
|
|
18
18
|
{ args: 'date --type property', comment: 'Search properties (but `wb props` might be doing a better job)' },
|
|
19
19
|
{ args: 'date --type lexeme', comment: 'Search lexemes' },
|
|
20
20
|
{ args: 'code --type form', comment: 'Search forms' },
|
package/metadata/set-alias.js
CHANGED
|
@@ -3,10 +3,10 @@ import { editCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'sa',
|
|
5
5
|
args: '<entity> <language> <aliases>',
|
|
6
|
-
description: '
|
|
6
|
+
description: 'Set the list of aliases of an entity in a given language',
|
|
7
7
|
options: editCommandsOptions,
|
|
8
8
|
examples: [
|
|
9
|
-
{ args: 'Q4115189 fr foo', comment: "
|
|
10
|
-
{ args: 'Q4115189 fr "foo|bar|buzz', comment: "
|
|
9
|
+
{ args: 'Q4115189 fr foo', comment: "Replaces the Sandbox entity (Q4115189) French aliases by 'foo'" },
|
|
10
|
+
{ args: 'Q4115189 fr "foo|bar|buzz', comment: "Replaces the Sandbox entity (Q4115189) French aliases by foo', 'bar', and 'buzz'" },
|
|
11
11
|
],
|
|
12
12
|
}
|
|
@@ -3,9 +3,9 @@ import { editCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'sd',
|
|
5
5
|
args: '<entity> <language> <description>',
|
|
6
|
-
description: '
|
|
6
|
+
description: 'Set a description on an entity in a given language',
|
|
7
7
|
options: editCommandsOptions,
|
|
8
8
|
examples: [
|
|
9
|
-
{ args: 'Q4115189 fr "description du Bac à sable bulgroz"', comment: "
|
|
9
|
+
{ args: 'Q4115189 fr "description du Bac à sable bulgroz"', comment: "Set the description 'description du Bac à sable bulgroz' to the Sandbox entity (Q4115189) in French" },
|
|
10
10
|
],
|
|
11
11
|
}
|
package/metadata/set-label.js
CHANGED
|
@@ -3,9 +3,9 @@ import { editCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'sl',
|
|
5
5
|
args: '<entity> <language> <label>',
|
|
6
|
-
description: '
|
|
6
|
+
description: 'Set a label on an entity in a given language',
|
|
7
7
|
options: editCommandsOptions,
|
|
8
8
|
examples: [
|
|
9
|
-
{ args: 'Q4115189 fr "Bac à sable bulgroz"', comment: "
|
|
9
|
+
{ args: 'Q4115189 fr "Bac à sable bulgroz"', comment: "Set the label 'Bac à sable bulgroz' to the Sandbox entity (Q4115189) in French" },
|
|
10
10
|
],
|
|
11
11
|
}
|
package/metadata/set-sitelink.js
CHANGED
|
@@ -3,7 +3,7 @@ import { editCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'ss',
|
|
5
5
|
args: '<entity> <site> <title> [badges]',
|
|
6
|
-
description: '
|
|
6
|
+
description: 'Set a sitelink on an entity for a given site',
|
|
7
7
|
options: editCommandsOptions,
|
|
8
8
|
examples: [
|
|
9
9
|
{ args: 'Q4115189 enwikiquote "The Sandbox"', comment: "Link Q4115189 to the article 'The Sandbox' on the English Wikiquote" },
|
package/metadata/sparql.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
alias: 's',
|
|
3
3
|
args: '<file.rq>',
|
|
4
|
-
description: '
|
|
4
|
+
description: 'Run a SPARQL query and get its JSON output',
|
|
5
5
|
options: {
|
|
6
6
|
lang: false,
|
|
7
7
|
verbose: true,
|
|
@@ -11,13 +11,13 @@ export default {
|
|
|
11
11
|
sparqlEndpoint: true,
|
|
12
12
|
},
|
|
13
13
|
examples: [
|
|
14
|
-
{ args: './path/to/query.rq', comment: '
|
|
15
|
-
{ args: './path/to/query_template.js Q123 Q456', comment: '
|
|
16
|
-
{ args: './path/to/query.rq > ./results.json ', comment: '
|
|
17
|
-
{ args: './path/to/query.rq --raw', comment: '
|
|
18
|
-
{ args: './path/to/query.rq --format csv', comment: "
|
|
19
|
-
{ args: './path/to/query.rq --index someVariableName', comment: '
|
|
20
|
-
{ args: './path/to/query.rq --dry', comment: '
|
|
21
|
-
{ args: './path/to/query.rq --open', comment: '
|
|
14
|
+
{ args: './path/to/query.rq', comment: 'Make a SPARQL request from a file' },
|
|
15
|
+
{ args: './path/to/query_template.js Q123 Q456', comment: 'Generate a SPARQL request from a template' },
|
|
16
|
+
{ args: './path/to/query.rq > ./results.json ', comment: 'Output it in a file instead of the terminal' },
|
|
17
|
+
{ args: './path/to/query.rq --raw', comment: 'Get the raw JSON results as query.wikidata.org outputs them, instead of a simplified version' },
|
|
18
|
+
{ args: './path/to/query.rq --format csv', comment: "Set an alternative output format: json, xml, tsv, csv, binrdf, table. Default: 'table' when 1 value is selected, 'json' otherwise" },
|
|
19
|
+
{ args: './path/to/query.rq --index someVariableName', comment: 'Get the results indexed by one of the SELECTed variables' },
|
|
20
|
+
{ args: './path/to/query.rq --dry', comment: 'Output the SPARQL without running the query' },
|
|
21
|
+
{ args: './path/to/query.rq --open', comment: 'Open the query in the Query Service GUI' },
|
|
22
22
|
],
|
|
23
23
|
}
|
package/metadata/summary.js
CHANGED
|
@@ -3,11 +3,11 @@ import { entityAttributeCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'u',
|
|
5
5
|
args: '<entity>',
|
|
6
|
-
description: '
|
|
6
|
+
description: 'Display basic information on the requested entity',
|
|
7
7
|
options: Object.assign({ clipboard: false }, entityAttributeCommandsOptions),
|
|
8
8
|
examples: [
|
|
9
|
-
{ args: 'Q123', comment: '
|
|
10
|
-
{ args: 'Q123 --lang ja', comment: '
|
|
11
|
-
{ args: 'Q1 -p P3219,P2612', comment: '
|
|
9
|
+
{ args: 'Q123', comment: 'Display basic information for the entity Q123' },
|
|
10
|
+
{ args: 'Q123 --lang ja', comment: 'Display basic information for the entity Q123 in Japanese' },
|
|
11
|
+
{ args: 'Q1 -p P3219,P2612', comment: 'Display the summary with additional properties' },
|
|
12
12
|
],
|
|
13
13
|
}
|
package/metadata/update-claim.js
CHANGED
|
@@ -3,10 +3,10 @@ import { editCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'uc',
|
|
5
5
|
args: '<guid> <new-value>',
|
|
6
|
-
description: "
|
|
6
|
+
description: "Update a claim's value",
|
|
7
7
|
options: Object.assign({ rank: true }, editCommandsOptions),
|
|
8
8
|
examples: [
|
|
9
|
-
{ args: 'Q4115189$bc43ae33-7525-42cb-ad31-b1e1cf3cb72d Bulgroz', comment: "
|
|
10
|
-
{ args: 'Q4115189 P2002 Zorglub Bulgroz', comment: "
|
|
9
|
+
{ args: 'Q4115189$bc43ae33-7525-42cb-ad31-b1e1cf3cb72d Bulgroz', comment: "Update the claim identified by this id with the value 'Bulgroz'" },
|
|
10
|
+
{ args: 'Q4115189 P2002 Zorglub Bulgroz', comment: "Change the the Sandbox (Q4115189) Twitter account (P2002) from 'Zorglub' to 'Bulgroz'" },
|
|
11
11
|
],
|
|
12
12
|
}
|
|
@@ -3,14 +3,14 @@ import { editCommandsOptions } from '#lib/common_options'
|
|
|
3
3
|
export default {
|
|
4
4
|
alias: 'uq',
|
|
5
5
|
args: '<claim-guid> <property> <old-value> <new-value>',
|
|
6
|
-
description: '
|
|
6
|
+
description: 'Update a qualifier from an existing value to a new value',
|
|
7
7
|
options: editCommandsOptions,
|
|
8
8
|
examples: [
|
|
9
|
-
{ args: "'Q4115189$E66DBC80-CCC1-4899-90D4-510C9922A04F' P155 'Q13406268' 'Q3576110'", comment: '
|
|
10
|
-
{ args: "'Q4115189$E66DBC80-CCC1-4899-90D4-510C9922A04F' P1545 'A-123' 'B-123'", comment: '
|
|
11
|
-
{ args: "'Q4115189$E66DBC80-CCC1-4899-90D4-510C9922A04F' P580 '1802-02-26' ''1802-02-27'", comment: '
|
|
12
|
-
{ args: "'Q4115189$E66DBC80-CCC1-4899-90D4-510C9922A04F' P2130 123 124", comment: '
|
|
13
|
-
{ args: "'Q4115189$E66DBC80-CCC1-4899-90D4-510C9922A04F' P2130 'amount=123&unit=Q4916' 'amount=124&unit=Q4916'", comment: '
|
|
14
|
-
{ args: "'Q4115189$E66DBC80-CCC1-4899-90D4-510C9922A04F' P3132 'text=aaah&language=fr' 'text=ach sooo&language=de'", comment: '
|
|
9
|
+
{ args: "'Q4115189$E66DBC80-CCC1-4899-90D4-510C9922A04F' P155 'Q13406268' 'Q3576110'", comment: 'Entity qualifier' },
|
|
10
|
+
{ args: "'Q4115189$E66DBC80-CCC1-4899-90D4-510C9922A04F' P1545 'A-123' 'B-123'", comment: 'String qualifier' },
|
|
11
|
+
{ args: "'Q4115189$E66DBC80-CCC1-4899-90D4-510C9922A04F' P580 '1802-02-26' ''1802-02-27'", comment: 'Time qualifier' },
|
|
12
|
+
{ args: "'Q4115189$E66DBC80-CCC1-4899-90D4-510C9922A04F' P2130 123 124", comment: 'Quantity qualifier' },
|
|
13
|
+
{ args: "'Q4115189$E66DBC80-CCC1-4899-90D4-510C9922A04F' P2130 'amount=123&unit=Q4916' 'amount=124&unit=Q4916'", comment: 'Quantity qualifier with a unit' },
|
|
14
|
+
{ args: "'Q4115189$E66DBC80-CCC1-4899-90D4-510C9922A04F' P3132 'text=aaah&language=fr' 'text=ach sooo&language=de'", comment: 'Monolingualtext qualifier' },
|
|
15
15
|
],
|
|
16
16
|
}
|