public class NQuadsReader extends Object
Use the provide(RdfQuadConsumer) method to parse input and process
N-Quads statements.
| Modifier and Type | Field and Description |
|---|---|
protected String |
ltDatatype |
protected String |
ltDirection |
protected String |
ltLangTag |
protected String |
ltObject |
protected Predicate<String> |
testAbsoluteIRI |
protected NQuadsTokenizer |
tokenizer |
| Modifier | Constructor and Description |
|---|---|
protected |
NQuadsReader(NQuadsTokenizer tokenizer,
Predicate<String> testAbsoluteIRI) |
|
NQuadsReader(Reader reader)
Creates a new
NQuadsReader instance with the specified character
stream. |
|
NQuadsReader(Reader reader,
int bufferSize)
Creates a new
NQuadsReader instance with the specified character
stream and buffer size for optimized reading. |
|
NQuadsReader(Reader reader,
int bufferSize,
Predicate<String> testAbsoluteIRI)
Creates a new
NQuadsReader instance with the specified character
stream and buffer size for optimized reading. |
|
NQuadsReader(Reader reader,
Predicate<String> testAbsoluteIRI)
Creates a new
NQuadsReader instance with the specified character
stream. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertAbsoluteIri(String uri,
String what) |
protected static void |
datatype(String datatype,
BiConsumer<String,String[]> result) |
protected void |
object() |
void |
provide(com.apicatalog.rdf.api.RdfQuadConsumer consumer)
Reads and processes N-Quads, invoking the provided consumer immediately after
each N-Quad statement is deserialized.
|
protected String |
resource(String name) |
protected void |
skipWhitespace(int min) |
protected static boolean |
startsWithScheme(String uri) |
protected void |
statement(com.apicatalog.rdf.api.RdfQuadConsumer consumer) |
protected static <T> T |
unexpected(NQuadsTokenizer.Token token,
NQuadsTokenizer.TokenType... types) |
protected final NQuadsTokenizer tokenizer
protected String ltObject
protected String ltDatatype
protected String ltLangTag
protected String ltDirection
public NQuadsReader(Reader reader)
NQuadsReader instance with the specified character
stream.reader - the Reader to read N-Quads data frompublic NQuadsReader(Reader reader, Predicate<String> testAbsoluteIRI)
NQuadsReader instance with the specified character
stream.reader - the Reader to read N-Quads data fromtestAbsoluteIRI - a function to test if an IRI is absolute or notpublic NQuadsReader(Reader reader, int bufferSize)
NQuadsReader instance with the specified character
stream and buffer size for optimized reading.reader - the Reader to read N-Quads data frombufferSize - the size of the buffer used for reading > 0 (bytes)IllegalArgumentException - if bufferSize is non-positive numberpublic NQuadsReader(Reader reader, int bufferSize, Predicate<String> testAbsoluteIRI)
NQuadsReader instance with the specified character
stream and buffer size for optimized reading.reader - the Reader to read N-Quads data frombufferSize - the size of the buffer used for reading > 0 (bytes)testAbsoluteIRI - a function to test if an IRI is absolute or notIllegalArgumentException - if bufferSize is non-positive numberprotected NQuadsReader(NQuadsTokenizer tokenizer, Predicate<String> testAbsoluteIRI)
public void provide(com.apicatalog.rdf.api.RdfQuadConsumer consumer)
throws NQuadsReaderException,
com.apicatalog.rdf.api.RdfConsumerException
consumer - the RdfQuadConsumer that processes each deserialized
N-Quad statementNQuadsReaderException - if an error occurs while reading the N-Quadscom.apicatalog.rdf.api.RdfConsumerException - if an error occurs while processing the N-Quad
statementprotected void statement(com.apicatalog.rdf.api.RdfQuadConsumer consumer)
throws NQuadsReaderException,
com.apicatalog.rdf.api.RdfConsumerException
NQuadsReaderExceptioncom.apicatalog.rdf.api.RdfConsumerExceptionprotected String resource(String name) throws NQuadsReaderException
NQuadsReaderExceptionprotected void object()
throws NQuadsReaderException
NQuadsReaderExceptionprotected static final <T> T unexpected(NQuadsTokenizer.Token token, NQuadsTokenizer.TokenType... types) throws NQuadsReaderException
NQuadsReaderExceptionprotected void skipWhitespace(int min)
throws NQuadsReaderException
NQuadsReaderExceptionprotected final void assertAbsoluteIri(String uri, String what) throws NQuadsReaderException
NQuadsReaderExceptionprotected static final void datatype(String datatype, BiConsumer<String,String[]> result)
protected static final boolean startsWithScheme(String uri)
Copyright © 2020–2025. All rights reserved.