Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command get-entity #63

Closed
nichtich opened this issue Nov 16, 2018 · 4 comments
Closed

Add command get-entity #63

nichtich opened this issue Nov 16, 2018 · 4 comments

Comments

@nichtich
Copy link
Contributor

To emit the JSON format of edit/create-entity. I think this is the same as

data --simplify --keep ids,references,qualifiers,nontruthy
@nichtich
Copy link
Contributor Author

nichtich commented Nov 18, 2018

The question has been raised in #68 but the answer to just use --simplify does not work because it eleminates qualifiers and references. The default should be round-tripping save to create-entity

@maxlath
Copy link
Owner

maxlath commented Mar 17, 2019

what would you think of a skeleton command, tailored to work with both wd edit-item and wd create-item:

  • without an id, simply outputs an empty entity skeleton to prepare wd create-item (possibly with tips if we use a format that allows comments Support HJSON as input format #71)
  • if passed an id, wd skeleton $id <=> wd data --simplify --keep all (with indented data output to ease edition)

@nichtich
Copy link
Contributor Author

Yes, that would be less confusable with command data. Options that make sense:

-p, --props <props>  as in wd-data
-l, --lang <langs> limit data so selected language(s)
-f, --format <format>  Default: json. Alternatives: js

@maxlath
Copy link
Owner

maxlath commented May 17, 2019

I just published v7.3.0, which includes a new command based on this idea: [wd generate-template]
(https://github.com/maxlath/wikidata-cli/blob/master/docs/read_operations.md#wd-generate-template).

Instead of --lang, I went for a more precise version of props:

wd generate-template Q123 --props labels.de,sitelinks.dewiki

As for the JS format, the implementation is somewhat hacky, but it seems to work from what I could see, could you give it a try?

wd generate-template Q123 --format js

@maxlath maxlath closed this as completed Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants