public class OBOFormatParser extends Object
Constructor and Description |
---|
OBOFormatParser()
Default constructor.
|
OBOFormatParser(Map<String,OBODoc> importsMap) |
OBOFormatParser(OBOFormatParser.MyStream s) |
Modifier and Type | Method and Description |
---|---|
boolean |
addImport(String key,
OBODoc doc) |
List<String> |
checkDanglingReferences(OBODoc doc) |
boolean |
getFollowImports() |
OBODoc |
parse(BufferedReader reader) |
OBODoc |
parse(File file)
Parses a local file to an OBODoc.
|
OBODoc |
parse(String fn)
Parses a local file or URL to an OBODoc.
|
OBODoc |
parse(URL url)
Parses a remote URL to an OBODoc.
|
void |
parseEntityFrame(OBODoc obodoc) |
void |
parseEOL(Clause cl) |
void |
parseHeaderFrame(Frame h) |
void |
parseOBODoc(OBODoc obodoc) |
void |
parseTermFrame(OBODoc obodoc)
term-frame ::= nl* '[Term]' nl id-Tag Class-ID EOL { term-frame-clause EOL }.
|
Clause |
parseTermFrameClause() |
void |
parseTypedefFrame(OBODoc obodoc)
Typedef-frame ::= nl* '[Typedef]' nl id-Tag Class-ID EOL { Typedef-frame-clause EOL }.
|
Clause |
parseTypedefFrameClause() |
OBODoc |
parseURL(String urlstr)
Parses a remote URL to an OBODoc.
|
void |
setFollowImports(boolean followImports) |
void |
setReader(BufferedReader r) |
public OBOFormatParser()
public OBOFormatParser(OBOFormatParser.MyStream s)
s
- streampublic boolean addImport(String key, OBODoc doc)
key
- key for the importdoc
- documentpublic void setReader(BufferedReader r)
r
- rpublic boolean getFollowImports()
public void setFollowImports(boolean followImports)
followImports
- true if imports should be followed@Nonnull public OBODoc parse(@Nonnull String fn) throws IOException
fn
- file nameIOException
- io exceptionOBOFormatParserException
- parser exception@Nonnull public OBODoc parse(File file) throws IOException
file
- fileIOException
- io exceptionOBOFormatParserException
- parser exception@Nonnull public OBODoc parse(@Nonnull URL url) throws IOException
url
- URL to connect toIOException
- io exceptionOBOFormatParserException
- parser exception@Nonnull public OBODoc parseURL(String urlstr) throws IOException
urlstr
- URL stringIOException
- io exceptionOBOFormatParserException
- parser exception@Nonnull public OBODoc parse(BufferedReader reader) throws IOException
reader
- readerIOException
- io exceptionOBOFormatParserException
- parser exceptionpublic void parseOBODoc(@Nonnull OBODoc obodoc)
obodoc
- obodocOBOFormatParserException
- parser exception@Nonnull public List<String> checkDanglingReferences(@Nonnull OBODoc doc)
doc
- docOBOFormatDanglingReferenceException
- dangling reference errorpublic void parseHeaderFrame(@Nonnull Frame h)
h
- hOBOFormatParserException
- parser exceptionpublic void parseEntityFrame(@Nonnull OBODoc obodoc)
obodoc
- obodocOBOFormatParserException
- parser exceptionpublic void parseTermFrame(@Nonnull OBODoc obodoc)
obodoc
- obodocOBOFormatParserException
- parser exception@Nonnull public Clause parseTermFrameClause()
OBOFormatParserException
- parser exceptionpublic void parseTypedefFrame(@Nonnull OBODoc obodoc)
obodoc
- obodocOBOFormatParserException
- parser exception@Nonnull public Clause parseTypedefFrameClause()
OBOFormatParserException
- parser exceptionpublic void parseEOL(@Nonnull Clause cl)
cl
- clauseOBOFormatParserException
- parser exceptionCopyright © 2020 The University of Manchester. All rights reserved.