Modifier and Type | Field and Description |
---|---|
static Filter<PropertyEditor> |
evidenceFilter
A property filter to ignore 'evidence' ('EVIDENCE' in L2) property
(it can eventually lead to other organism, experimental entities)
|
static Filter<PropertyEditor> |
nextStepFilter
This property filter can be used to ignore 'nextStep' ('NEXT-STEP' in L2)
property when fetching a sub-graph of child biopax elements, because
using this property can eventually lead outside current pathway context
into peer pathways, etc.
|
static Filter<PropertyEditor> |
objectPropertiesOnlyFilter
A property filter to visit only biopax object type properties.
|
Constructor and Description |
---|
Fetcher(EditorMap editorMap,
Filter<PropertyEditor>... filters)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Set<BioPAXElement> |
fetch(BioPAXElement element)
Recursively finds and collects all child objects,
while escaping possible infinite loops.
|
<T extends BioPAXElement> |
fetch(BioPAXElement element,
Class<T> filterByType)
Goes over object type biopax properties to collect nested objects
(using only properties that pass all the filters set in Constructor,
and taking #isSkipSubPathways into account)
of the given biopax element, its children, etc.
|
Set<BioPAXElement> |
fetch(BioPAXElement bpe,
int depth)
Recursively collects unique child objects from
BioPAX object type properties that pass
all the filters (as set via Constructor).
|
void |
fetch(BioPAXElement element,
Model model)
Adds the element and all its children
(found via traversing into object properties that
pass all the filters defined in the Constructor, and
also taking #isSkipSubPathways into account)
to the target model.
|
boolean |
isSkipSubPathways() |
void |
setSkipSubPathways(boolean skipSubPathways)
Use this property to optionally
skip (if true) traversing into sub-pathways;
i.e., when a biopax property, such as pathwayComponent
or controlled, value is a Pathway.
|
boolean |
subgraphContains(BioPAXElement root,
String uri,
Class<? extends BioPAXElement> type)
Iterates over child objects of the given biopax element,
using BioPAX object-type properties, until the element
with specified URI and class (including its sub-classes).
|
public static final Filter<PropertyEditor> nextStepFilter
public static final Filter<PropertyEditor> evidenceFilter
public static final Filter<PropertyEditor> objectPropertiesOnlyFilter
public Fetcher(EditorMap editorMap, Filter<PropertyEditor>... filters)
editorMap
- BioPAX property editors map implementationfilters
- optional, biopax object property filters
to skip traversing/visiting into some object property values
(the default 'object properties only' filter to is always enabled).public void setSkipSubPathways(boolean skipSubPathways)
skipSubPathways
- true/falsepublic boolean isSkipSubPathways()
public void fetch(BioPAXElement element, Model model)
fetch(BioPAXElement)
method instead if you
want to get all the child elements anyway.element
- the BioPAX element to be added into the modelmodel
- model into which elements will be addedpublic Set<BioPAXElement> fetch(BioPAXElement element)
element
- to traverse intopublic Set<BioPAXElement> fetch(BioPAXElement bpe, int depth)
bpe
- biopax object to traverse into properties ofdepth
- positive int.; 1 means - get only direct children, 2 - include children of children, etc.;IllegalArgumentException
- when depth is less or equals 0public <T extends BioPAXElement> Set<T> fetch(BioPAXElement element, Class<T> filterByType)
T
- biopax typeelement
- to fetch child objects fromfilterByType
- biopax type filterpublic boolean subgraphContains(BioPAXElement root, String uri, Class<? extends BioPAXElement> type)
root
- biopax element to processuri
- URI to matchtype
- class to matchCopyright © 2015 BioPAX. All rights reserved.