Smalyshev added a comment.

So I would like to see the id conversion documented in BOTH directions

This is a bit trickier. The reason is that RDF has particular requirements for URIs, which makes it much easier if the URI does not contain "bad" characters - among which is '$'. However, RDF export does not impose a specific format onto Wikibase core - and indeed, this would be wrong, export format should not control internal format. So there could be two strategies here:

  1. Ensure that internal ID format is such that no export format would have issues with it. Purely alphanumeric and alphanumeric with dashes has a good chance for success here, but there are no guarantees no export format ever would have problems with dashes, for example.
  1. Have each export format transform internal ID into what is safe for its particular case, recognizing that this transformation may not be one-to-one for all spectrum of possible IDs.
  1. Have export format transform internal ID as above, but promise it will always be one-to-one, no matter what happens with internal IDs.

(2) is what we have now, (3) is what you are proposing. The problem here is for this to work, core code should always be aware of all export formats and all transformations happening there, moreover, both core internal ID format and each export transformation becomes the part of the API. With dependencies it creates, it is no different in complexity than (1) anymore, but done in a more convoluted way.

It is possible, of course, to say that the current situation is what is happening - after all, that's the truth and nothing but the truth. However, saying that this will always be the situation creates some dependencies inside the code that do not look good from the design perspective and would be rather hard to maintain in reality.


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

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

To: Smalyshev
Cc: Smalyshev, Lydia_Pintscher, Liuxinyu970226, Aklapper, Lucas_Werkmeister_WMDE, ArthurPSmith, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, EBjune, merbst, LawExplorer, _jensen, Jonas, Xmlizer, jkroll, Wikidata-bugs, Jdouglas, aude, Tobias1984, Manybubbles, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to