geneontology / obographs

Basic and Advanced OBO Graphs: specification and reference implementation
63 stars 12 forks source link

Added missing Meta.getDeprecated() #40

Closed julesjacobsen closed 5 years ago

julesjacobsen commented 5 years ago

Phenol was having to do some nasty workarounds for a simple missing getter..

// 6. obsolete; the obsolete/deprecated field in Meta is somehow not accessible,
    // so we use Java reflection to pull the value of that field.
    boolean isObsolete = false;
    try {
      Field f = Meta.class.getDeclaredField("deprecated");
      f.setAccessible(true);
      Boolean deprecated = (Boolean) f.get(meta);
      if (deprecated == null || ! deprecated ) isObsolete = false;
      else if (deprecated) isObsolete = true;
    } catch (Exception e) {
      LOGGER.error(e.getMessage());
    }
    genericTerm.setObsolete(isObsolete);

This solves that issue.

julesjacobsen commented 5 years ago

Also updating to OWLAPI 5.1.7 - this has a Java 8 base and is Java 10 build compatible. Importantly it removes Guice dependency which caused these issues:

https://github.com/google/guice/issues/1133 https://github.com/owlcs/owlapi/issues/652

cmungall commented 5 years ago

Ugh, unfortunately we may have to stick with OWLAPI 4.x, since we use this library in robot, and robot tracks OWLAPI 4.x, since that is what is used in Protege.

One possibility is for dual releases of this lib on maven?

Any thoughts @balhoff?

balhoff commented 5 years ago

I think OWLAPI 4.5.4 removes the Guice dependency (see https://github.com/ontodev/robot/issues/308#issuecomment-408399143). Would that work for you @julesjacobsen?

julesjacobsen commented 5 years ago

4.5.x would work fine for me. Didn't ROBOT move to 4.5.6