Show / Hide Table of Contents

Class TurtleSpecsHelper

Helper function relating to the Turtle Specifications.

Inheritance
object
TurtleSpecsHelper
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 class TurtleSpecsHelper
Remarks

Not currently used in the actual TurtleTokeniser or TurtleParser but is used for the new TriGTokeniser.

Fields

| Edit this page View Source

LongLiteralsPattern

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
| Edit this page View Source

ValidDecimalPattern

Pattern for Valid Decimals in Turtle.

Declaration
public const string ValidDecimalPattern = "^(\\+|-)?(\\d+\\.\\d*|\\.\\d+|\\d+)$"
Field Value
Type Description
string
| Edit this page View Source

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
| Edit this page View Source

ValidIntegerPattern

Pattern for Valid Integers in Turtle.

Declaration
public const string ValidIntegerPattern = "^(\\+|-)?\\d+$"
Field Value
Type Description
string

Methods

| Edit this page View Source

InferPlainLiteralType(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.

| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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.

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Fields
    • LongLiteralsPattern
    • ValidDecimalPattern
    • ValidDoublePattern
    • ValidIntegerPattern
  • Methods
    • InferPlainLiteralType(PlainLiteralToken, TurtleSyntax)
    • IsHex(char)
    • IsLongLiteral(string)
    • IsNameChar(char)
    • IsNameChar(char, char)
    • IsNameStartChar(char)
    • IsNameStartChar(char, char)
    • IsPLX(char[], int, out int)
    • IsPNChars(char)
    • IsPNChars(char, char)
    • IsPNCharsBase(char)
    • IsPNCharsBase(char, char)
    • IsPNCharsU(char)
    • IsPNCharsU(char, char)
    • IsPNLocal(string)
    • IsPNPrefix(string, TurtleSyntax)
    • IsValidDecimal(string)
    • IsValidDouble(string)
    • IsValidInteger(string)
    • IsValidLocalName(string, TurtleSyntax)
    • IsValidPlainLiteral(string, Uri, TurtleSyntax)
    • IsValidPlainLiteral(string, TurtleSyntax)
    • IsValidPrefix(string, TurtleSyntax)
    • IsValidQName(string)
    • IsValidQName(string, TurtleSyntax)
    • UnescapeQName(string)
  • Extension Methods
Back to top Generated by DocFX