-
Notifications
You must be signed in to change notification settings - Fork 75
ROBOT convert is stripping prefixes #1101
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
Comments
I can confirm this - and it is a bit annoying I must say; I am not sure if this was introduced with the latest OWLAPI update, but I would be surprised to not have noticed this issue in prior ROBOT versions. Workaround for the hackers in the meantime: After the conversion/serialisation, copy the old prefixes back, then open Protege and safe again. All good. Should be fixed though in our next ROBOT push - if there is a fix. I will add it to the Tech Support board so than @jamesaoverton does not need to concern himself with this now (unless he wants to). |
@matentzn You're saying that ROBOT is changing prefixes but Protege isn't? That would be strange. |
Yes. Exactly :) This input:
Results (with @dosumis command above) in this output:
Or this, if you serialise it to another serialisation:
|
But those prefixes aren't used in the content of the input, so I would not expect them to be included in the output. |
They are! obo! |
I can confirm that this behaviour changed with the OWLAPI update in ROBOT 1.9.2. In 1.9.1 and earlier, for this example the |
And Protege 5.6.1 is not dropping these prefixes. I don't understand. |
Prefixes are not lost when converting from .ofn or .owl to .owl (unless format is specified as something other than .owl) but they are for every other conversion I tested (.omn, .ofn, .owx., .ttl). I thought I might get around it by converting to .owl and then back to .ofn but that didn't work. |
As far as I can tell, the problem seems to have been introduced in OWL API 4.5.23. The following code: OWLOntologyManager man = OWLManager.createConcurrentOWLOntologyManager();
File inputFile = new File("issue-1101-input.ofn");
File outputFile = new File("issue-1101-output.ofn");
OWLOntology o = man.loadOntologyFromOntologyDocument(inputFile);
o.saveOntology(new FunctionalSyntaxDocumentFormat(), new FileOutputStream(outputFile)); yields no difference between input and output with OWL API 4.5.22 (I used as input the minimal example provided in this comment), while with OWL API 4.5.23 the |
@ignazio1977 is there any change you can think of that could have caused this to happen? Small oddity: Somehow the same does not happen with Protege. |
I opened a PR that fixes the issue. I'm kind of pressed for time at the moment—is anyone else able to add a test case to the PR? |
This comment from @allenbaron, and @balhoff's pull request to fix the issue, make me think the bug was there before. I remember writing similar fixes in the renderers for some formats, but not all. Basic issue is that, when converting formats, there are two format objects in play and the prefixes need copying across. No recent changes in that area, unless the latest patches that tweaked some obo behaviours also made these prefixes appear/disappear more often than usual? |
robot convert -i cl-edit.owl -f ofn -o tmp.owl
Before
After
This can => massive changes in diffs when used to reserialize.
The text was updated successfully, but these errors were encountered: