public abstract class BioPAXIOHandlerAdapter extends Object implements BioPAXIOHandler
Modifier and Type | Field and Description |
---|---|
protected String |
base |
protected String |
bp |
protected EditorMap |
editorMap |
protected BioPAXFactory |
factory |
protected BioPAXLevel |
level |
protected Map<String,String> |
namespaces |
protected static String |
owl |
protected static String |
rdf |
protected static String |
rdfs |
protected static String |
xsd |
Constructor and Description |
---|
BioPAXIOHandlerAdapter() |
BioPAXIOHandlerAdapter(BioPAXFactory factory,
BioPAXLevel level) |
BioPAXIOHandlerAdapter(BioPAXLevel level) |
Modifier and Type | Method and Description |
---|---|
protected void |
bindValue(String valueString,
PropertyEditor editor,
BioPAXElement bpe,
Model model)
This method binds the value to the bpe.
|
Model |
convertFromMultipleOwlFiles(String... files)
Deprecated.
experimental and incomplete; e.g., files are to be ordered, i.e.,
a former file should not point to the latter. Use it at your own risk.
Or, use #convertFromOWL to get independent models; then, try merging them...
|
Model |
convertFromOWL(InputStream in)
Reads a BioPAX model from an OWL file input stream (in) and converts it to a model.
|
void |
convertToOWL(Model model,
OutputStream outputStream,
String... ids)
Similar to
BioPAXIOHandler.convertToOWL(org.biopax.paxtools.model.Model,
java.io.OutputStream) (org.biopax.paxtools.model.Model, Object)}, but
extracts a sub-model, converts it into BioPAX (OWL) format,
and writes it into the outputStream. |
protected void |
createAndAdd(Model model,
String id,
String localName)
This method is called by the reader for each OWL instance in the OWL model.
|
protected abstract void |
createAndBind(Model model)
This method provides a hook for the implementers of this abstract class to create objects themselves and bind
the properties to the objects.
|
void |
fixReusedPEPs(boolean fixReusedPEPs)
Enables (true) or disables (false) the fixing of reused peps.
|
EditorMap |
getEditorMap() |
BioPAXFactory |
getFactory() |
BioPAXLevel |
getLevel() |
protected StringPropertyEditor |
getRDFCommentEditor(BioPAXElement bpe)
Paxtools maps BioPAX:comment (L3) and BioPAX:COMMENT (L2) to rdf:comment.
|
protected ReusedPEPHelper |
getReusedPEPHelper()
This is a helper class initialized only if fixReusedPEPs is true.
|
protected abstract void |
init(InputStream in)
This method provides a hook for the implementers of this abstract class to perform the initial reading from the
input stream.
|
boolean |
isConvertingFromLevel1ToLevel2()
This flag will allow reader to automatically convert level1 classes to
corresponding level 2 classes.
|
boolean |
isFixReusedPEPs()
Workaround for a very common Level 2 issue.
|
boolean |
isTreatNilAsNull()
Deprecated.
This problem is fixed and this option is no longer needed for recent BioCyc exports. Enable only if
you are parsing a legacy export.
|
protected BioPAXElement |
L1ToL2Fixes(PropertyEditor editor,
BioPAXElement bpe,
Model model,
String value)
Deprecated.
BioPAX Level 1 exports are extremely rare and obsolete.
|
protected abstract Map<String,String> |
readNameSpaces()
This method provides a hook for the implementers of this abstract class to set the namespaces of the model.
|
protected void |
reset(InputStream in) |
protected abstract void |
resetEditorMap()
Updates the member EditorMap for the new BioPAX level and factory (different implementations of
EditorMap can be used in modules, e.g.
|
protected void |
resetLevel(BioPAXLevel level,
BioPAXFactory factory)
Updates the level and factory for this I/O
(final - because used in the constructor)
|
protected Object |
resourceFixes(BioPAXElement bpe,
Object value)
This method currently only fixes reusedPEPs if the option is set.
|
void |
setConvertingFromLevel1ToLevel2(boolean convertingFromLevel1ToLevel2)
Deprecated.
BioPAX Level 1 exports are extremely rare and obsolete.
|
void |
setEditorMap(EditorMap editorMap) |
void |
setFactory(BioPAXFactory factory) |
void |
treatNilAsNull(boolean treatNILasNull)
Deprecated.
This problem is fixed and this option is no longer needed for recent BioCyc exports. Enable only if
you are parsing a legacy export.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convertToOWL
protected BioPAXLevel level
protected BioPAXFactory factory
protected Map<String,String> namespaces
protected static final String rdf
protected static final String rdfs
protected static final String xsd
protected static final String owl
public BioPAXIOHandlerAdapter()
public BioPAXIOHandlerAdapter(BioPAXLevel level)
public BioPAXIOHandlerAdapter(BioPAXFactory factory, BioPAXLevel level)
protected final void resetLevel(BioPAXLevel level, BioPAXFactory factory)
level
- BioPAX Levelfactory
- concrete BioPAX factory impl.protected abstract void resetEditorMap()
public void fixReusedPEPs(boolean fixReusedPEPs)
fixReusedPEPs
in interface BioPAXIOHandler
fixReusedPEPs
- true if fixing is desiredfixReusedPEPs
public void treatNilAsNull(boolean treatNILasNull)
treatNilAsNull
in interface BioPAXIOHandler
treatNILasNull
- true/falsepublic void setConvertingFromLevel1ToLevel2(boolean convertingFromLevel1ToLevel2)
setConvertingFromLevel1ToLevel2
in interface BioPAXIOHandler
convertingFromLevel1ToLevel2
- true/falsepublic boolean isTreatNilAsNull()
BioPAXIOHandler
isTreatNilAsNull
in interface BioPAXIOHandler
public boolean isConvertingFromLevel1ToLevel2()
BioPAXIOHandler
isConvertingFromLevel1ToLevel2
in interface BioPAXIOHandler
public boolean isFixReusedPEPs()
isFixReusedPEPs
in interface BioPAXIOHandler
protected ReusedPEPHelper getReusedPEPHelper()
public BioPAXFactory getFactory()
getFactory
in interface BioPAXIOHandler
public void setFactory(BioPAXFactory factory)
setFactory
in interface BioPAXIOHandler
factory
- used for creating objectspublic EditorMap getEditorMap()
getEditorMap
in interface BioPAXIOHandler
public void setEditorMap(EditorMap editorMap)
setEditorMap
in interface BioPAXIOHandler
editorMap
- used for this handler.public BioPAXLevel getLevel()
getLevel
in interface BioPAXIOHandler
@Deprecated public Model convertFromMultipleOwlFiles(String... files) throws FileNotFoundException
convertFromMultipleOwlFiles
in interface BioPAXIOHandler
files
- Dependency ordered biopax owl file namesFileNotFoundException
- when any file can not be foundpublic Model convertFromOWL(InputStream in)
convertFromOWL
in interface BioPAXIOHandler
in
- inputStream from which the model will be readprotected void reset(InputStream in)
protected void createAndAdd(Model model, String id, String localName)
model
- to be insertedid
- of the new object. The model should not contain another object with the same ID.localName
- of the class to be instantiated.protected abstract void init(InputStream in)
in
- BioPAX RDF/XML input streamprotected abstract Map<String,String> readNameSpaces()
protected abstract void createAndBind(Model model)
model
- to be populatedprotected BioPAXElement L1ToL2Fixes(PropertyEditor editor, BioPAXElement bpe, Model model, String value)
editor
- that is responsible for the property that is currently being assigned to the bpe. This method
will only react if the editor is one of Delta-G or KEQ. These two properties have integer values in L1 but were
upgraded to 5-tuples called DeltaGPrime0 and KPrime in L2.bpe
- that is being bound.model
- that is being populated.value
- of the property which is an integer.protected Object resourceFixes(BioPAXElement bpe, Object value)
bpe
- to be boundvalue
- to be assigned.protected void bindValue(String valueString, PropertyEditor editor, BioPAXElement bpe, Model model)
valueString
- to be assignededitor
- that maps to the propertybpe
- to be boundmodel
- to be populated.protected StringPropertyEditor getRDFCommentEditor(BioPAXElement bpe)
bpe
- to be bound.public void convertToOWL(Model model, OutputStream outputStream, String... ids)
BioPAXIOHandler.convertToOWL(org.biopax.paxtools.model.Model,
java.io.OutputStream)
(org.biopax.paxtools.model.Model, Object)}, but
extracts a sub-model, converts it into BioPAX (OWL) format,
and writes it into the outputStream.
Saved data can be then read via BioPAXIOHandler
interface (e.g., SimpleIOHandler
).convertToOWL
in interface BioPAXIOHandler
model
- model to be converted into OWL formatoutputStream
- output stream into which the output will be writtenids
- optional list of "root" element absolute URIs (all direct/indirect child objects are auto-exported as well)Copyright © 2015 BioPAX. All rights reserved.