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. |
IRdf |
evt | Event causing the Error. |
Returns
Type | Description |
---|---|
Rdf |
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. |
IRdf |
evt | Event causing the Error. |
Returns
Type | Description |
---|---|
Rdf |
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 |
---|---|
Rdf |
Stop()
Throws a Rdf
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
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 |
---|---|---|
IParser |
context | Parser Context. |
IToken | t | Token to resolve. |
System. |
allowDefaultPrefixFallback | Whether when the default prefix is used but not defined it can fallback to the Base URI. |
System. |
qnameUnescape | QName unescaping function. |
Returns
Type | Description |
---|---|
IUri |
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 |
---|---|---|
IParser |
context | Parser Context. |
IToken | t | Token to resolve. |
System. |
allowDefaultPrefixFallback | Whether when the default prefix is used but not defined it can fallback to the Base URI. |
Returns
Type | Description |
---|---|
IUri |
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 |
---|---|---|
IParser |
context | Parser Context. |
IToken | t | Token to resolve. |
Returns
Type | Description |
---|---|
IUri |
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 |
---|---|---|
IStore |
context | Parser Context. |
IToken | t | Token to resolve. |
Returns
Type | Description |
---|---|
IRef |