HUPO-PSI / psi-mod-CV

Reactivated PSI-MOD ontology for molecular mass modifications
Creative Commons Attribution 4.0 International
8 stars 13 forks source link

Consider using property-value for annotated properties #63

Closed althonos closed 2 years ago

althonos commented 2 years ago

Hi!

I suppose this is caused by OBO-edit, but the current way of declaring the properties for modified residues using Xrefs is not giving a very useful translation in OWL2, because the resulting property value ends as an rdf:label.

The proper way to add annotations would be to use property-value clauses, also allowing for the datatype to be specified:

[Term]
id: MOD:00007
name: selenium substitution for sulfur
property_value: DiffAvg "46.91" xsd:float

which will have ROBOT translate the result in a correct OWL2 annotation, considering DiffAvg as an annotation property (it would be even better to use OWL2 data properties instead but there is no way to do that from an OBO document... yet).

edeutsch commented 2 years ago

So you advocate that we change this:

xref: DiffAvg: "46.91"
xref: DiffFormula: "C 0 H 0 N 0 O 0 S -1 Se 1"
xref: DiffMono: "47.944450"
xref: Formula: "none"
xref: MassAvg: "none"
xref: MassMono: "none"
xref: Origin: "X"
xref: Source: "natural"
xref: TermSpec: "none"
xref: Unimod: "Unimod:162"

to this:

property_value: DiffAvg: "46.91"
property_value: DiffFormula: "C 0 H 0 N 0 O 0 S -1 Se 1"
property_value: DiffMono: "47.944450"
property_value: Formula: "none"
property_value: MassAvg: "none"
property_value: MassMono: "none"
property_value: Origin: "X"
property_value: Source: "natural"
property_value: TermSpec: "none"
xref: Unimod: "Unimod:162"

?

Maybe to be minimally disruptive, we can apply this transformation in a temp file prior to the obo to owl conversion with ROBOT?

althonos commented 2 years ago

Actually, the following would be the right way:

property_value: DiffAvg "46.91" xsd:string
property_value: DiffFormula "C 0 H 0 N 0 O 0 S -1 Se 1" xsd:string
property_value: DiffMono "47.944450" xsd:string
property_value: Formula "none" xsd:string
property_value: MassAvg "none" xsd:string
property_value: MassMono "none" xsd:string
property_value: Origin "X" xsd:string
property_value: Source "natural" xsd:string
property_value: TermSpec "none" xsd:string
xref: Unimod:162

I also understand that the mod.obo is probably consumed by files that make assumption about the old format, so it's not entirely trivial to reformat the entire file. But for instance, this would make looking at PSI-MOD in Protégé a bit more informative! So if you can make it work for the OWL file by using an intermediate temp file, that would be great indeed :smiley:

mobiusklein commented 2 years ago

A short script could fix that, especially if we automatically update the OWL file when the OBO file changes.

edeutsch commented 2 years ago

This sounds great to me.

I am also wondering about

property_value: DiffMono "47.944450" xsd:string

Should we consider transforming this to:

property_value: DiffMono 47.944450 xsd:float

?

althonos commented 2 years ago

Actually, yes, but with quotes, so:

property_value: DiffMono "47.944450" xsd:float

(The OBO 1.4 Syntax states that the value should always be between quotes, for now ROBOT and the OWL API accept values without quote but this may change in the future).

pabinz commented 2 years ago

Hi all, I’m in principle not against doing the shift from xref to property_value, but do we have a clear view on the impact on existing parsers? This change would need a major version number change, correct? Pierre-Alain

De : Eric Deutsch @.> Envoyé : samedi 12 février 2022 06:49 À : HUPO-PSI/psi-mod-CV @.> Cc : Subscribed @.***> Objet : Re: [HUPO-PSI/psi-mod-CV] Consider using property-value for annotated properties (Issue #63)

This sounds great to me.

I am also wonder about

property_value: DiffMono "47.944450" xsd:string

Should we consider transforming this to:

property_value: DiffMono 47.944450 xsd:float

?

— Reply to this email directly, view it on GitHubhttps://github.com/HUPO-PSI/psi-mod-CV/issues/63#issuecomment-1037006435, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AESGSRTVDF5EZMB3I5L2X33U2XYDTANCNFSM5OEUGMCQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you are subscribed to this thread.Message ID: @.**@.>>

rfellers commented 2 years ago

Hi everyone,

Yes, indeed, this would break all of our OBO parsers. But I also feel that the proposed syntax is much better (xref always seemed strange to me), so I'm in favor of switching things if it helps with downstream compatibility. Is there a policy or existing example of obsoleting a term/tag? Might something like the following be appropriate?

  1. Leave the existing xrefs in place, but add "matching" property_value tags
  2. Mark the xrefs as obsolete (is there syntax to do this?)
  3. Wait 3/6/12 months and drop the xrefs
mobiusklein commented 2 years ago

I think what we were discussing is to leave the OBO as-is, but during OWL generation replace xref with property_value as an intermediate step. So the OBO remains the same, but the OWL is changed.

A short script would read the OBO line by line emitting most lines unchanged but when it finds an xref line, determine the data type from the name and write a property_value line instead. Then convert that stream into OWL instead of the original OBO. This would be built into the update process too by adding a Github Action that runs any time someone commits a change to the OBO file.

edeutsch commented 2 years ago

Agreed, I was proposing to do the transformation in a temp file rather than in the main OBO file. The main OBO file would retain the same tags as we have now at least for a while.

It occurs to be that it might be easy and useful to also provide this "temp file" in the repo. If we think the way forward long term is with the newer style, maybe we could make the product PSI-MOD-newstyle.obo available as well for those who want to start using it. Eventually we might move permanently to the new style.

althonos commented 2 years ago

I have written a small Python script that will generate the newstyle file from the old-style one using the fastobo library, I can make a PR if you want!

edeutsch commented 2 years ago

A PR sounds great! Thank you for contributing!

mobiusklein commented 2 years ago

@althonos I've merged your PR and incorporated it into an automatic release process which runs whenever PSI-MOD.obo is modified, generating the new-style OBO and the OWL file from that new-style OBO.

Thank you for writing the conversion script, and for your continued work on fastobo. Please let us know if the OWL still looks correct yo you.

althonos commented 2 years ago

@mobiusklein : happy to hear this, thanks a lot! I'll be using the OWL file to build another ontology so if I spot any other bug or think about an improvement I'll make sure to report it as well.