The **quantity** property, when used as a qualifier for 'depicts', indicates the quantity of the thing-that-is-depicted
Example from wikidata https://www.wikidata.org/wiki/Q1195035 (see depicts > human > quantity, etc)
I can think of 3 different options for implementing searching on quantity
Option 1
We can store the qualifier in the normal way like this `P180=Q5[P1114=2]` (see T193407), in which case we would only be able to find exact matches. For example a user could search for images depicting exactly 1 cat, but could not search for images with >1 cats
Option 2
Store the data in a special data structure in elasticsearch. This would take a bit of speccing-out, and the we'd need to write specific code for only this qualifier, which would be tricky ... also elasticsearch is designed as a document search, and isn't really set up for integer comparisons
Option 3
Use the Wikidata Query Service (WDQS) to run a SPARQL query (which allows operators like `>` and `<`), and then use the ids as a filter for an elasticsearch query - basically we'd ask WDQS for all pictures depicting 'cat' with quantity qualifier >1, then search elasticsearch for anything else we wanted to search for but only among the (max 1000) IDs we got from WDQS.
The deepcat feature uses WDQS with elasticsearch, so we could base our approach on the deepcat code (see https://gerrit.wikimedia.org/r/#/c/405059/)
Note that there are currently **1025** items in wikidata that have a 'depicts' statement with a 'quantity' qualifier