Interface AnnotationProperty

All Superinterfaces:
OntologyResource
All Known Implementing Classes:
LexicalAnnotationProperty

public interface AnnotationProperty extends OntologyResource
Author:
pavlidis
  • Method Details

    • getProperty

      String getProperty()
      A label for the property of this annotation.
    • getContents

      @Nullable String getContents()
      The value associated to this annotation as a string.

      🛑 When the value is a RESOURCE, this returns its rdfs:label — not its URI — and null when the resource carries no label. That indirection is right for display and wrong for identity: use getValueUri() whenever the annotation names a term rather than describes one.

    • getValueUri

      @Nullable default String getValueUri()
      The URI of this annotation's value when the value is a URI resource, else null (literal values, blank nodes).

      Exists because getContents() resolves a resource to its label, and a label is not an identity. MONDO's crossSpeciesExactMatch is the case that proved it: the mapping MONDO:0700199 → MONDO:0005061 came back as the string "lung adenocarcinoma", which names BOTH MONDO:0005061 (a disease) and HP:0030078 (a phenotype) equally well. A consumer repairing an annotation from that string can silently land on the phenotype — worse than not repairing, because it looks like it worked.