public class RdfTurtleReader extends RdfNTriplesReader
EOF
Constructor and Description |
---|
RdfTurtleReader(Representation rdfN3Representation,
GraphHandler graphHandler)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
generateLinks(List<LexicalUnit> lexicalUnits)
Loops over the given list of lexical units and generates the adequat
calls to link* methods.
|
protected Context |
getContext()
Returns the current context.
|
protected boolean |
isDelimiter(int c)
Returns true if the given character is a delimiter.
|
protected void |
link(Object source,
Reference typeRef,
Object target)
Callback method used when a link is parsed or written.
|
protected String |
newBlankNodeId()
Returns the identifier of a new blank node.
|
void |
parse()
Parses the current representation.
|
protected void |
parseBlankNode(BlankNodeToken blankNode)
Parse the given blank node.
|
protected void |
parseDirective(Context context)
Parse the current directive and update the context according to the kind
of directive ("base", "prefix", etc).
|
protected void |
parseList(ListToken listToken)
Parse the given list token.
|
protected void |
parseStatement(Context context)
Reads the current statement until its end, and parses it.
|
protected void |
parseString(StringToken stringToken)
Parse the given String token.
|
protected void |
parseToken(Token token)
Parses the given token.
|
protected void |
parseUri(UriToken uriToken)
Parses the given URI token.
|
consumeStatement, consumeWhiteSpaces, discard, getChar, getCurrentToken, getParsingMessage, getParsingMessage, isAlphaNum, isEndOfFile, isWhiteSpace, parseComment, parseStatement, parseToken, parseUri, step, step, stepBack, stepBack
getGraphHandler, getRdfRepresentation
public RdfTurtleReader(Representation rdfN3Representation, GraphHandler graphHandler) throws IOException
rdfRepresentation
- The representation to read.graphHandler
- The graph handler invoked during the parsing.IOException
protected void generateLinks(List<LexicalUnit> lexicalUnits)
lexicalUnits
- The list of lexical units used to generate the links.GraphHandler.link(Graph, Reference, Reference)
,
GraphHandler.link(Reference, Reference, Literal)
,
GraphHandler.link(Reference, Reference, Reference)
protected Context getContext()
protected boolean isDelimiter(int c)
isDelimiter
in class RdfNTriplesReader
c
- The given character to check.protected void link(Object source, Reference typeRef, Object target)
source
- The source or subject of the link.typeRef
- The type reference of the link.target
- The target or object of the link.protected String newBlankNodeId()
public void parse() throws IOException
parse
in class RdfNTriplesReader
IOException
protected void parseBlankNode(BlankNodeToken blankNode) throws IOException
blankNode
- The blank node to parse.IOException
protected void parseDirective(Context context) throws IOException
context
- The context to update.IOException
protected void parseList(ListToken listToken) throws IOException
listToken
- The list token to parse.IOException
protected void parseStatement(Context context) throws IOException
context
- The current context.IOException
protected void parseString(StringToken stringToken) throws IOException
stringToken
- The String token to parse.IOException
protected void parseToken(Token token) throws IOException
token
- The token to parse.IOException
protected void parseUri(UriToken uriToken) throws IOException
token
- The URI token to parse.IOException
Copyright © 2005–2013. All rights reserved.