Class LevelUpgrader

All Implemented Interfaces:
ModelFilter, Visitor

public final class LevelUpgrader extends AbstractTraverser implements ModelFilter
Upgrades BioPAX L1 and L2 to Level 3. Notes: - it does not fix existing BioPAX errors - most but not all things are converted (e.g., complex.ORGANISM property cannot...) - phy. entities "clones" - because, during L1 or L2 data read, all re-used pEPs are duplicated... (TODO filter after the conversion)
Author:
rodch
  • Constructor Details

    • LevelUpgrader

      public LevelUpgrader()
      Default Constructor that also loads 'classesmap' and 'propsmap' from the properties files.
    • LevelUpgrader

      public LevelUpgrader(BioPAXFactory factory)
      Constructor
      Parameters:
      factory - BioPAX objects factory implementation
  • Method Details

    • filter

      public Model filter(Model model)
      Converts a BioPAX Model, Level 1 or 2, to the Level 3.
      Specified by:
      filter in interface ModelFilter
      Parameters:
      model - BioPAX model to upgrade
      Returns:
      new Level3 model
    • visit

      protected void visit(Object value, BioPAXElement parent, Model newModel, PropertyEditor editor)
      Description copied from class: AbstractTraverser
      This is to implement a real action here: do something, return or even to continue (traverse) into the child (range) element's properties if it's a BioPAX object.
      Specified by:
      visit in class AbstractTraverser
      Parameters:
      value - property value
      parent - parent/owner BioPAX element
      newModel - the BioPAX model of interest
      editor - the property editor
    • getLocalId

      public static String getLocalId(BioPAXElement bpe)
      Gets the local part of the BioPAX element ID.
      Parameters:
      bpe - BioPAX object
      Returns:
      id - local part of the URI
    • getMatchingEnum

      protected Object getMatchingEnum(Object o)
    • preparePep2PEIDMap

      protected void preparePep2PEIDMap(Model model)