maxlath / wikibase-cli

read and edit a Wikibase instance from the command line
MIT License
226 stars 24 forks source link

Properties of a custom instance are not propagated #51

Closed almereyda closed 6 years ago

almereyda commented 6 years ago

In using some read commands, we encounter error due to different than expected properties:

λ wd claims Q219
the property P4 could not be found
run `wd props --reset` to refresh the local properties list
λ wd props --reset
properties reset
λ wd claims Q219
the property P4 could not be found
run `wd props --reset` to refresh the local properties list
maxlath commented 6 years ago

what's the output of wd props P4?

taniki commented 6 years ago

Same problem here

> wd claims Q2
the property P2 could not be found
run `wd props --reset` to refresh the local properties list

> wd props --reset
properties reset

> wd props Q2
{
  "P21": "sex or gender",
  "P866": "Perlentaucher ID",
  "P887": "based on heuristic",
  "P1347": "military casualty classification",
  "P1480": "sourcing circumstances",
  "P2421": "Prosopographia Attica",
  "P2460": "Persons of Ancient Athens",
  "P3000": "marriageable age",
  "P3226": "HAS member ID",
  "P3270": "compulsory education (minimum age)",
  "P3271": "compulsory education (maximum age)",
  "P4183": "angle from vertical",
  "P4312": "camera setup"
}
maxlath commented 6 years ago

which version of wikidata-cli are you using? with v6.1.2:

$ wd props --sparql-endpoint https://wikibase-registry-query.wmflabs.org/proxy/wdqs/bigdata/namespace/wdq/sparql

outputs:

{
  "P2": "Main Page",
  "P3": "Query Service UI",
  "P4": "SPARQL endpoint",
  "P5": "Creation date",
  "P6": "License",
  "P7": "Reference URL",
  "P8": "Commons Logo",
  "P9": "Project Specific Bug Tracker",
  "P10": "Reasonator URL",
  "P11": "Instance of"
}
taniki commented 6 years ago

6.1.1 the one coming with npm install -g wikidata-cli :)

taniki commented 6 years ago

I got the right answer when using the sparql endpoint though

>  wd props --sparql-endpoint http://w.11d.im:8989/bigdata/namespace/wdq/sparql
{
  "http://wikibase.svc/entity/P2": "type",
  "http://wikibase.svc/entity/P3": "source",
  "http://wikibase.svc/entity/P4": "produit par - à supprimer",
  "http://wikibase.svc/entity/P6": "produit par"
}
taniki commented 6 years ago

I am using the default configuration of the docker image

maxlath commented 6 years ago

there was a problem in the configuration value parsing, fixed by 5bfbf58. sorry @almereyda for the delayed fix

maxlath commented 6 years ago

patch published in v6.2.0, with a new feature in bonus

taniki commented 6 years ago

Hum. Not sure the problem has been resolved by last patch

$ export WD_INSTANCE=https://wikibase-registry.wmflabs.org/w/api.php ; wd claims Q2
the property P2 could not be found
run `wd props --reset` to refresh the local properties list
maxlath commented 6 years ago

the problem here is that properties data come from the SPARQL endpoint, so it needs to also be specified at the moment:

export WD_INSTANCE=https://wikibase-registry.wmflabs.org/w/api.php WD_SPARQL_ENDPOINT=https://wikibase-registry-query.wmflabs.org/proxy/wdqs/bigdata/namespace/wdq/sparql ; wd claims Q2

A future fix could be to only have to specify the instance, and the SPARQL endpoint would be found on https://wikibase-registry.wmflabs.org