Background:
Elastic searched improved allowing filtering for statements now.
E.g. haswbstatement:P279=Q21502402
https://www.wikidata.org/w/index.php?search=haswbstatement%3AP279%3DQ21502402
API:
https://www.wikidata.org/w/api.php?action=query&list=search&srsearch=haswbstatement%3AP279%3DQ21502402
Constraints definitions on properties like 'one-of constraint' and 'type' provide suggestions
e.g. https://www.wikidata.org/wiki/Property:P21#P2302
We would like to investigate how current item suggester for property values could be improved by using that new elastic feature and constraint definitions on properties.
As a user I would like to see those items suggested first that that don't violate the constraint checks, so I can easily chose the right item.
GIVEN I am on a property page.
WHEN I add a property 'property constraint' (P2302)
AND I focus the input field and enter 'single'
THEN I would like to see items with 'subclass of' 'property constraints' suggested and text 'single' first
GIVEN I am on a property page.
WHEN I add a property 'property constraint' (P2302)
AND I focus the input field for the property value
THEN I would like to see items with 'subclass of' 'property constraints' suggested
Relevant JS files:
repo/resources/experts/Entity.js
view/resources/jquery/wikibase/jquery.wikibase.entityselector.js