Class TurtleParser
Parser for Turtle syntax.
Inherited Members
Namespace: VDS.RDF.Parsing
Assembly: dotNetRdf.dll
Syntax
public class TurtleParser : IRdfReader, ITraceableParser, ITraceableTokeniser, ITokenisingParser
Constructors
| Edit this page View SourceTurtleParser()
Creates a new Turtle Parser.
Declaration
public TurtleParser()
TurtleParser(TokenQueueMode)
Creates a new Turtle Parser which uses the given Token Queue Mode.
Declaration
public TurtleParser(TokenQueueMode queueMode)
Parameters
Type | Name | Description |
---|---|---|
TokenQueueMode | queueMode | Queue Mode for Turtle. |
TurtleParser(TokenQueueMode, TurtleSyntax, bool)
Creates a new Turtle Parser which uses the given Token Queue Mode.
Declaration
public TurtleParser(TokenQueueMode queueMode, TurtleSyntax syntax, bool validateIris = false)
Parameters
Type | Name | Description |
---|---|---|
TokenQueueMode | queueMode | Queue Mode for Turtle. |
TurtleSyntax | syntax | Turtle Syntax. |
bool | validateIris | Whether or not to validate IRIs during tokenization. |
Remarks
IRIs will only be validated if syntax
is W3C and validateIris
is true.
TurtleParser(TurtleSyntax)
Creates a new Turtle Parser.
Declaration
[Obsolete("The Options.ValidateIris API has been deprecated. Please use the constructor that allows IRI validation to be set directly.")]
public TurtleParser(TurtleSyntax syntax)
Parameters
Type | Name | Description |
---|---|---|
TurtleSyntax | syntax | Turtle Syntax. |
Remarks
IRIs will only be validated if syntax
is W3C and ValidateIris is true.
TurtleParser(TurtleSyntax, bool)
Creates a new Turtle Parser.
Declaration
public TurtleParser(TurtleSyntax syntax, bool validateIris)
Parameters
Type | Name | Description |
---|---|---|
TurtleSyntax | syntax | Turtle Syntax. |
bool | validateIris | Whether or not to validate IRIs during tokenization. |
Remarks
IRIs will only be validated if syntax
is W3C and validateIris
is true.
Properties
| Edit this page View SourceTokenQueueMode
Gets/Sets the token queue mode used.
Declaration
public TokenQueueMode TokenQueueMode { get; set; }
Property Value
Type | Description |
---|---|
TokenQueueMode |
TraceParsing
Gets/Sets whether Parsing Trace is written to the Console.
Declaration
public bool TraceParsing { get; set; }
Property Value
Type | Description |
---|---|
bool |
TraceTokeniser
Gets/Sets whether Tokeniser Trace is written to the Console.
Declaration
public bool TraceTokeniser { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceLoad(IGraph, StreamReader)
Loads a Graph by reading Turtle syntax from the given input.
Declaration
public void Load(IGraph g, StreamReader input)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to load into. |
StreamReader | input | Stream to read from. |
Load(IGraph, TextReader)
Loads a Graph by reading Turtle syntax from the given input.
Declaration
public void Load(IGraph g, TextReader input)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to load into. |
TextReader | input | Input to read from. |
Load(IGraph, string)
Loads a Graph by reading Turtle syntax from the given file.
Declaration
public void Load(IGraph g, string filename)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to load into. |
string | filename | File to read from. |
Load(IRdfHandler, StreamReader)
Loads RDF by reading Turtle syntax from the given input using a RDF Handler.
Declaration
public void Load(IRdfHandler handler, StreamReader input)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handle to use. |
StreamReader | input | Stream to read from. |
Load(IRdfHandler, StreamReader, IUriFactory)
Loads RDF by reading Turtle syntax from the given input using a RDF Handler.
Declaration
public void Load(IRdfHandler handler, StreamReader input, IUriFactory uriFactory)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handle to use. |
StreamReader | input | Stream to read from. |
IUriFactory | uriFactory | URI factory to use. |
Load(IRdfHandler, TextReader)
Loads RDF by reading Turtle syntax from the given input using a RDF Handler.
Declaration
public void Load(IRdfHandler handler, TextReader input)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handle to use. |
TextReader | input | Input to read from. |
Load(IRdfHandler, TextReader, IUriFactory)
Loads RDF by reading Turtle syntax from the given input using a RDF Handler.
Declaration
public void Load(IRdfHandler handler, TextReader input, IUriFactory uriFactory)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handle to use. |
TextReader | input | Input to read from. |
IUriFactory | uriFactory | URI factory to use. |
Load(IRdfHandler, string)
Loads RDF by reading Turtle syntax from the given file using a RDF Handler.
Declaration
public void Load(IRdfHandler handler, string filename)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handle to use. |
string | filename | File to read from. |
Load(IRdfHandler, string, IUriFactory)
Loads RDF by reading Turtle syntax from the given file using a RDF Handler.
Declaration
public void Load(IRdfHandler handler, string filename, IUriFactory uriFactory)
Parameters
Type | Name | Description |
---|---|---|
IRdfHandler | handler | RDF Handle to use. |
string | filename | File to read from. |
IUriFactory | uriFactory | URI factory to use. |
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 the parser detects issues with the input which are non-fatal
Declaration
public event RdfReaderWarning Warning
Event Type
Type | Description |
---|---|
RdfReaderWarning |