Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/weso/wb
Wikidata and Wikibase command line tool
https://github.com/weso/wb
entity-schemas rdf shex wikibase wikidata
Last synced: 9 days ago
JSON representation
Wikidata and Wikibase command line tool
- Host: GitHub
- URL: https://github.com/weso/wb
- Owner: weso
- License: mit
- Created: 2022-01-01T19:11:29.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-07T10:49:34.000Z (almost 3 years ago)
- Last Synced: 2024-11-06T12:53:46.893Z (about 2 months ago)
- Topics: entity-schemas, rdf, shex, wikibase, wikidata
- Language: Scala
- Homepage: https://www.weso.es/wb
- Size: 1.44 MB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wb - Wikidata and WikiBase instances tools
Some tools to work with Wikidata and Wikibase instances
## Run
TODO: It is possible to create binaries for the different systems and publish them using scala-cli
## Build from source
It requires [scala-cli](https://scala-cli.virtuslab.org/) which can be downloaded for Linux, Windows and MacOS.
Once you download it, you can create a binary using:
```sh
$ scala-cli package . -o wb -f
```and run the program with:
```
$ ./wb
```## Usage
```
Usage:
wb info
wb validate
wb sparqlInformation about Wikidata or Wikibase instances
Example: wb info --schema E42
Prints information about entity schema E42 from WikidataOptions and flags:
--help
Display this help text.
--version, -v
Print the version number and exit.Subcommands:
info
Get info about entity
validate
Validate an entity with an entity schema
sparql
Run SPARQL query
```## Subcommand info
Can be used to obtain information about Wikibase entities
```
Usage: wb info --entity [--wikibase ] [--schemaFormat ] [--mode ] [--verbose ]Get info about entity
Options and flags:
--help
Display this help text.
--entity , -e
Entity Id, example: Q42
--wikibase
Wikibase, default: wikidata, values: wikidata|rhizome|gndtest
--schemaFormat
Schema format, default = ShExC. Possible values = ShExC|ShExJ
--mode
Info mode, default = Out. Possible values = Out|Raw
--verbose
verbose level. 0 = nothing, 1 = info msgs, 2 = all msgs
```
## Subcommand validateCan be used to validate entities using entity schemas written in ShEx
```
Usage:
wb validate --schema --entity [--wikibase ] [--shape ] [--shex-engine ] [--result-format ] [--verbose ]
wb validate --schema-file --entity [--wikibase ] [--shape ] [--shex-engine ] [--result-format ] [--verbose ]Validate an entity with an entity schema
Options and flags:
--help
Display this help text.
--schema
Entity schema Id, example: E42
--schema-file
File that contains entity schema
--entity , -e
Entity Id, example: Q42
--wikibase
Wikibase, default: wikidata, values: wikidata|rhizome|gndtest
--shape
Shape to validate in entity schema (if not specified, it uses Start shape)
--shex-engine
ShEx engine. Available engines: ShExS,Jena
--result-format
result-format, default = Details, values=Details|Compact|JSON
--verbose
verbose level. 0 = nothing, 1 = info msgs, 2 = all msgs
```## Subcommand SPARQL
Can be used to run SPARQL queries on Wikidata and Wikibase instances
```
Usage: wb sparql --query-file [--wikibase ] [--result-format ] [--verbose ]Run SPARQL query
Options and flags:
--help
Display this help text.
--query-file
File that contains the SPARQL query
--wikibase
Wikibase, default: wikidata, values: wikidata|rhizome|gndtest
--result-format
Result format. Default=AsciiTable. Values=Table|JSON|XML
--verbose
verbose level. 0 = nothing, 1 = info msgs, 2 = all msgs
```### Examples
#### Get information about Q42
```
wb info --entity Q42
```#### Validate Q42 with entity schema E42 from Wikidata
```
wb validate --entity Q42 --schema E42
```#### Validate Q5 with entity schema E1 from a different Wikibase instance
```
wb validate --entity Q5 --schema E1 --wikibase GNDTest
```#### Run a sparql query
```
wb sparql --query-file examples/query1.sparql
```## Other distribution possibilities
It is possible to distribute/package the program using any of the [scala-cli package](https://scala-cli.virtuslab.org/docs/commands/package) options like Windows, docker, etc.
- Author: Jose Emilio Labra Gayo