Package org.biopax.paxtools.model
Interface Model
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ModelImpl
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 TypeMethodDescriptionvoidadd(BioPAXElement aBioPAXElement) This method adds the given object to this model.<T extends BioPAXElement>
TThis method creates a new object using the model's factory, adds it to the model and returns it.booleancontains(BioPAXElement aBioPAXElement) This method returns true if the parameter is contained within this model.booleancontainsID(String id) 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.getLevel()This method returns the level of the objects that are contained within this model.getName()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.getUri()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.booleanWhen addDependencies is false, the model will not check for the dependent objects of a newly added object.voidMerges the source model into this one.voidremove(BioPAXElement aBioPAXElement) This method removes the given BioPAX Element from the model.voidrepair()Attempts to repair the model, i.e., make it self-consistent, integral.voidreplace(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).voidsetAddDependencies(boolean value) When set to false, the model will not check for the dependent objects of a newly added object.voidsetFactory(BioPAXFactory factory) This method sets the factory this model will use for creating BioPAX objects.voidvoidvoidsetXmlBase(String base) 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
-
getName
String getName()URI of this BioPAX Model. This can be used in many ways; seegetUri().- Returns:
- model's name
-
setName
-
add
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 anIllegalBioPAXArgumentException- Parameters:
aBioPAXElement- to be added
-
addNew
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 classid- of the new object- Returns:
- newly created object
-
contains
This method returns true if the parameter is contained within this model. Note: the result can be 'false' whencontainsID(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
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
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
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
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
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
This method sets the factory this model will use for creating BioPAX objects. For exampleaddNew(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
Merges the source model into this one.- Parameters:
source- a model to merge
-
replace
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 replacedreplacement- the replacement BioPAX object
-
repair
void repair()Attempts to repair the model, i.e., make it self-consistent, integral. -
setXmlBase
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
-