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

improvements for creating and editing properties, removal of aliases #19

Merged
merged 3 commits into from Apr 24, 2021

Conversation

frog23
Copy link
Contributor

@frog23 frog23 commented Apr 19, 2021

this combines three commits which increase capabilities of quickstatements:

  • the labels, descriptions and aliases of properties can be edited
  • aliases in general can be removed
  • properties can be created (this is not so much relevant for wikidata.org, but for independent wikibase installations)

Quickstatements fails when trying to edit labels, descriptions and aliases of properties. This fixes the issue. 
see also https://bitbucket.org/magnusmanske/wikidata-todo/issues/112/
It is currently not possible to create new properties using QS. For wikidata.org, this is not an issue, as property creation is limited to admins and follows formal rules. However with the integration of QS in the wikibase docker image, there is now an increasing amount of wikibase repositories where automated property creation with QS is a useful approach.

There are certainly ways to improve this, like checking if the datatypes are valid or in the correct case (the API is case sensitive in this regard, all types are lowercase with the exception of “commonsMedia“)
Creating a new property using QuickStatements would then look like this:

CREATE_PROPERTY|string
LAST|Len|"QS Property"
LAST|Den|"a property that was created using QuickStatements"
LAST|Aen|"QuickStatements Property"
LAST|P1450|en:"some text describing the content"

For the editing of label, description and alias of properties, see 4622f78
See also https://bitbucket.org/magnusmanske/wikidata-todo/issues/113/
It is currently not possible to remove an specific alias using QuickStatements, while it is possible to do this using the API.

To remove an alias, one can now use the QS syntax:
-Q4115189|Aen|"wrong alias"

see also https://bitbucket.org/magnusmanske/wikidata-todo/issues/114/
@toban
Copy link

toban commented Apr 22, 2021

Hello!

I can confirm that this fixes issues with label, description and properties for the wikibase-docker images.

I've spent most of today writing tests for quickstatements that is included in the wikibase bundle and have a pull request up here with the newly added tests.

I've we compare this is a run on master of this repository https://github.com/wmde/wikibase-release-pipeline/runs/2411450022?check_suite_focus=true

line 4621 of test_wikibase (mysql:5.6, quickstatements)

 [Chrome Headless 86.0.4240.111 linux #0-1] Spec: /usr/src/app/specs/quickstatements/quickstatements.js
[Chrome Headless 86.0.4240.111 linux #0-1] Running: Chrome Headless (v86.0.4240.111) on linux
[Chrome Headless 86.0.4240.111 linux #0-1] Session ID: 168dd90b-a123-4e44-8fd3-5655423f9bd3
[Chrome Headless 86.0.4240.111 linux #0-1]
[Chrome Headless 86.0.4240.111 linux #0-1] QuickStatements Service
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to load the start page
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to create a property in wikibase
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to log in
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to create a two items
[Chrome Headless 86.0.4240.111 linux #0-1]    ✖ Should be able to add a alias to an item
[Chrome Headless 86.0.4240.111 linux #0-1]    ✖ Should be able to add a label to an item
[Chrome Headless 86.0.4240.111 linux #0-1]    ✖ Should be able to add a description to an item
[Chrome Headless 86.0.4240.111 linux #0-1]    - Should be able to add a sitelink to an item
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to add a property to a item
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to add statement with qualifiers
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to add a property with references
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to create another item and add a property
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to add and remove a property on an item
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to merge two items
[Chrome Headless 86.0.4240.111 linux #0-1]
[Chrome Headless 86.0.4240.111 linux #0-1] 10 passing (2m 32s)
[Chrome Headless 86.0.4240.111 linux #0-1] 3 failing
[Chrome Headless 86.0.4240.111 linux #0-1] 1 skipped
[Chrome Headless 86.0.4240.111 linux #0-1]
[Chrome Headless 86.0.4240.111 linux #0-1] 1) QuickStatements Service Should be able to add a alias to an item
[Chrome Headless 86.0.4240.111 linux #0-1] The expression evaluated to a falsy value:

When applying the patch and run the tests the expected things now work.
https://github.com/wmde/wikibase-release-pipeline/pull/147/checks?check_run_id=2411536566

line 4602

[Chrome Headless 86.0.4240.111 linux #0-1] Spec: /usr/src/app/specs/quickstatements/quickstatements.js
[Chrome Headless 86.0.4240.111 linux #0-1] Running: Chrome Headless (v86.0.4240.111) on linux
[Chrome Headless 86.0.4240.111 linux #0-1] Session ID: e749b5b3-e6fd-4780-b93f-ef715cf00a1d
[Chrome Headless 86.0.4240.111 linux #0-1]
[Chrome Headless 86.0.4240.111 linux #0-1] QuickStatements Service
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to load the start page
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to create a property in wikibase
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to log in
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to create a two items
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to add a alias to an item
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to add a label to an item
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to add a description to an item
[Chrome Headless 86.0.4240.111 linux #0-1]    - Should be able to add a sitelink to an item
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to add a property to a item
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to add statement with qualifiers
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to add a property with references
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to create another item and add a property
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to add and remove a property on an item
[Chrome Headless 86.0.4240.111 linux #0-1]    ✓ Should be able to merge two items

However I haven't tested the additional functionality, maybe the fix and the added feature should go in separate pull-requests?

@magnusmanske magnusmanske merged commit 9079e2c into magnusmanske:master Apr 24, 2021
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

Successfully merging this pull request may close these issues.

None yet

3 participants