Package org.apache.jena.rdf.model.impl
Class NTripleReader
- java.lang.Object
-
- org.apache.jena.rdf.model.impl.NTripleReader
-
- All Implemented Interfaces:
RDFReaderI
public class NTripleReader extends java.lang.Object implements RDFReaderI
N-Triple Reader
-
-
Constructor Summary
Constructors Constructor Description NTripleReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
read(Model model, java.io.InputStream in, java.lang.String base)
Read serialized RDF from anInputStream
and add the statements to aModel
.void
read(Model model, java.io.Reader reader, java.lang.String base)
It is usually a mistake to use this method.void
read(Model model, java.lang.String url)
Read serialized RDF from a url and add the statements to a model.RDFNode
readNode()
Resource
readResource()
RDFErrorHandler
setErrorHandler(RDFErrorHandler errHandler)
Set an error handler for the readerjava.lang.Object
setProperty(java.lang.String propName, java.lang.Object propValue)
Set the value of a reader property.
-
-
-
Method Detail
-
read
public void read(Model model, java.io.InputStream in, java.lang.String base)
Description copied from interface:RDFReaderI
Read serialized RDF from anInputStream
and add the statements to aModel
.- Specified by:
read
in interfaceRDFReaderI
- Parameters:
model
- The model to which statements are added.in
- The InputStream from which to readbase
- The base to use when converting relative to absolute URI's. The base URI may be null if there are no relative URIs to convert. A base URI of "" may permit relative URIs to be used in the model unconverted.
-
read
public void read(Model model, java.io.Reader reader, java.lang.String base)
Description copied from interface:RDFReaderI
It is usually a mistake to use this method. Read serialized RDF from aReader
and add the statements to aModel
. It is generally better to use an InputStream if possible.RDFReaderI.read(Model,InputStream,String)
, otherwise there is a danger of a mismatch between the character encoding of say the FileReader and the character encoding of the data in the file.- Specified by:
read
in interfaceRDFReaderI
- Parameters:
model
- The model to which statements are added.reader
- the reader from which to readbase
- The base to use when converting relative to absolute URI's. The base URI may be null if there are no relative URIs to convert. A base URI of "" may permit relative URIs to be used in the model unconverted.
-
read
public void read(Model model, java.lang.String url)
Description copied from interface:RDFReaderI
Read serialized RDF from a url and add the statements to a model.- Specified by:
read
in interfaceRDFReaderI
- Parameters:
model
- the model to which statements should be addedurl
- the url, as a string, from which the serialized RDF should be read.
-
setProperty
public java.lang.Object setProperty(java.lang.String propName, java.lang.Object propValue)
Description copied from interface:RDFReaderI
Set the value of a reader property.The behaviour of a reader may be influenced by setting property values. The properties and there effects may depend on the individual reader implementation.
An RDFReader's behaviour can be influenced by defining property values interpreted by that particular reader class. The values for such properties can be changed by calling this method.
No standard properties are defined. For the properties recognised by any particular reader implementation, see the documentation for that implementation.
The built-in RDFReaders have properties as defined by:
- N-TRIPLE
- No properties.
- RDF/XML
- RDF/XML-ABBREV
- See
JenaReader.setProperty(String,Object)
- Specified by:
setProperty
in interfaceRDFReaderI
- Parameters:
propName
- the name of the propertypropValue
- the value of the property- Returns:
- the previous value of the property, or
null
if there wasn't one
-
setErrorHandler
public RDFErrorHandler setErrorHandler(RDFErrorHandler errHandler)
Description copied from interface:RDFReaderI
Set an error handler for the reader- Specified by:
setErrorHandler
in interfaceRDFReaderI
- Parameters:
errHandler
- the new error handler- Returns:
- the previous error handler
-
readResource
public Resource readResource()
-
readNode
public RDFNode readNode()
-
-