FoodOntology / foodon

The core repository for the FOODON food ontology project. This holds the key classes of the ontology; larger files and the results of text-mining projects will be stored in other repos.
Creative Commons Attribution 4.0 International
177 stars 36 forks source link

degenerate obsolescence/deprecation patterns #311

Open turbomam opened 3 months ago

turbomam commented 3 months ago

I consider "true"^^xsd:boolean to be the only acceptable value for owl:deprecated but I don't have any citation for that yet. It does make up 99.95% of the deprecation values that appear in Ubergraph.

FoodOn has one xsd:string triple

FOODON:00004474  owl:deprecated "A cutting process which outputs sliced material."@en .

and multiple "true"@en triples

turbomam commented 3 months ago
    <owl:Class rdf:about="&obo;FOODON_00004474">
        <rdfs:subClassOf rdf:resource="&obo;FOODON_00000071"/>
        <dcterms:contributor rdf:resource="https://orcid.org/0000-0002-8844-9165"/>
        <dcterms:date rdf:datatype="&xsd;dateTime">2023-08-01T23:32:07Z</dcterms:date>
        <rdfs:label xml:lang="en">slicing process</rdfs:label>
        <owl:deprecated xml:lang="en">A cutting process which outputs sliced material.</owl:deprecated>
    </owl:Class>
turbomam commented 3 months ago
    <owl:Class rdf:about="&obo;FOODON_00002123">
        <rdfs:subClassOf rdf:resource="&owl;Thing"/>
        <obo:IAO_0000231>Redundant entry, already have &apos;alcoholic beverage&apos; and both have the parent class &apos;plant derived fermented beverage&apos;</obo:IAO_0000231>
        <obo:IAO_0100001 rdf:resource="&obo;FOODON_00001579"/>
        <rdfs:label xml:lang="en">obsolete: plant based alcoholic beverage</rdfs:label>
        <owl:deprecated xml:lang="en">true</owl:deprecated>
    </owl:Class>
oldskeptic commented 3 months ago

@turbomam By definition of (one of) the spec, it should be a boolean. Comically, OWL1 defines it as:

owl:deprecated a owl:AnnotationProperty ;
     rdfs:label "deprecated" ;
     rdfs:comment "The annotation property that indicates that a given entity has been deprecated." ;
     rdfs:domain rdfs:Resource ;
     rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
     rdfs:range rdfs:Resource . 

I can't find a formal definition for the owl2 version of this, but owl:deprecated is an axiom that is generated by owl:DeprecatedClass or owl:DeprecatedProperty according to the OWL2 Quick Reference Guide.

I personally do both and add the owl:equivalentClass to link to the new version as per the recommendation.

An older well known but undocumented standard is the use of <vs:term_status xml:lang="en"> deprecated </vs:term_status> for document generators.

My short answer, let's switch it to a owl:DeprecatedClass, add owl:equivalentClass to point to new class and use something like ...skos:changeNote?

turbomam commented 3 months ago

Thanks for the fast reply. Do you do Slack? There's been some good deprecation discussion here today: https://app.slack.com/client/T01BAB621JR/C01BDKWDS91

ddooley commented 3 months ago

Anything in FoodOn except "true"^^xsd:boolean is an accident, so I'll fix those asap! All our deprecations are in a separate file so shouldn't be hard to fix.

ddooley commented 3 months ago

Deprecations now fixed and will be updated with new release shortly.

I'd like to stick to the OBO Foundry deprecation set of recommendations. obo:IAO_0000231 is the "has obsolescence reason" which occasionally gets entered. But in the case of a replacement I haven't bothered, since the replacement itself seems the obvious reason. It seems to me owl:deprecated is the only signal structure needed, and the DeprecatedClass and DeprecatedProperty were some kind of attempt to isolate a deprecated item without having to change the relationships connecting that term? But I'm willing to do whatever OBO Foundry deems best!

For cases of obo:IAO_0100001 “term replaced by” deprecations in theory I can see why one might add an equivalence to facilitate merging with old data; however this seems to break the “no direct equivalencies allowed” ontology validation rule ODK runs.

oldskeptic commented 3 months ago

DeprecatedClass and DeprecatedProperty are an attempt at providing some signal at the reasoner level that allows alternate behaviour with deprecated data which otherwise might not be possible through the owl:deprecated property. That might not be a problem within OBO where the data is kept updated but in external datasets, or archived datasets, the data might still point to the old classes.

I've been trying to locate the “no direct equivalencies allowed" rule, do you have a reference? owl:equivalentClass (unlike owl:sameAs) is defined as a simple property within the spec and only means that the instances of A are also in the instances of B, therefore providing a path forward to updating datasets through an automated process. The alternatives are dcterms:isReplacedBy (actual usage unclear), IAO_0100001 “term replaced by” is marked as "pending final vetting" and prov:wasInvalidatedBy, which is the ideal way to do things but a very heavy hammer.

I have been meaning to write some of this up along with ontology versioning, but I would prefer owl:equivalentClass myself since it is arguably authoritative and communicates changes outside non-OBO spaces.

ddooley commented 3 months ago

@oldskeptic https://robot.obolibrary.org/reason.html#equivalent-class-axioms

IAO_0100001 “term replaced by” has probably been marked "pending final vetting" for a decade, c'est la vie. I've seen it be the OBO foundry convention, and in active use. Perhaps though, OBO would be open to switching to dcterms:isReplacedBy

ddooley commented 2 months ago

I'm going to close this now. If new requirements come up via OBO Foundry deprecation then we can implement then.

oldskeptic commented 2 months ago

@ddooley I'm following up to this ticket because of the consequence to other projects.

You've pointed to the robot FAQ: "in many cases, inferring equivalence between two classes is usually a sign that something has gone wrong." Fair enough within a monolithic ontology that the Robot tool is creating, but that's not OBO policy and I'm not sure they had deprecation in mind for that statement.

So what is the way forward for the mouthfeel classes? I'm pushing them to the beer ontology and the OBO, so what ontological equivalency mechanism are your proposing for the reasoner? The alternative is owl:sameAs which is a bit of a can of worms.