Lucas_Werkmeister_WMDE added a comment.

Ooooooh. I think I finally realized what’s happening. Let’s take The Private Life of Genghis Khan, a short story that gets constraint violations because it’s supposedly not a book.

  • The TypeCheckerHelper takes The Private Life of Genghis Khan’s P​31 statement – short story – and checks if it is a subclass of work.
  • Since the limit for type checks in PHP has not yet been reached, TypeCheckerHelper takes the first P​279 statement – prose – and checks if that is a subclass of work.
  • TypeCheckerHelper descends into prose’s type hierarchy. Eventually, at some unknown superclass (say, literary genre), it reaches the limit for type checks.
  • Since the limit has been reached and a SparqlHelper is configured, TypeCheckerHelper falls back to SPARQL. It asks if literary genre is a subclass of work.
  • SPARQL tells us (correctly) that literary genre isn’t a subclass of work.
  • TypeCheckerHelper walks back the stack of subclass checks, returning false on each level. At no level is the SparqlHelper consulted again, because we don’t want to spam WDQS.
  • Eventually, TypeCheckerHelper has fallen back to short story. It checks the next P​279 statement: literary work.
  • Since the limit for type checks has already been exceeded, the check returns false immediately (and since the limit was already exceeded earlier, not in this call, the SPARQL fallback doesn’t happen either).
  • In the end, TypeCheckerHelper returns false for the overall check.

The SPARQL fallback needs to happen at the outermost level, not at the first subtype check that exceeds the limit.


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

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

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

Reply via email to