-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split tags in their own attributes #131
Comments
I mainly agree here. Free tags have the great advantage to be extensive without any change in code but, if used without care it quickly leads to inconsistent system. To add a bit more example of the complexity of this:
More complicated, older zims never contains videos, but when starting to add videos in zims, we introduce the However, I agree with Kelson as he explained in another threads (#130), adding a new API for each new tags seems counter-productive. I like the idea of letting anyone create zim with tags they want and use those tags the way they want in the final application without any change in Saying that, I may have a beginning of solution (to be discussed) This way, we solve most (if not all) of our problems, keeping the constraints we want :
Comments ? :) * this method is wrongly named and should be getMetadata, but that's not the point here. |
I agree with @mgautierfr's approach. The only thing I want to make sure is we hide implementation detail to user of this library, so they don't have to parse the underlying backing data (whether it will be a encoded json, comma separated value or something else). Specifically, In libkiwix, In library.xml or future online library api, store meta data parsed in native xml or json format. |
What for sure will not happen is trying to build something which avoids inconsistencies because with tags we can have inconsistencies. Inconsistencies are ineherent to any open system, and ZIM publisher simply have to care about that. So point (2) of @automactic is a "no point" to me. |
Basically the plan is to:
We do not solve the problem with "old" ZIM files or ZIM files wrongly tags... but this is not a solvable problem to me. We should simply release more often to mitigate that problem. @mgautierfr I'm not in favor of a key=value system, sounds too complicated to me... and so far I'm not aware of any concrete use case/feature on reader level which is not doable with the current tag system (or an improved/normalised version of it). We have a similar problem with the filenames, even if the application should never rely on the filname to sort ZIM files. I will publish a plan regarding all of this and we will have an opportunity to talk about that again. Please keep this ticket open and be a bit patient. |
I have problem with this statement. Surely no system is perfect. But there is absolutely no reason for the designer not to try to avoid inconsistency happening. It is the same reason as why people use compilers and static checkers: catch errors as early as possible, at compile time, not at run time. If we do not try to create a system that reduce inconsistency, that leaves zim creators more hoops to jump, more stuff to check, the end product problematic. |
@kelson42, I understand you do not want to keep modifying libkiwix every time a new attribute is added. And I agree with you on this point. But we cannot simply throw stuff into tags when we cannot find a good place for some of those attributes. |
@automactic Yes, we can. You can do whatever you want with this system. If you can't, please provide a user story in an other ticket explaining clearly what you want to do from a user perspective (which means as Kiwix for iOS/MacOS developer). |
As mentioned in kiwix/kiwix-tools/issues/291, there are two concepts behind “a zim file”:
Ideally, catalog-manipulating tools should allow filtering on any of those Recording this data would allow us to implement ZIM search engines (on top of OPDS) and/or provide permalinks to content without using the UUID nor referencing the date (changing) nor hacking around the file names. |
We will carry on with our effort of renaming a few tags, see openzim/mwoffliner#485. A few ones will be "standardized", documented and/or "hidden tags" ready to be relied on in software. That said we will keep the idea that this stays a tag system with all its strengths and weaknesses. |
No tag means the full thing so with videos for instance, that maxi doesn't include (though it includes pictures). I don't know wikimed so there might be additional differences |
Tags are information stored in the zim file themselves and and can be found in the catalog (this is a opds catalog with different api endpoints, but if you want a simple xml feed with all information this is https://library.kiwix.org/catalog/v2/entries) The filename follow a different naming system, this is probably specified somewhere but I don't know where. @kelson42 may help here. |
Currently we identify the existence of picture, embedded index and video, etc with
tags
. I can see a few short comings with this approach.Clarity: Take picture as an example. When
tags
containsnopic
, we know it does not have picture. But whentags
does not containnopic
, the natural inference is we do not know if it has picture or not.Self-contradictory: If
tags
has valuenopic;pic
, what should we believe?Multiple Variances: No picture attribute can be expressed in many ways,
nopic
,no_pic
,_nopic
,NOPIC
,nopicture
,no_picture
,without_pic
, etc.Not self documenting: It is hard for someone who do not have experience with libkiwix to know what to test against. Suppose we have a zim file with "medicine" in tags, what exactly does it mean? Is this a zim file with only medicine related stuff or it just mean it has medicine article among many other topics?
I propose we separate tags into attributes or functions, for example:
kiwix::Reader::hasPicture -> bool
andkiwix::Reader::hasEmbeddedIndex -> bool
.The text was updated successfully, but these errors were encountered: