-
Notifications
You must be signed in to change notification settings - Fork 75
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
Use owl-diff library for diff operation. Add markdown and html diff output formats. #461
Conversation
Perfect timing as we work on making the "end parts" of the release pipeline (diff for release notes and publishing large files to github) easier here: INCATools/ontology-development-kit#205 |
@cmungall please take a look at the Markdown output and let me know if I can make any improvements. |
Thanks @balhoff. Are we using other Scala stuff in ROBOT already? Does the dependency on |
@jamesaoverton I think this is the first Scala dependency. The change to |
robot-command/src/main/java/org/obolibrary/robot/DiffCommand.java
Outdated
Show resolved
Hide resolved
robot-core/src/main/java/org/obolibrary/robot/DiffOperation.java
Outdated
Show resolved
Hide resolved
As well as getting complete diffs, it's useful to get simple lists e.g of new terms and of obsoleted terms. These are particularly useful for including in release notes, e.g https://github.com/EnvironmentOntology/envo/releases Should there be separate report types? Having a JSON format could also be useful, particularly for summary stats and lists Would the logic for this reside in owl-diff, robot, or external? The way James Malone had bubastis work had a nice separation of logic, with the html generated from xslt. Here it could be something like mustache. But I think this can be done incrementally, I am good with merging this cc @lpalbou |
@balhoff I would like to merge this, but there are a few small things that still need to be resolved. |
Thanks for the reminder, @jamesaoverton, I have been meaning to finish this up. Will do so soon. |
…to reflect URI shortening.
@jamesaoverton @rctauber this should be ready now. |
The I have two suggestions and a problem. To keep the old behaviour we could either/both:
When I tried to do implement (1) by using just labels and not CURIEs, it broke the |
I like the idea of having an open-ended list of formats. This could be orthogonal to whether CURIEs, URIs are used; and orthogonal to whether the markdown uses I don't think we want to get boxed in by early formatting choices. I think we will learn more as people use this feature and we will want to incorporate new formats or options. Also if we have a standard JSON people can easily customize the display layer as they like. [edited original comment as I realized I was repeating myself] |
@jamesaoverton I was trying to address this comment from @rctauber:
We could go back to the previous output (which I think did automatically shorten some IRIs, such as owl:Thing). For your label issue, we ought to be able to create a label provider with an alternative backup using this constructor. |
Ok, I added a |
This sounds pretty good. I think now |
Yes, |
Thanks for the PR. It's nice to have Markdown and HTML formats supported, at long last! I'm happy to include more formats. |
This addresses some of the issues in #432, especially "separate diff logic from diff rendering". It also includes a Markdown diff rendering, although currently different levels of granularity are not configurable.
Diff in this PR is implemented by calling out to functionality in my owl-diff library, which is also used in the owl-diff server. This diff is faster than the old version (I think the main slowdown in the old one was rendering of all axioms to string before performing comparisons). Also, label rendering in the simple output is done with a custom ShortFormProvider rather than regex operations.
This version passes the existing tests, although I made one small change to one test data file to correct what I believe to be an inconsistency in CURIE rendering in the previous code.