The **inscription** property refers to ‘inscriptions, markings and signatures on an object' and is of type ‘monolingual text’
When used as a qualifier with 'depicts' it refers to markings on the thing-that-is-depicted - example from wikidata https://www.wikidata.org/wiki/Q1136099 (see depicts > Province of New York > inscription, etc.)
The example I've been using to model this conceptually is band t-shirts - an image could depict a t-shirt with 'The Rolling Stones' written on it, and a user might want to find all images containing pictures of Rolling Stones t-shirts
I can think of 3 different ways of implementing this, all with drawbacks/tradeoffs
Option 1
We can store the qualifier in the normal way like this `P180=Q131151[P1682=The Rolling Stones]` (see T193407), in which case we would only be able to find **exact matches**. For example searching for `haswbstatement:P180=Q131151[P1682=Stones]` won't match `P180=Q131151[P1682=The Rolling Stones]`.
Option 1a
Perhaps we could pass a regex to the `haswbstatement` keyword?
Option 2
Implement a specific elasticsearch solution just for this qualifier - for example we could store the inscription in a fulltext field, which would mean a partial match would work. It'd be tricky to do, because we'd need to treat one qualifier differently to all the others both when we were indexing and when we're searching. Also if we did it this way I'm not sure how to store the fact that the inscription relates to a particular 'depicts' tag (or even if that'd be possible) - so someone could try and search for pictures containing Rolling Stones t-shirts and some of their results would contains blank t-shirts plus some //other// object with the text 'The Rolling Stones' inscribed on it.
Option 3
Another possible approach is to use the Wikidata Query Service (WDQS) to run a SPARQL query, and then use the ids as a filter for an elasticsearch query - basically we'd ask WDQS for all pictures depicting a t-shirt inscribed with 'The Rolling Stones', take all the resulting IDs, and then search elasticsearch for anything else we wanted to search for but only among the (max 1000) IDs we got from WDQS.
Option 1 is easiest, but only does exact matches unless the regex idea (option 1a) works, which might be difficult to implement on the frontend in a user-friendly way
Option 2 is tricky to implement, and may not return exactly correct data, but would probably be more performant than option 3
Option 3 is in-between, implementation-wise. Probably the slowest to run, results will be more accurate than option 2 but because of limitations with passing data between WDQS and elasticsearch it will be possible to miss stuff
So - we need to do some thinking on which is the preferred option, and given that wikidata currently contains **only 7** items with depicts statements that have inscription qualifiers we'd want to be pretty sure the community actively wants this before embarking on it.
https://query.wikidata.org/sparql?query=SELECT%20DISTINCT%20%3Fitem%20%3FitemLabel%20%3Finscription%20%3FinscriptionLabel%20WHERE%20%7B%20%3Fitem%20p%3AP180%20%5B%20pq%3AP1684%20%3Finscription%20%5D.%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%7D&format=json