[Wikidata-bugs] [Maniphest] [Commented On] T193634: Refactor Context::getSnakGroup

2018-05-08 Thread gerritbot
gerritbot added a comment.
Change 431575 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add separators parameter to Context::getSnakGroup()

https://gerrit.wikimedia.org/r/431575TASK DETAILhttps://phabricator.wikimedia.org/T193634EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Lucas_Werkmeister_WMDE, gerritbotCc: gerritbot, Lucas_Werkmeister_WMDE, Aklapper, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Lahi, Gq86, Baloch007, Darkminds3113, Bsandipan, Lordiis, GoranSMilovanovic, lisong, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, QZanden, LawExplorer, Lewizho99, Maathavan, Agabi10, Wikidata-bugs, aude, Lydia_Pintscher, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T193634: Refactor Context::getSnakGroup

2018-05-07 Thread gerritbot
gerritbot added a comment.
Change 431575 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add separators parameter to Context::getSnakGroup()

https://gerrit.wikimedia.org/r/431575TASK DETAILhttps://phabricator.wikimedia.org/T193634EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Lucas_Werkmeister_WMDE, gerritbotCc: gerritbot, Lucas_Werkmeister_WMDE, Aklapper, Lahi, Gq86, GoranSMilovanovic, lisong, QZanden, LawExplorer, Agabi10, Wikidata-bugs, aude, Lydia_Pintscher, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T193634: Refactor Context::getSnakGroup

2018-05-07 Thread Lucas_Werkmeister_WMDE
Lucas_Werkmeister_WMDE added a comment.
Well, wait a second. Not only do the checkers not need the separating snaks… I don’t think they really need the other snak groups (other than the one that the current snak is in) either. So really – do we need to change the return type at all? Can’t we just keep it at returning the current snak group as an array? (That probably also simplifies the implementation a lot.)TASK DETAILhttps://phabricator.wikimedia.org/T193634EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Lucas_Werkmeister_WMDECc: Lucas_Werkmeister_WMDE, Aklapper, Lahi, Gq86, GoranSMilovanovic, lisong, QZanden, LawExplorer, Agabi10, Wikidata-bugs, aude, Lydia_Pintscher, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T193634: Refactor Context::getSnakGroup

2018-05-07 Thread Lucas_Werkmeister_WMDE
Lucas_Werkmeister_WMDE added a comment.
Okay, I think the new interface could be:


getSnakGroup is renamed to getSnakGroups.
It gains an additional parameter, a list of property IDs (possibly empty): the separators.
It returns not a list of snaks, but a list of SnakGroup objects. SnakGroup is a new class holding two lists of snaks: the group itself (sibling statement main snaks, other qualifiers, etc.), and the separators (the qualifiers in case of statement contexts,  empty everywhere else).


The checkers can then check the cardinality of each SnakGroup returned and report an error for any group with incorrect cardinality, using the properties of the separators in the error message.

Technically, I don’t think the checkers actually need all of this information: it would probably be enough to return a list of snak lists (Snak[][]) from getSnakGroups. But I think this will be easier to understand, test and debug if we introduce a dedicated class for the results.TASK DETAILhttps://phabricator.wikimedia.org/T193634EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Lucas_Werkmeister_WMDECc: Lucas_Werkmeister_WMDE, Aklapper, Lahi, Gq86, GoranSMilovanovic, lisong, QZanden, LawExplorer, Agabi10, Wikidata-bugs, aude, Lydia_Pintscher, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs