Skip to content
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

diff feature request: sort axioms in Added and Removed sections in Markdown output #1192

Open
jclerman opened this issue Apr 5, 2024 · 4 comments

Comments

@jclerman
Copy link
Contributor

jclerman commented Apr 5, 2024

Currently the Markdown output of robot diff ... -f markdown seems to randomly order the lines under "Added" or "Removed" for each changed entity (e.g., class).

I think the output would be much easier to read (and compare, when needed) if it had a canonical sort-order for those lines. I'd prefer an order like:

  • declaration axiom
  • equivalency axiom(s)
  • subclass axiom(s)
  • annotation axioms, themselves sorted by
    • annotation property label
    • value
@jamesaoverton
Copy link
Member

I believe that https://github.com/balhoff/owl-diff is doing the work for ROBOT here. Do you have suggestions @balhoff ?

@balhoff
Copy link
Contributor

balhoff commented Apr 8, 2024

I agree that a standard ordering would make sense. I'm not sure how quickly I can get to that—PRs are definitely welcome.

@jclerman
Copy link
Contributor Author

I was looking at this over the weekend. If I understand the code correctly, the lines that govern the sort-order within each altered OWL entity (for MarkDown output, anyway) are https://github.com/balhoff/owl-diff/blob/master/src/main/scala/org/geneontology/owl/differ/render/MarkdownGroupedDiffRenderer.scala#L41-L43. I'm not sure if I'm getting that right though, since in my hands, the sort seems to be random, whereas that code suggests that some ordering is expected.

@balhoff, should I open an issue against https://github.com/balhoff/owl-diff to track this request?

@balhoff
Copy link
Contributor

balhoff commented Jun 10, 2024

@balhoff, should I open an issue against https://github.com/balhoff/owl-diff to track this request?

@jclerman that sounds good. Looking at it, I think the lines are "mostly sorted". It looks like annotations should be in alphabetical order by their toString representation, and overall axioms are in alphabetical order by their axiom type (but things like subclass axioms may not be reliably sorted against each other). I think your ordering makes sense except that I would prefer the annotation axioms to come after the declaration axiom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants