Show / Hide Table of Contents

Class ParserHelper

Static Helper class containing useful methods for Parsers.

Inheritance
System.Object
ParserHelper
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF.Parsing
Assembly: dotNetRdf.dll
Syntax
public static class ParserHelper

Methods

| Improve this Doc View Source

Error(string, string, IRdfXmlEvent)

Helper function which generates standardised Error Messages.

Declaration
public static RdfParseException Error(string message, string production, IRdfXmlEvent evt)
Parameters
Type Name Description
string message

Error Message.

string production

The Production where the Error occurred.

IRdfXmlEvent evt

Event causing the Error.

Returns
Type Description
RdfParseException
| Improve this Doc View Source

Error(string, IRdfXmlEvent)

Helper function which generates standardised Error Messages.

Declaration
public static RdfParseException Error(string message, IRdfXmlEvent evt)
Parameters
Type Name Description
string message

Error Message.

IRdfXmlEvent evt

Event causing the Error.

Returns
Type Description
RdfParseException
| Improve this Doc View Source

Error(string, IToken)

Helper method for raising informative standardised Parser Errors.

Declaration
public static RdfParseException Error(string msg, IToken t)
Parameters
Type Name Description
string msg

The Error Message.

IToken t

The Token that is the cause of the Error.

Returns
Type Description
RdfParseException
| Improve this Doc View Source

Stop()

Throws a RdfParsingTerminatedException which is used to tell the parser that it should stop parsing.

Declaration
public static void Stop()
| Improve this Doc View Source

TryResolveUri(IGraph, IToken)

Attempts to resolve a QName or URI Token into a URI Node and produces appropriate error messages if this fails.

Declaration
public static INode TryResolveUri(IGraph g, IToken t)
Parameters
Type Name Description
IGraph g

Graph.

IToken t

Token to resolve.

Returns
Type Description
INode
| Improve this Doc View Source

TryResolveUri(IParserContext, IToken, bool, Func<string, string>)

Attempts to resolve a QName or URI Token into a URI Node and produces appropriate error messages if this fails.

Declaration
public static IUriNode TryResolveUri(IParserContext context, IToken t, bool allowDefaultPrefixFallback, Func<string, string> qnameUnescape)
Parameters
Type Name Description
IParserContext context

Parser Context.

IToken t

Token to resolve.

System.Boolean allowDefaultPrefixFallback

Whether when the default prefix is used but not defined it can fallback to the Base URI.

System.Func<T, TResult><string, string> qnameUnescape

QName unescaping function.

Returns
Type Description
IUriNode
| Improve this Doc View Source

TryResolveUri(IParserContext, IToken, bool)

Attempts to resolve a QName or URI Token into a URI Node and produces appropriate error messages if this fails.

Declaration
public static IUriNode TryResolveUri(IParserContext context, IToken t, bool allowDefaultPrefixFallback)
Parameters
Type Name Description
IParserContext context

Parser Context.

IToken t

Token to resolve.

System.Boolean allowDefaultPrefixFallback

Whether when the default prefix is used but not defined it can fallback to the Base URI.

Returns
Type Description
IUriNode
| Improve this Doc View Source

TryResolveUri(IParserContext, IToken)

Attempts to resolve a QName or URI Token into a URI Node and produces appropriate error messages if this fails.

Declaration
public static IUriNode TryResolveUri(IParserContext context, IToken t)
Parameters
Type Name Description
IParserContext context

Parser Context.

IToken t

Token to resolve.

Returns
Type Description
IUriNode
| Improve this Doc View Source

TryResolveUri(IStoreParserContext, IToken)

Attempts to resolve a QName or URI Token into a URI Node and produces appropriate error messages if this fails.

Declaration
public static IRefNode TryResolveUri(IStoreParserContext context, IToken t)
Parameters
Type Name Description
IStoreParserContext context

Parser Context.

IToken t

Token to resolve.

Returns
Type Description
IRefNode
  • Improve this Doc
  • View Source
In This Article
  • Methods
    • Error(string, string, IRdfXmlEvent)
    • Error(string, IRdfXmlEvent)
    • Error(string, IToken)
    • Stop()
    • TryResolveUri(IGraph, IToken)
    • TryResolveUri(IParserContext, IToken, bool, Func<string, string>)
    • TryResolveUri(IParserContext, IToken, bool)
    • TryResolveUri(IParserContext, IToken)
    • TryResolveUri(IStoreParserContext, IToken)
Back to top Generated by DocFX