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 DETAIL
https://phabricator.wikimedia.org/T193634

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

To: Lucas_Werkmeister_WMDE
Cc: Lucas_Werkmeister_WMDE, Aklapper, Lahi, Gq86, GoranSMilovanovic, lisong, QZanden, LawExplorer, Agabi10, Wikidata-bugs, aude, Lydia_Pintscher, Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to