public final class SimpleIOHandler extends BioPAXIOHandlerAdapter
Modifier and Type | Class and Description |
---|---|
class |
SimpleIOHandler.Triple |
Constructor and Description |
---|
SimpleIOHandler()
Basic constructor, defaults to Level 3 and default BioPAXFactory
|
SimpleIOHandler(BioPAXFactory factory,
BioPAXLevel level)
Full constructor
|
SimpleIOHandler(BioPAXLevel level)
Basic constructor, defaults to level.defaultFactory
|
Modifier and Type | Method and Description |
---|---|
void |
absoluteUris(boolean absoluteUris)
Sets the flag used when exporting a BioPAX model to RDF/XML:
true - to always write full URI in rdf:resource and use
rdf:about instead rdf:ID (does not matter xml:base is set or not).
|
void |
checkRestrictions(boolean checkRestrictions)
If set to true, property editors will check restrictions at the subclass level and throw an exception if
violated.
|
static String |
convertToOwl(Model model)
Serializes a (not too large) BioPAX model to the RDF/XML (OWL) formatted string.
|
void |
convertToOWL(Model model,
OutputStream outputStream)
Converts a model into BioPAX (OWL) format, and writes it into
the outputStream.
|
protected 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.
|
String |
getId() |
String |
getXmlStreamInfo()
This may be required for external applications to access the specific information (e.g.,
location) when reporting XML exceptions.
|
protected 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 |
isAbsoluteUris() |
boolean |
isMergeDuplicates() |
boolean |
isNormalizeNameSpaces() |
void |
mergeDuplicates(boolean mergeDuplicates)
If set to true, the reader will merge duplicate individuals, i.e.
|
void |
normalizeNameSpaces(boolean normalizeNameSpaces)
Sets the flag used when exporting a BioPAX model to RDF/XML:
true - to clean up current namespaces (e.g., those read from a file)
and use defaults instead (prefixes: 'rdf', 'rdfs', 'owl', 'xsd')
|
protected 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 void |
resetEditorMap()
This method resets the editor map.
|
void |
writeObject(Writer out,
BioPAXElement bean)
Writes the XML representation of individual BioPAX element that
is BioPAX-like but only for display or debug purpose (incomplete).
|
bindValue, convertFromMultipleOwlFiles, convertFromOWL, convertToOWL, createAndAdd, fixReusedPEPs, getEditorMap, getFactory, getLevel, getRDFCommentEditor, getReusedPEPHelper, isConvertingFromLevel1ToLevel2, isFixReusedPEPs, isTreatNilAsNull, L1ToL2Fixes, resetLevel, resourceFixes, setConvertingFromLevel1ToLevel2, setEditorMap, setFactory, treatNilAsNull
public SimpleIOHandler()
public SimpleIOHandler(BioPAXLevel level)
level
- BioPAXLevel to handle.public SimpleIOHandler(BioPAXFactory factory, BioPAXLevel level)
factory
- to create BioPAX objectslevel
- BioPAX level to handle.public void mergeDuplicates(boolean mergeDuplicates)
mergeDuplicates
- true/falsepublic void checkRestrictions(boolean checkRestrictions)
checkRestrictions
- true/falseprotected void resetEditorMap()
resetEditorMap
in class BioPAXIOHandlerAdapter
public String getXmlStreamInfo()
protected void init(InputStream in)
BioPAXIOHandlerAdapter
init
in class BioPAXIOHandlerAdapter
in
- BioPAX RDF/XML input streamprotected void reset(InputStream in)
reset
in class BioPAXIOHandlerAdapter
protected Map<String,String> readNameSpaces()
BioPAXIOHandlerAdapter
readNameSpaces
in class BioPAXIOHandlerAdapter
protected void createAndBind(Model model)
BioPAXIOHandlerAdapter
createAndBind
in class BioPAXIOHandlerAdapter
model
- to be populatedpublic void convertToOWL(Model model, OutputStream outputStream)
BioPAXIOHandler
interface (e.g., SimpleIOHandler
).
Note: When the model is incomplete (i.e., contains elements that refer externals,
dangling BioPAX elements) and is exported by this method, it works; however one
will find corresponding object properties set to NULL later,
after converting such data back to Model.
Note: if the model is very very large, and the output stream is a byte array stream,
then you can eventually get OutOfMemoryError "Requested array size exceeds VM limit"
(max. array size is 2Gb)model
- model to be converted into OWL formatoutputStream
- output stream into which the output will be writtenBioPaxIOException
- in case of I/O problemspublic void writeObject(Writer out, BioPAXElement bean) throws IOException
BioPAXIOHandler.convertToOWL(org.biopax.paxtools.model.Model, java.io.OutputStream)
convertToOWL(org.biopax.paxtools.model.Model, Object)} instead
if you have a model and want to save and later restore it.out
- outputbean
- BioPAX objectIOException
- when the output writer throwspublic void absoluteUris(boolean absoluteUris)
absoluteUris
- true/false - whether to force writing absolute URIs (thus, never use rdf:ID)public boolean isAbsoluteUris()
absoluteUris(boolean)
public void normalizeNameSpaces(boolean normalizeNameSpaces)
normalizeNameSpaces
- true/falsepublic boolean isNormalizeNameSpaces()
normalizeNameSpaces()
public boolean isMergeDuplicates()
mergeDuplicates(boolean)
public static String convertToOwl(Model model)
model
- a BioPAX object model to convert to the RDF/XML formatIllegalArgumentException
- if model is nullOutOfMemoryError
- when it cannot be stored in a byte array (max 2Gb).Copyright © 2015 BioPAX. All rights reserved.