CommunityTechBot updated the task description. (Show Details)

CHANGES TO TASK DESCRIPTION
26570726f6475636520796f757220627567207573696e67206120726563656e742076657273696f6e206f662074686520736f6674776172652c20746f2068652077696b6920636f6e74656e74206c616e67756167652e0a0a5468616e6b20796f752e0a546167730a436865636b557365720ad70a436f6e6e65637465642d4f70656e2d48657269746167652d42617463682d75706c6f61647320285241c42d4b4d425f315f323031372d3032290ad70a54616d696c2d53697465730ad70a47616d6570726573730ad70a48617368746167730ad70a4a4144450ad70a4b6172746f456469746f720ad70a4c616e67756167652d323031382d4170722d4a756e650ad70a4e65772d456469746f722d457870657269656e6365730ad70a4d61696c0ad70a5443422d5465616d0ad70a53756273637269626572730a4465736372697074696f6e20507265766965770a436f6e74656e77a6f6e652073657474696e6720696e20796f75722070726f66696c652c20636c69636b20746f207265636f6e63696c652eThe **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)

We want users to be able to include quantities in their searches - for example to find images depicting >10 people (probably with a search term like `haswbstatement:P180=Q5[P1114>10]`), or exactly one cat (`haswbstatement:P180=Q146[P1114=1]`).

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 an individual numeric field in elasticsearch, and come up with some kind of hack to relate the numeric quantity to a specific 'depicts' statement. Tricky, and not even sure it's possible

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. Note that because of limitations passing data between WDQS and elasticsearch there will be edge cases where no results will be returned even if appropriate results exist.

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/)

This option depends on T194401

-----

Note that there are currently **1025** items in wikidata that have a 'depicts' statement with a 'quantity' qualifier out of a total of ~70k items with depicts statements (~1.5%)

TASK DETAIL
https://phabricator.wikimedia.org/T194245

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: CommunityTechBot
Cc: Stashbot, dcausse, Ramsey-WMF, Cparle, AndyTan, Gaboe420, Zylc, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, 1978Gage2001, Lahi, PDrouin-WMF, Gq86, Baloch007, E1presidente, Darkminds3113, SandraF_WMF, Bsandipan, Lordiis, herron, GoranSMilovanovic, Adik2382, Chicocvenancio, alanajjar, Th3d3v1ls, Ramalepe, Liugev6, QZanden, EBjune, Tbscho, Tramullas, Acer, V4switch, LawExplorer, Lea_WMDE, Mattias_Ostmar-WMSE, Lewizho99, Culex, JJMC89, Maathavan, Jseddon, Ryuch, Mkdw, RuyP, JEumerus, Trizek-WMF, Susannaanas, KasiaWMDE, 0x010C, srodlund, Wong128hk, Luke081515, grin, Bsadowski1, Aschroet, mys_721tx, Jane023, Wikidata-bugs, Snowolf, Base, matthiasmullie, aude, Huji, Gryllida, jayvdb, Ricordisamoa, Tobi_WMDE_SW, Lydia_Pintscher, Fabrice_Florin, Raymond, revi, scfc, He7d3r, Romaine, Steinsplitter, Matanya, Mbch331, Jay8g, Glaisher, Krenair, chasemp
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to