Lucas_Werkmeister_WMDE added a comment.

Well, it was blocked for a while on SparqlHelper, which can’t trivially be made into a service because it’s sometimes null.

The result of the discussion on Discourse was that there are two ways forward:

  • Hack: Add some kind of DummySparqlHelper which we use instead of null. All the checkers and other helpers which get a SparqlHelper injected and check if it’s null instead check if it’s a DummySparqlHelper. This is ugly, but fairly straightforward.
  • Proper solution: Refactor the code until we don’t need any such hacks. This will probably mean that there won’t be any such thing as a SparqlHelper; instead, there’ll be one TypeCheckerHelper with SPARQL support and one without it, one SPARQL-backed UniqueValueChecker and a dummy “can’t check this constraint” checker for the same constraint type, same thing for “format” constraints, etc.

The “proper solution” looks like it will require a lot of work, for relatively little benefit (cleaner code, I guess), and I’m still not totally sure what it should look like (for example, the code to actually do an HTTP request to the SPARQL endpoint and parse the response into JSON should probably still be unified, but where? that’s another service that should really be null when a SPARQL endpoint is not configured).

The “hack” shouldn’t be too complicated, I just haven’t done it yet. But that’s probably the easiest way forward for now, to unblock the rest of the services conversion.


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

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

To: Lucas_Werkmeister_WMDE
Cc: Aklapper, gerritbot, Addshore, Lucas_Werkmeister_WMDE, Ladsgroup, Gaboe420, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Lahi, Gq86, Baloch007, Darkminds3113, Bsandipan, Lordiis, GoranSMilovanovic, Adik2382, Jayprakash12345, Th3d3v1ls, Ramalepe, Liugev6, QZanden, LawExplorer, Salgo60, Lewizho99, Maathavan, Agabi10, Jonas, Izno, Wikidata-bugs, aude, Dinoguy1000, Lydia_Pintscher, Mbch331, Jay8g
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to