Show / Hide Table of Contents

Class NTriplesParser

Parser for NTriples syntax.

Inheritance
object
NTriplesParser
Implements
IRdfReader
ITraceableParser
ITraceableTokeniser
ITokenisingParser
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: VDS.RDF.Parsing
Assembly: dotNetRdf.dll
Syntax
public class NTriplesParser : IRdfReader, ITraceableParser, ITraceableTokeniser, ITokenisingParser

Constructors

| Edit this page View Source

NTriplesParser()

Creates a new instance of the parser.

Declaration
public NTriplesParser()
| Edit this page View Source

NTriplesParser(NTriplesSyntax)

Creates a new instance of the parser.

Declaration
public NTriplesParser(NTriplesSyntax syntax)
Parameters
Type Name Description
NTriplesSyntax syntax

NTriples syntax to parse.

| Edit this page View Source

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.

| Edit this page View Source

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 Source

Syntax

Gets/Sets the desired NTriples syntax.

Declaration
public NTriplesSyntax Syntax { get; set; }
Property Value
Type Description
NTriplesSyntax
| Edit this page View Source

TokenQueueMode

Gets/Sets the token queue mode used.

Declaration
public TokenQueueMode TokenQueueMode { get; set; }
Property Value
Type Description
TokenQueueMode
| Edit this page View Source

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
| Edit this page View Source

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 Source

Load(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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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
object.ToString()

Events

| Edit this page View Source

Warning

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

Implements

IRdfReader
ITraceableParser
ITraceableTokeniser
ITokenisingParser

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • NTriplesParser()
    • NTriplesParser(NTriplesSyntax)
    • NTriplesParser(NTriplesSyntax, TokenQueueMode)
    • NTriplesParser(TokenQueueMode)
  • Properties
    • Syntax
    • TokenQueueMode
    • TraceParsing
    • TraceTokeniser
  • Methods
    • Load(IGraph, StreamReader)
    • Load(IGraph, TextReader)
    • Load(IGraph, string)
    • Load(IRdfHandler, StreamReader)
    • Load(IRdfHandler, StreamReader, IUriFactory)
    • Load(IRdfHandler, TextReader)
    • Load(IRdfHandler, TextReader, IUriFactory)
    • Load(IRdfHandler, string)
    • Load(IRdfHandler, string, IUriFactory)
    • ToString()
  • Events
    • Warning
  • Implements
  • Extension Methods
Back to top Generated by DocFX