Class NTriplesParser
Parser for NTriples syntax.
Inherited Members
Namespace: VDS.RDF.Parsing
Assembly: dotNetRdf.dll
Syntax
public class NTriplesParser : IRdfReader, ITraceableParser, ITraceableTokeniser, ITokenisingParser
Constructors
| Edit this page View SourceNTriplesParser()
Creates a new instance of the parser.
Declaration
public NTriplesParser()
NTriplesParser(NTriplesSyntax)
Creates a new instance of the parser.
Declaration
public NTriplesParser(NTriplesSyntax syntax)
Parameters
Type | Name | Description |
---|---|---|
NTriplesSyntax | syntax | NTriples syntax to parse. |
NTriplesParser(NTriplesSyntax, TokenQueueMode)
Creates a new instance of the parser using the given syntax and token queue mode.
Declaration
public NTriplesParser(NTriplesSyntax syntax, TokenQueueMode qmode)
Parameters
Type | Name | Description |
---|---|---|
NTriplesSyntax | syntax | NTriples syntax to parse. |
TokenQueueMode | qmode | Token Queue Mode. |
NTriplesParser(TokenQueueMode)
Creates a new instance of the parser using the given token queue mode.
Declaration
public NTriplesParser(TokenQueueMode qmode)
Parameters
Type | Name | Description |
---|---|---|
TokenQueueMode | qmode | Token Queue Mode. |
Properties
| Edit this page View SourceSyntax
Gets/Sets the desired NTriples syntax.
Declaration
public NTriplesSyntax Syntax { get; set; }
Property Value
Type | Description |
---|---|
NTriplesSyntax |
TokenQueueMode
Gets/Sets the token queue mode used.
Declaration
public TokenQueueMode TokenQueueMode { get; set; }
Property Value
Type | Description |
---|---|
TokenQueueMode |
TraceParsing
Controls whether Parser progress will be traced by writing output to the Console.
Declaration
public bool TraceParsing { get; set; }
Property Value
Type | Description |
---|---|
bool |
TraceTokeniser
Controls whether Tokeniser progress will be traced by writing output to the Console.
Declaration
public bool TraceTokeniser { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceLoad(IGraph, StreamReader)
Parses NTriples Syntax from the given Input Stream into Triples in the given Graph.
Declaration
public void Load(IGraph g, StreamReader input)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to create Triples in. |
StreamReader | input | Arbitrary Input Stream to read input from. |
Load(IGraph, TextReader)
Parses NTriples Syntax from the given Input into Triples in the given Graph.
Declaration
public void Load(IGraph g, TextReader input)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to create Triples in. |
TextReader | input | Arbitrary Input to read input from. |
Load(IGraph, string)
Parses NTriples Syntax from the given File into Triples in the given Graph.
Declaration
public void Load(IGraph g, string filename)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to create Triples in. |
string | filename | Name of the file containing Turtle Syntax. |
Remarks
Simply opens an StreamReader and uses the overloaded version of this function.
Load(IRdfHandler, StreamReader)
Parses NTriples Syntax from the given Input Stream using a RDF Handler.
Declaration
public void Load(IRdfHandler handler, StreamReader input)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handler to use. |
StreamReader | input | Input Stream to read input from. |
Load(IRdfHandler, StreamReader, IUriFactory)
Parses NTriples Syntax from the given Input Stream using a RDF Handler.
Declaration
public void Load(IRdfHandler handler, StreamReader input, IUriFactory uriFactory)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handler to use. |
StreamReader | input | Input Stream to read input from. |
IUriFactory | uriFactory | URI Factory to use. |
Load(IRdfHandler, TextReader)
Parses NTriples Syntax from the given Input using a RDF Handler.
Declaration
public void Load(IRdfHandler handler, TextReader input)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handler to use. |
TextReader | input | Input to read input from. |
Load(IRdfHandler, TextReader, IUriFactory)
Parses NTriples syntax from the given input using the specified RDF handler and URI factory.
Declaration
public void Load(IRdfHandler handler, TextReader input, IUriFactory uriFactory)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handler to use. |
TextReader | input | Input to read from. |
IUriFactory | uriFactory | URI factory to use. |
Load(IRdfHandler, string)
Parses NTriples Syntax from the given file using a RDF Handler.
Declaration
public void Load(IRdfHandler handler, string filename)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handler to use. |
string | filename | File to read from. |
Load(IRdfHandler, string, IUriFactory)
Method for Loading RDF using a RDF Handler from some Concrete RDF Syntax from a given File.
Declaration
public void Load(IRdfHandler handler, string filename, IUriFactory uriFactory)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handler to use. |
string | filename | The Filename of the File to read from. |
IUriFactory | uriFactory | URI factory to use. |
Exceptions
Type | Condition |
---|---|
RdfException | Thrown if the Parser tries to output something that is invalid RDF. |
RdfParseException | Thrown if the Parser cannot Parse the Input. |
IOException | Thrown if the Parser encounters an IO Error while trying to access/parse the Stream. |
ToString()
Gets the String representation of the Parser which is a description of the syntax it parses.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
Events
| Edit this page View SourceWarning
Event which is raised when there is a non-fatal issue with the NTriples being parsed
Declaration
public event RdfReaderWarning Warning
Event Type
Type | Description |
---|---|
RdfReaderWarning |