Class TurtleSpecsHelper
Helper function relating to the Turtle Specifications.
Inherited Members
Namespace: VDS.RDF.Parsing
Assembly: dotNetRdf.dll
Syntax
public class TurtleSpecsHelper
  Remarks
Not currently used in the actual TurtleTokeniser or TurtleParser but is used for the new TriGTokeniser.
Fields
| Edit this page View SourceLongLiteralsPattern
Pattern for determining whether a given String should be serialized as a Long Literal.
Declaration
public const string LongLiteralsPattern = "[\n\r\t\"]"
  Field Value
| Type | Description | 
|---|---|
| string | 
ValidDecimalPattern
Pattern for Valid Decimals in Turtle.
Declaration
public const string ValidDecimalPattern = "^(\\+|-)?(\\d+\\.\\d*|\\.\\d+|\\d+)$"
  Field Value
| Type | Description | 
|---|---|
| string | 
ValidDoublePattern
Pattern for Valid Doubles in Turtle.
Declaration
public const string ValidDoublePattern = "^(\\+|-)?(\\d+\\.\\d*[eE](\\+|-)?\\d+|\\.\\d+[eE](\\+|-)?\\d+|\\d+[eE](\\+|-)?\\d+)$"
  Field Value
| Type | Description | 
|---|---|
| string | 
ValidIntegerPattern
Pattern for Valid Integers in Turtle.
Declaration
public const string ValidIntegerPattern = "^(\\+|-)?\\d+$"
  Field Value
| Type | Description | 
|---|---|
| string | 
Methods
| Edit this page View SourceInferPlainLiteralType(PlainLiteralToken, TurtleSyntax)
Infers the Type of a Plain Literal.
Declaration
public static Uri InferPlainLiteralType(PlainLiteralToken p, TurtleSyntax syntax)
  Parameters
| Type | Name | Description | 
|---|---|---|
| PlainLiteralToken | p | Plain Literal to infer the Type of.  | 
      
| TurtleSyntax | syntax | Turtle Syntax.  | 
      
Returns
| Type | Description | 
|---|---|
| Uri | A Uri representing the XML Scheme Data Type for the Plain Literal.  | 
      
IsHex(char)
Gets whether a character is a Hex character.
Declaration
public static bool IsHex(char c)
  Parameters
| Type | Name | Description | 
|---|---|---|
| char | c | Character.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsLongLiteral(string)
Determines whether a given String should be serialized as a Long Literal.
Declaration
public static bool IsLongLiteral(string value)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | value | String to test.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsNameChar(char)
Gets whether a character matches the nameChar production from the Turtle specification.
Declaration
public static bool IsNameChar(char c)
  Parameters
| Type | Name | Description | 
|---|---|---|
| char | c | Character.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsNameChar(char, char)
Gets whether a surrogate pair matches the nameChar production from the Turtle specification.
Declaration
public static bool IsNameChar(char c, char d)
  Parameters
| Type | Name | Description | 
|---|---|---|
| char | c | High surrogate.  | 
      
| char | d | Low surrogate.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsNameStartChar(char)
Gets whether a character matches the nameStartChar production from the Turtle specification.
Declaration
public static bool IsNameStartChar(char c)
  Parameters
| Type | Name | Description | 
|---|---|---|
| char | c | Character.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsNameStartChar(char, char)
Gets whether a surrogate pair matches the nameStartChar production from the Turtle specification.
Declaration
public static bool IsNameStartChar(char c, char d)
  Parameters
| Type | Name | Description | 
|---|---|---|
| char | c | High surrogate.  | 
      
| char | d | Low surrogate.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsPLX(char[], int, out int)
Checks whether a given String matches the PLX rule from the Turtle W3C Specification.
Declaration
public static bool IsPLX(char[] cs, int startIndex, out int endIndex)
  Parameters
| Type | Name | Description | 
|---|---|---|
| char[] | cs | String as character array.  | 
      
| int | startIndex | Start Index.  | 
      
| int | endIndex | Resulting End Index.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsPNChars(char)
Gets whether a character matches the PN_CHARS production from the Turtle specification.
Declaration
public static bool IsPNChars(char c)
  Parameters
| Type | Name | Description | 
|---|---|---|
| char | c | Character.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsPNChars(char, char)
Gets whether a surrogate pair matches the PN_CHARS production from the Turtle specification.
Declaration
public static bool IsPNChars(char c, char d)
  Parameters
| Type | Name | Description | 
|---|---|---|
| char | c | High surrogate.  | 
      
| char | d | Low surrogate.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsPNCharsBase(char)
Gets whether a character matches the PN_CHARS_BASE production from the Turtle specifications.
Declaration
public static bool IsPNCharsBase(char c)
  Parameters
| Type | Name | Description | 
|---|---|---|
| char | c | Character.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsPNCharsBase(char, char)
Gets whether a surrogate pair matches the PN_CHARS_BASE production from the Turtle specifications.
Declaration
public static bool IsPNCharsBase(char c, char d)
  Parameters
| Type | Name | Description | 
|---|---|---|
| char | c | High surrogate.  | 
      
| char | d | Low surrogate.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsPNCharsU(char)
Gets whether a character matches the PN_CHARS_U production from the Turtle specification.
Declaration
public static bool IsPNCharsU(char c)
  Parameters
| Type | Name | Description | 
|---|---|---|
| char | c | Character.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsPNCharsU(char, char)
Gets whether a surrogate pair matches the PN_CHARS_U production from the Turtle specification.
Declaration
public static bool IsPNCharsU(char c, char d)
  Parameters
| Type | Name | Description | 
|---|---|---|
| char | c | High surrogate.  | 
      
| char | d | Low surrogate.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsPNLocal(string)
Gets whether the given value matches the PN_LOCAL rule from the Turtle specification.
Declaration
public static bool IsPNLocal(string value)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | value | Value.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsPNPrefix(string, TurtleSyntax)
Gets whether the given value is the valid prefix portion of a prefixed name in Turtle.
Declaration
public static bool IsPNPrefix(string value, TurtleSyntax syntax)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | value | Value.  | 
      
| TurtleSyntax | syntax | Turtle Syntax.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsValidDecimal(string)
Determines whether a given String is a valid Decimal.
Declaration
public static bool IsValidDecimal(string value)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | value | String to test.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsValidDouble(string)
Determines whether a given String is a valid Double.
Declaration
public static bool IsValidDouble(string value)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | value | String to test.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsValidInteger(string)
Determines whether a given String is a valid Integer.
Declaration
public static bool IsValidInteger(string value)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | value | String to test.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsValidLocalName(string, TurtleSyntax)
Gets whether the given value is the valid local name portion of a prefixed name in Turtle.
Declaration
public static bool IsValidLocalName(string value, TurtleSyntax syntax)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | value | Value.  | 
      
| TurtleSyntax | syntax | Turtle Syntax.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsValidPlainLiteral(string, Uri, TurtleSyntax)
Determines whether a given String is a valid Plain Literal for the given Datatype.
Declaration
public static bool IsValidPlainLiteral(string value, Uri dt, TurtleSyntax syntax)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | value | Value.  | 
      
| Uri | dt | Datatype.  | 
      
| TurtleSyntax | syntax | Turtle Syntax.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsValidPlainLiteral(string, TurtleSyntax)
Determines whether a given String is a valid Plain Literal.
Declaration
public static bool IsValidPlainLiteral(string value, TurtleSyntax syntax)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | value | String to test.  | 
      
| TurtleSyntax | syntax | Turtle Syntax.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsValidPrefix(string, TurtleSyntax)
Gets whether the given value is a valid prefix in Turtle.
Declaration
public static bool IsValidPrefix(string value, TurtleSyntax syntax)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | value | Value.  | 
      
| TurtleSyntax | syntax | Turtle Syntax.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsValidQName(string)
Gets whether a QName is valid in Turtle (assumes Turtle as originally specified by Dave Beckett).
Declaration
public static bool IsValidQName(string value)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | value | QName.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
IsValidQName(string, TurtleSyntax)
Determines whether a given String is a valid QName.
Declaration
public static bool IsValidQName(string value, TurtleSyntax syntax)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | value | String to test.  | 
      
| TurtleSyntax | syntax | Turtle Syntax.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
UnescapeQName(string)
Unescapes local name escapes in a QName.
Declaration
public static string UnescapeQName(string value)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | value | QName.  | 
      
Returns
| Type | Description | 
|---|---|
| string | Unescaped QName.  |