owlcs / owlapi

OWL API main repository
821 stars 315 forks source link

OBO serializer incorrectly quoting IRI property values #1085

Closed hkir-dev closed 1 year ago

hkir-dev commented 1 year ago

Fix for the issue #1083

In relation with the OBO Specification of the property_value, this fix serializes IRI values without the double quotes.

property_value This tag binds a property to a value in this instance. The value of this tag is a relationship type id, a space, and a value specifier. The value specifier may have one of two forms; in the first form, it is just the id of some other instance, relationship type or term. In the second form, the value is given by a quoted string, a space, and datatype identifier. See IDs for more information on legal datatype identifiers.

In order to distinguish IRI values from the quoted string values, heuristic approach applied in the OWLAPIObo2Owl is replicated:

If Clause has 2 values then it is `relationship type id` + `IRI`. 
If Clause has 3 values then it is `relationship type id` + `value in quoted strings` + `datatype identifier`
matentzn commented 1 year ago

@ignazio1977 Happy New Year! :) Hope all is well!

No pressure (this is our problem not yours), but this issue is a super high priority issue for us. Not just this PR, but also getting it right this time, because we cannot delay our migration to the new Protege any longer..

Do you think you will find time to handle this PR in the next week? If not, can you advice us how/if it can be handled somehow without you?

ignazio1977 commented 1 year ago

@matentzn happy new year to you too. I'll sort this out today.

ignazio1977 commented 1 year ago

@matentzn @hkir-dev this pull request was against version 5 of OWLAPI, which will be going out with Java 11 support and is not the one Protege uses (far as I'm aware), I imagine you need the change cherry picked to the version4 branch? I'll do that anyway, just making sure of which version you need the fix in.

hkir-dev commented 1 year ago

@ignazio1977 the new Protege release will be using OWLAPI 4.5.22. If you are overloaded, I can quickly create a PR on that branch as well.

ignazio1977 commented 1 year ago

@hkir-dev no problem, I've done the cherry pick and I'm building 4.5.23 now

ignazio1977 commented 1 year ago

4.5.23 and 5.5.0 have been released, just waiting for sonatype to sync with maven central

matentzn commented 1 year ago

This is absolutely amazing, thank you both for that insanely fast turnaround!!