Interface Model

All Superinterfaces:
Serializable
All Known Implementing Classes:
ModelImpl

public interface Model extends Serializable
A model acts as a container for BioPAX elements. Every object within a mode must have unique id. A single object can be contained in multiple models.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(BioPAXElement aBioPAXElement)
    This method adds the given object to this model.
    <T extends BioPAXElement>
    T
    addNew(Class<T> aClass, String id)
    This method creates a new object using the model's factory, adds it to the model and returns it.
    boolean
    contains(BioPAXElement aBioPAXElement)
    This method returns true if the parameter is contained within this model.
    boolean
    This method checks for the biopax element with the given id, returns true if the object with the given id exists.
    This method returns the biopax element with the given id, returns null if the object with the given id does not exist in this model.
    This method returns the level of the objects that are contained within this model.
    URI of this BioPAX Model.
    This method returns a map of name space prefixes.
    This method returns a set of objects in the model.
    <T extends BioPAXElement>
    Set<T>
    getObjects(Class<T> filterBy)
    This method returns a set of objects in the model of the given class.
    URI of this BioPAX Model.
    Gets the model's xml:base (URI prefix/namespace), which normally the majority of the BioPAX object's absolute URIs in the model begin with.
    boolean
    When addDependencies is false, the model will not check for the dependent objects of a newly added object.
    void
    merge(Model source)
    Merges the source model into this one.
    void
    remove(BioPAXElement aBioPAXElement)
    This method removes the given BioPAX Element from the model.
    void
    Attempts to repair the model, i.e., make it self-consistent, integral.
    void
    replace(BioPAXElement existing, BioPAXElement replacement)
    Replaces existing BioPAX element with another one, of the same or possibly equivalent type, and updates all the affected references to it (object properties).
    void
    setAddDependencies(boolean value)
    When set to false, the model will not check for the dependent objects of a newly added object.
    void
    This method sets the factory this model will use for creating BioPAX objects.
    void
    setName(String modelName)
     
    void
    setUri(String modelUri)
     
    void
    Sets the xml:base to use when exporting a BioPAX model.
  • Method Details

    • getUri

      String getUri()
      URI of this BioPAX Model. This can be used in many ways to refer to this model when: - logging; - merging several models; - converting to or from another data format, such as GMT (GSEA); - saving to or reading from RDF/XML file (e.g., save/read a special Provenance object)
      Returns:
      model's uri
    • setUri

      void setUri(String modelUri)
    • getName

      String getName()
      URI of this BioPAX Model. This can be used in many ways; see getUri().
      Returns:
      model's name
    • setName

      void setName(String modelName)
    • add

      void add(BioPAXElement aBioPAXElement)
      This method adds the given object to this model. If the object points to other objects that are not in the model, it is user's responsibility to add them into the model as well. If an object with the same id already exists, it will throw an IllegalBioPAXArgumentException
      Parameters:
      aBioPAXElement - to be added
    • addNew

      <T extends BioPAXElement> T addNew(Class<T> aClass, String id)
      This method creates a new object using the model's factory, adds it to the model and returns it.
      Type Parameters:
      T - a BioPAX type
      Parameters:
      aClass - the BioPAX model interface class
      id - of the new object
      Returns:
      newly created object
    • contains

      boolean contains(BioPAXElement aBioPAXElement)
      This method returns true if the parameter is contained within this model. Note: the result can be 'false' when containsID(String) is 'true' (using the URI of the parameter) if, e.g., model contains another object with the same URI.
      Parameters:
      aBioPAXElement - to be checked
      Returns:
      true if the parameter is in the object set
      See Also:
    • getByID

      BioPAXElement getByID(String id)
      This method returns the biopax element with the given id, returns null if the object with the given id does not exist in this model.
      Parameters:
      id - of the object to be retrieved.
      Returns:
      biopax element with the given id.
    • containsID

      boolean containsID(String id)
      This method checks for the biopax element with the given id, returns true if the object with the given id exists. in this model.
      Parameters:
      id - of the object to be retrieved.
      Returns:
      biopax element with the given id.
    • getNameSpacePrefixMap

      Map<String,String> getNameSpacePrefixMap()
      This method returns a map of name space prefixes. This map can be modified.
      Returns:
      a map, mapping prefixes to full namespaces.
    • getObjects

      Set<BioPAXElement> getObjects()
      This method returns a set of objects in the model. Contents of this set can not be modified.
      Returns:
      an unmodifiable set of objects.
    • getObjects

      <T extends BioPAXElement> Set<T> getObjects(Class<T> filterBy)
      This method returns a set of objects in the model of the given class. Contents of this set should not be modified.
      Type Parameters:
      T - a BioPAX type
      Parameters:
      filterBy - class to be used as a filter.
      Returns:
      an unmodifiable set of objects of the given class.
    • remove

      void remove(BioPAXElement aBioPAXElement)
      This method removes the given BioPAX Element from the model. Other objects in the model can still point to this object. It is user's responsibility to properly excise these properties.
      Parameters:
      aBioPAXElement - to be removed.
    • setFactory

      void setFactory(BioPAXFactory factory)
      This method sets the factory this model will use for creating BioPAX objects. For example addNew(Class, String) method uses this factory.
      Parameters:
      factory - this model will use for creating BioPAX objects.
    • getLevel

      BioPAXLevel getLevel()
      This method returns the level of the objects that are contained within this model.
      Returns:
      level of the objects within this model.
    • setAddDependencies

      void setAddDependencies(boolean value)
      When set to false, the model will not check for the dependent objects of a newly added object. When true it will traverse and add all dependent objects that are not already in the model. This feature is currently experimental.
      Parameters:
      value - defining the dependency adding behaviour
    • isAddDependencies

      boolean isAddDependencies()
      When addDependencies is false, the model will not check for the dependent objects of a newly added object. When true it will traverse and add all dependent objects that are not already in the model. This feature is currently experimental.
      Returns:
      whether adding dependencies.
    • merge

      void merge(Model source)
      Merges the source model into this one.
      Parameters:
      source - a model to merge
    • replace

      void replace(BioPAXElement existing, BioPAXElement replacement)
      Replaces existing BioPAX element with another one, of the same or possibly equivalent type, and updates all the affected references to it (object properties).
      Parameters:
      existing - object to be replaced
      replacement - the replacement BioPAX object
    • repair

      void repair()
      Attempts to repair the model, i.e., make it self-consistent, integral.
    • setXmlBase

      void setXmlBase(String base)
      Sets the xml:base to use when exporting a BioPAX model. Usually, is is a data-provider's URI prefix, e.g., xml:base="http://www.pantherdb.org/pathways/biopax#" Setting this to null makes the exporter print using absolute URIs (and rdf:about) instead of relative ones (and rdf:ID).
      Parameters:
      base - a URI prefix or null.
    • getXmlBase

      String getXmlBase()
      Gets the model's xml:base (URI prefix/namespace), which normally the majority of the BioPAX object's absolute URIs in the model begin with. Note: it's not required that all the BioPAX objects in the model have the same URI prefix/namespace; e.g., there are can be (and perfectly legal) objects that use other URI bases, such as http://identifiers.org/, http://purl.org/, etc. (- usually these are well-known standard xml bases, or these result from merging several BioPAX models of different data providers into one model.)
      Returns:
      xml:base value