A literal (text string) node in an RDF graph.
Literals are string values optionally tagged with a language or datatype URI.
An explicit conversion operator is defined from strings to literals as a convenience. The operator converts the string to a literal by returning a literal with that value, and null language and datatype.
The following examples create literal nodes.
C# Example Literal thing1 = new Literal("SemWeb: The C# Library"); Literal thing2 = (Literal)"SemWeb: The C# Library"; // explicit operator overload Literal thing3 = new Literal("SemWeb: The C# Library", "en", null); // with language Literal thing3 = new Literal("SemWeb: The C# Library", null, "http://www.w3.org/2001/XMLSchema#string"); // with datatype Console.WriteLine(thing1.Value); Console.WriteLine(thing2.Language); Console.WriteLine(thing3.DataType);
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.1, 1.0.6.2, 1.0.7.0
See Also: Inherited members from Resource.
⊟ Public Constructors
⊟ Public Properties
⊟ Public Methods
overrideEquals (object) : bool Documentation for this section has not yet been entered. staticFromValue (bool) : Literal Returns an XSD-typed boolean literal from the given value. staticFromValue (byte) : Literal Returns an XSD-typed (unsigned) byte literal from the given value. staticFromValue (DateTime) : Literal Returns an XSD-typed dateTime literal from the given value representing a date and UTC time. staticFromValue (decimal) : Literal Returns an XSD-typed decimal literal from the given value. staticFromValue (double) : Literal Returns an XSD-typed double-precision literal from the given value. staticFromValue (short) : Literal Returns an XSD-typed short literal from the given value. staticFromValue (int) : Literal Returns an XSD-typed int literal from the given value. staticFromValue (long) : Literal Returns an XSD-typed long literal from the given value. staticFromValue (sbyte) : Literal Returns an XSD-typed (signed) byte literal from the given value. staticFromValue (float) : Literal Returns an XSD-typed floating-point literal from the given value. staticFromValue (string) : Literal Returns an XSD-typed string literal from the given value. staticFromValue (TimeSpan) : Literal Returns an XSD-typed duration literal from the given value. staticFromValue (ushort) : Literal Returns an XSD-typed unsigned short literal from the given value. staticFromValue (uint) : Literal Returns an XSD-typed unsigned int literal from the given value. staticFromValue (ulong) : Literal Returns an XSD-typed boolean literal from the given value. staticFromValue (Uri) : Literal Returns an XSD-typed URI (anyURI) literal from the given value. staticFromValue (DateTime, bool, bool) : Literal Returns an XSD-typed date or dateTime literal from the given value. staticFromValue (TimeSpan, bool, bool) : Literal Returns an XSD-typed duration or time literal from the given value. overrideGetHashCode () : int Documentation for this section has not yet been entered.Normalize () : Literal Creates a normalized form of the literal. staticParse (string, NamespaceManager) : Literal Parses a literal value.ParseValue () : object Gets a native .NET type for the literl value using a XSD DataType. overrideToString () : string Documentation for this section has not yet been entered.⊟ Public Operators
staticConversion to SemWeb.Literal (Explicit) Converts a string to a Literal object whose language and datatype are null.
⊟ Literal Constructor
Creates a new Literal with the given string value.
public Literal (string value)⊟ Parameters
- value
- The value of the Literal node.
⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ Literal Constructor
Creates a new Literal with the given value, language, and datatype.
⊟ Parameters
- value
- The value of the Literal node.
- language
- A language identifier, or null to leave the language unspecified.
- dataType
- The URI that gives the datatype of the literal, or null to leave the specific datatype unspecified.
⊟ Exceptions
Type Reason ArgumentException Documentation for this section has not yet been entered. ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
A language and datatype cannot both be specified, following to the RDF standard. An exception will be thrown if both are given.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ DataType Property
The datatype URI of the literal.
public string DataType { get; }⊟ Value
The datatype URI of the literal, or null.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ Equals Method
Documentation for this section has not yet been entered.
⊟ Parameters
- other
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed boolean literal from the given value.
⊟ Parameters
- value
- A value.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed (unsigned) byte literal from the given value.
⊟ Parameters
- value
- A value.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed dateTime literal from the given value representing a date and UTC time.
⊟ Parameters
- value
- A value whose time is in UTC.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed decimal literal from the given value.
⊟ Parameters
- value
- A value.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed double-precision literal from the given value.
⊟ Parameters
- value
- A value.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed short literal from the given value.
⊟ Parameters
- value
- A value.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed int literal from the given value.
⊟ Parameters
- value
- A value.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed long literal from the given value.
⊟ Parameters
- value
- A value.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed (signed) byte literal from the given value.
⊟ Parameters
- value
- A value.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed floating-point literal from the given value.
⊟ Parameters
- value
- A value.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed string literal from the given value.
⊟ Parameters
- value
- A value.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed duration literal from the given value.
⊟ Parameters
- value
- A value.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed unsigned short literal from the given value.
⊟ Parameters
- value
- A value.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed unsigned int literal from the given value.
⊟ Parameters
- value
- A value.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed boolean literal from the given value.
⊟ Parameters
- value
- A value.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed URI (anyURI) literal from the given value.
⊟ Parameters
- value
- A value.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed date or dateTime literal from the given value.
⊟ Parameters
- value
- A date value, optionally with a time component.
- withTime
- A boolean indicating whether value has a time component, or else only has a date component.
- isLocalTime
- A boolean value indicating whether the time component of value is a local time, or else is a UTC time.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ FromValue Method
Returns an XSD-typed duration or time literal from the given value.
⊟ Parameters
- value
- A value.
- asTime
- A boolean value indicating whether value should be interpreted as a time, or else as a duration.
- isLocalTime
- If asTime is true, then isLocalTime is a boolean value indicating whether value is a local time, or else is a UTC time.
⊟ Returns
A new Literal object with the indicated XSD datatype and a value in the lexical space of that datatype according to the parameters given.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ GetHashCode Method
Documentation for this section has not yet been entered.
public override int GetHashCode ()⊟ Returns
Documentation for this section has not yet been entered.⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 1.0.7.0
⊟ Language Property
The language of the literal.
public string Language { get; }⊟ Value
The language identifier of the literal, or null.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ Normalize Method
Creates a normalized form of the literal.
public Literal Normalize ()⊟ Returns
A normalized form of the literal.⊟ Remarks
If this literal has a DataType recognized by the Literal.ParseValue() method, this method returns a new literal whose value is a normalized form of the value of this literal. Otherwise, Normalize returns the literal unchanged.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ Conversion Method
Converts a string to a Literal object whose language and datatype are null.
⊟ Parameters
- value
- The string value to convert to a Literal object.
⊟ Returns
A literal object whose Value is the string, and whose language and datatype are null.⊟ Remarks
This is an explicit cast operator.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ Parse Method
Parses a literal value.
⊟ Parameters
- literal
- An N3-encoded form of a literal.
- namespaces
- A namespace manager used to resolve the literal's datatype, if present, or null.
⊟ Returns
A Literal object.⊟ Exceptions
Type Reason ArgumentException Documentation for this section has not yet been entered. FormatException Documentation for this section has not yet been entered. ⊟ Remarks
The encoded literal must be in the form of: "value"[@langcode | ^^datatypeURI].
If namespaces is null and a datatype was provided as a QName, or if the QName prefix was not found in the namespace manager, an ArgumentException is thrown.
⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ ParseValue Method
Gets a native .NET type for the literl value using a XSD DataType.
public object ParseValue ()⊟ Returns
A string, boolean, integer, or other value, as described below.⊟ Remarks
If the DataType of the literal is not set, or if the DataType is not one of the following recognized types, the literal's string value is returned.
The recognized types below are all in the http://www.w3.org/2001/XMLSchema# namespace. That is, where it says "string" below, it means the DataType is http://www.w3.org/2001/XMLSchema#string.
DataType(s) Return Value string, normalizedString, anyURI The literal's value, as a string. boolean A bool, true if the literal's value is "true" or "1", false otherwise. decimal, integer, positiveInteger, nonPositiveInteger, negativeInteger, nonNegativeInteger The literal's value as a decimal using decimal.Parse(string). float or double The literal's value as a float for float or double for double, using the appropriate Parse method. duration The literal's value as a TimeSpan using TimeSpan.Parse(string). dateTime, date, time The literal's value as a SemWeb.XsdDateTime. long, int, short, byte The literal's value as a long, int, short, or sbyte using the appropriate Parse method. unsignedLong, unsignedInt, unsignedShort, unsignedByte The literal's value as a ulong, uint, ushort, or byte using the appropriate Parse method. ⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0
⊟ ToString Method
Documentation for this section has not yet been entered.
public override string ToString ()⊟ Returns
Documentation for this section has not yet been entered.⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 1.0.7.0
⊟ Uri Property
Documentation for this section has not yet been entered.
public override string Uri { get; }⊟ Value
Documentation for this section has not yet been entered.⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 1.0.7.0
⊟ Value Property
The value of the literal.
public string Value { get; }⊟ Value
The string value of the literal.⊟ Remarks
None.⊟ Requirements
Namespace: SemWeb
Assembly: SemWeb (in SemWeb.dll)
Assembly Versions: 0.0.0.0, 1.0.6.2, 1.0.7.0