Class ParserHelper
Static Helper class containing useful methods for Parsers.
Inheritance
Inherited Members
Namespace: VDS.RDF.Parsing
Assembly: dotNetRdf.dll
Syntax
public static class ParserHelper
Methods
| Improve this Doc View SourceError(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 |
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 |
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 |
Stop()
Throws a RdfParsingTerminatedException which is used to tell the parser that it should stop parsing.
Declaration
public static void Stop()
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 |
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 |
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 |
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 |
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 |