Closed nichtich closed 5 years ago
The question has been raised in https://github.com/maxlath/wikidata-cli/issues/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
what would you think of a skeleton
command, tailored to work with both wd edit-item
and wd create-item
:
wd create-item
(possibly with tips if we use a format that allows comments #71)wd skeleton $id
<=> wd data --simplify --keep all
(with indented data output to ease edition)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
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
To emit the JSON format of edit/create-entity. I think this is the same as