public class SBOLReader extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
keepGoing
A
true value of the keepGoing flag tells the SBOL reader
to continue reading an SBOL input file, after it encounters an SBOL validation exception;
a false value forces the reader to stop reading after it encounters
an SBOL validation exception. |
static String |
SBOLVERSION1
Constant representing SBOL version 1.1
|
static String |
SBOLVERSION2
Constant representing SBOL version 2.0
|
Constructor and Description |
---|
SBOLReader() |
Modifier and Type | Method and Description |
---|---|
static void |
clearErrors()
Sets the error list that is used to store SBOL validation exceptions
during reading to empty.
|
static URI |
getDefaultSequenceEncoding()
Sets the default sequence encoding for FASTA conversion.
|
static String |
getDisplayId()
Get the SBOL default displayId for this reader.
|
static List<String> |
getErrors()
Returns the error list that is used to store SBOL validation exceptions.
|
static int |
getNumErrors()
Returns the number of errors in the error list.
|
static String |
getSBOLVersion(File file)
Takes in a given RDF file and returns its SBOL version.
|
static String |
getSBOLVersion(InputStream in)
Takes in a given RDF input stream and returns the SBOL version of the file.
|
static String |
getSBOLVersion(String fileName)
Takes in a given RDF file name and returns the SBOL version of the file.
|
static String |
getURIPrefix()
Returns the specified authority prefix.
|
static String |
getVersion()
Get the SBOL default version for this reader.
|
static boolean |
isCompliant()
Check if document is to be read as being compliant.
|
static boolean |
isDropObjectsWithDuplicateURIs()
Check if objects with duplicate URIs should be dropped.
|
static boolean |
isFastaFile(String fileName)
Check if a file begins with ">" or ";" indicating that it is Fasta file
|
static boolean |
isFastaString(String inputString)
Check if a string begins with ">" or ";" indicating that it is Fasta file string
|
static boolean |
isGenBankFile(String fileName)
Check if a file begins with LOCUS indicating that it is GenBank file
|
static boolean |
isGenBankString(String inputString)
Check if a string begins with LOCUS indicating that it is GenBank file string
|
static boolean |
isKeepGoing()
Checks if reading should continue after encountering an SBOL validation exception.
|
static boolean |
isSnapGeneFile(String fileName)
Check if a file begins with the byte sequence indicating it is a SnapGene file
|
static SBOLDocument |
read(File file)
Parses the given RDF file and stores its contents in an SBOLDocument object.
|
static SBOLDocument |
read(InputStream in)
Takes in a given RDF InputStream and converts the file to an SBOLDocument.
|
static SBOLDocument |
read(String fileName)
Takes in the given RDF filename and converts the file to an SBOLDocument.
|
static void |
setCompliant(boolean compliant)
Sets the compliant flag to the given value.
|
static void |
setDefaultSequenceEncoding(URI defaultSequenceEncoding)
Sets the defaultsequenceEndocding flag to the given value.
|
static void |
setDisplayId(String displayId)
Sets the SBOL default displayId for this reader.
|
static void |
setDropObjectsWithDuplicateURIs(boolean dropObjectsWithDuplicateURIs)
Sets the value of the dropObjectsWithDuplicateURIs flag.
|
static void |
setKeepGoing(boolean keepGoing)
Sets the value for the keepGoing flag to the given boolean value.
|
static void |
setTypesInURI(boolean typesInURI)
Sets the value for the typesInURI flag.
|
static void |
setURIPrefix(String URIprefix)
Sets the specified authority as the prefix.
|
static void |
setVersion(String version)
Sets the SBOL default version for this reader.
|
static void |
unsetURIPrefix()
Sets the URI prefix for this reader to
null . |
public static final String SBOLVERSION1
public static final String SBOLVERSION2
public static boolean keepGoing
true
value of the keepGoing
flag tells the SBOL reader
to continue reading an SBOL input file, after it encounters an SBOL validation exception;
a false
value forces the reader to stop reading after it encounters
an SBOL validation exception.public static boolean isKeepGoing()
true
if it should continue, false
otherwisepublic static void setKeepGoing(boolean keepGoing)
A true
value means that reading will keep going after encountering an SBOL validation exception,
and a false
value means otherwise.
keepGoing
- the boolean value for the keepGoing flagpublic static void clearErrors()
public static List<String> getErrors()
public static int getNumErrors()
public static boolean isCompliant()
true
if document is to be read as being compliant, false
otherwisepublic static void setCompliant(boolean compliant)
A true
value means that the SBOL document is to be read as compliant,
and a false
value means otherwise.
compliant
- the boolean value for the compliant flagpublic static String getURIPrefix()
public static void setURIPrefix(String URIprefix)
URIprefix
- the given URI prefixpublic static void unsetURIPrefix()
null
.public static String getDisplayId()
public static void setDisplayId(String displayId)
displayId
- the given displayIdpublic static String getVersion()
public static void setVersion(String version)
version
- the given versionpublic static void setTypesInURI(boolean typesInURI)
A true
value means that types are to be inserted into each top-level URI when it is created,
and a false
value means otherwise.
typesInURI
- the boolean value for the typesInURI flagpublic static boolean isDropObjectsWithDuplicateURIs()
true
if objects with duplicate URIs should be dropped, false
otherwisepublic static void setDropObjectsWithDuplicateURIs(boolean dropObjectsWithDuplicateURIs)
A true
value means that instances with duplicate URIs should be dropped,
and a false
value means otherwise.
dropObjectsWithDuplicateURIs
- the boolean value for the dropObjectsWithDuplicateURIs flagpublic static URI getDefaultSequenceEncoding()
public static void setDefaultSequenceEncoding(URI defaultSequenceEncoding)
defaultSequenceEncoding
- the given defaultSequenceEncoding URIpublic static String getSBOLVersion(String fileName) throws FileNotFoundException, SBOLValidationException, SBOLConversionException
fileName
- a given RDF file nameFileNotFoundException
- if file was not found.SBOLValidationException
- if any of the following SBOL validation rules was violated:
10101, 10102, 10105, 10201.SBOLConversionException
- if file is emptypublic static SBOLDocument read(String fileName) throws SBOLValidationException, IOException, SBOLConversionException
fileName
- the name of the given RDF fileSBOLValidationException
- if any of the following SBOL validation rules was violated:
10101, 10102, 10105,
10201, 10202, 10203, 10204, 10206, 10208, 10212, 10213, 10220,
10303, 10304, 10305,
10401, 10402, 10403, 10405,
10501, 10502, 10503, 10504, 10507, 10508, 10512, 10513, 10519, 10522, 10526,
10602, 10603, 10604, 10605, 10606, 10607,
10701,
10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 10811,
10901, 10902, 10904, 10905,
11002, 11101, 11102, 11103, 11104,
11201, 11202,
11301,
11401, 11402, 11403, 11404, 11405, 11406, 11407, 11412,
11501, 11502, 11504, 11508,
11601, 11602, 11604, 11605, 11606, 11607, 11608, 11609,
11701, 11702, 11703, 11704, 11705, 11706,
11801, 11802,
11901, 11902, 11906,
12001, 12002, 12003, 12004,
12101, 12102, 12103,
12301, 12302.SBOLConversionException
- see SBOLConversionException.SBOLConversionException(java.lang.Throwable)
IOException
- see IOException
public static String getSBOLVersion(File file) throws FileNotFoundException, SBOLValidationException, SBOLConversionException
file
- the given RDF fileFileNotFoundException
- if file was not found.SBOLValidationException
- if any of the following SBOL validation rules was violated:
10101, 10102, 10105, 10201.SBOLConversionException
- if file is emptypublic static SBOLDocument read(File file) throws SBOLValidationException, IOException, SBOLConversionException
file
- the given RDF fileSBOLValidationException
- if any of the following SBOL validation rules was violated:
10101, 10102, 10105,
10201, 10202, 10203, 10204, 10206, 10208, 10212, 10213, 10220, 10221, 10222
10303, 10304, 10305,
10401, 10402, 10403, 10405,
10501, 10502, 10503, 10504, 10507, 10508, 10512, 10513, 10519, 10522, 10526,
10602, 10603, 10604, 10605, 10606, 10607,
10701,
10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 10811,
10901, 10902, 10904, 10905,
11002, 11101, 11102, 11103, 11104,
11201, 11202,
11301,
11401, 11402, 11403, 11404, 11405, 11406, 11407, 11412,
11501, 11502, 11504, 11508,
11601, 11602, 11604, 11605, 11606, 11607, 11608, 11609,
11701, 11702, 11703, 11704, 11705, 11706,
11801, 11802,
11901, 11902, 11906,
12001, 12002, 12003, 12004,
12101, 12102, 12103,
12301, 12302,
12401, 12402, 12403, 12404, 12405, 12406, 12407
12501, 12502, 12503,
12601, 12602, 12603, 12604, 12605, 12606,
12701,
12801.SBOLConversionException
- see SBOLConversionException
IOException
- see IOException
public static SBOLDocument read(InputStream in) throws SBOLValidationException, IOException, SBOLConversionException
in
- a given RDF InputStreamSBOLConversionException
- see SBOLConversionException
IOException
- see IOException
SBOLValidationException
- if any of the following SBOL validation rules was violated:
10101, 10102, 10105,
10201, 10202, 10203, 10204, 10206, 10208, 10212, 10213, 10220,
10303, 10304, 10305,
10401, 10402, 10403, 10405,
10501, 10502, 10503, 10504, 10507, 10508, 10512, 10513, 10519, 10522, 10526,
10602, 10603, 10604, 10605, 10606, 10607,
10701,
10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 10811,
10901, 10902, 10904, 10905,
11002,
11101, 11102, 11103, 11104,
11201, 11202,
11301,
11401, 11402, 11403, 11404, 11405, 11406, 11407, 11412,
11501, 11502, 11504, 11508,
11601, 11602, 11604, 11605, 11606, 11607, 11608, 11609,
11701, 11702, 11703, 11704, 11705, 11706,
11801, 11802,
11901, 11902, 11906,
12001, 12002, 12003, 12004,
12101, 12102, 12103,
12301, 12302.public static String getSBOLVersion(InputStream in) throws SBOLValidationException, SBOLConversionException
in
- a given RDF input streamSBOLValidationException
- if any of the following SBOL validation rules was violated:
10101, 10102, 10105, 10201.SBOLConversionException
- if file is emptypublic static boolean isGenBankString(String inputString)
inputString
- input string to check if it is a GenBank file stringpublic static boolean isGenBankFile(String fileName) throws IOException
fileName
- file name of file to check if it is a GenBank fileIOException
- if there is an I/O exception reading the filepublic static boolean isFastaString(String inputString)
inputString
- input string to check if it is a Fasta file stringpublic static boolean isFastaFile(String fileName) throws IOException
fileName
- file name of file to check if it is a Fasta fileIOException
- if there is an I/O exception reading the filepublic static boolean isSnapGeneFile(String fileName) throws IOException
fileName
- file name of file to check if it is a Fasta fileIOException
- if there is an I/O exception reading the file