Show / Hide Table of Contents

Class LiteralExtensions

Provides extension methods for converting primitive types into appropriately typed Literal Nodes.
Inheritance
System.Object
LiteralExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: VDS.RDF
Assembly: dotNetRDF.dll
Syntax
public static class LiteralExtensions

Methods

| Improve this Doc View Source

ToLiteral(Boolean, INodeFactory)

Creates a new Boolean typed literal.
Declaration
public static ILiteralNode ToLiteral(this bool b, INodeFactory factory)
Parameters
Type Name Description
System.Boolean b Boolean.
INodeFactory factory Node Factory to use for Node creation.
Returns
Type Description
ILiteralNode Literal representing the boolean.
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Factory argument is null.
| Improve this Doc View Source

ToLiteral(Byte, INodeFactory)

Creates a new Byte typed literal.
Declaration
public static ILiteralNode ToLiteral(this byte b, INodeFactory factory)
Parameters
Type Name Description
System.Byte b Byte.
INodeFactory factory Node Factory to use for Node creation.
Returns
Type Description
ILiteralNode Literal representing the byte.
Remarks
Byte in .Net is actually equivalent to Unsigned Byte in XML Schema so depending on the value of the Byte the type will either be xsd:byte if it fits or xsd:usignedByte.
| Improve this Doc View Source

ToLiteral(DateTime, INodeFactory)

Creates a new Date Time typed literal.
Declaration
public static ILiteralNode ToLiteral(this DateTime dt, INodeFactory factory)
Parameters
Type Name Description
System.DateTime dt Date Time.
INodeFactory factory Node Factory to use for Node creation.
Returns
Type Description
ILiteralNode Literal representing the date time.
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Factory argument is null.
| Improve this Doc View Source

ToLiteral(DateTime, INodeFactory, Boolean)

Creates a new Date Time typed literal.
Declaration
public static ILiteralNode ToLiteral(this DateTime dt, INodeFactory factory, bool precise)
Parameters
Type Name Description
System.DateTime dt Date Time.
INodeFactory factory Node Factory to use for Node creation.
System.Boolean precise Whether to preserve precisely i.e. include fractional seconds.
Returns
Type Description
ILiteralNode Literal representing the date time.
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Factory argument is null.
| Improve this Doc View Source

ToLiteral(DateTimeOffset, INodeFactory)

Creates a new Date Time typed literal.
Declaration
public static ILiteralNode ToLiteral(this DateTimeOffset dt, INodeFactory factory)
Parameters
Type Name Description
System.DateTimeOffset dt Date Time.
INodeFactory factory Node Factory to use for Node creation.
Returns
Type Description
ILiteralNode Literal representing the date time.
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Factory argument is null.
| Improve this Doc View Source

ToLiteral(DateTimeOffset, INodeFactory, Boolean)

Creates a new Date Time typed literal.
Declaration
public static ILiteralNode ToLiteral(this DateTimeOffset dt, INodeFactory factory, bool precise)
Parameters
Type Name Description
System.DateTimeOffset dt Date Time.
INodeFactory factory Node Factory to use for Node creation.
System.Boolean precise Whether to preserve precisely i.e. include fractional seconds.
Returns
Type Description
ILiteralNode Literal representing the date time.
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Factory argument is null.
| Improve this Doc View Source

ToLiteral(Decimal, INodeFactory)

Creates a new Decimal typed literal.
Declaration
public static ILiteralNode ToLiteral(this decimal d, INodeFactory factory)
Parameters
Type Name Description
System.Decimal d Decimal.
INodeFactory factory Node Factory to use for Node creation.
Returns
Type Description
ILiteralNode Literal representing the decimal.
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Factory argument is null.
| Improve this Doc View Source

ToLiteral(Double, INodeFactory)

Creates a new Double typed literal.
Declaration
public static ILiteralNode ToLiteral(this double d, INodeFactory factory)
Parameters
Type Name Description
System.Double d Double.
INodeFactory factory Node Factory to use for Node creation.
Returns
Type Description
ILiteralNode Literal representing the double.
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Factory argument is null.
| Improve this Doc View Source

ToLiteral(Int16, INodeFactory)

Creates a new Integer typed literal.
Declaration
public static ILiteralNode ToLiteral(this short i, INodeFactory factory)
Parameters
Type Name Description
System.Int16 i Integer.
INodeFactory factory Node Factory to use for Node creation.
Returns
Type Description
ILiteralNode Literal representing the short.
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Factory argument is null.
| Improve this Doc View Source

ToLiteral(Int32, INodeFactory)

Creates a new Integer typed literal.
Declaration
public static ILiteralNode ToLiteral(this int i, INodeFactory factory)
Parameters
Type Name Description
System.Int32 i Integer.
INodeFactory factory Node Factory to use for Node creation.
Returns
Type Description
ILiteralNode Literal representing the integer.
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Factory argument is null.
| Improve this Doc View Source

ToLiteral(Int64, INodeFactory)

Creates a new Integer typed literal.
Declaration
public static ILiteralNode ToLiteral(this long l, INodeFactory factory)
Parameters
Type Name Description
System.Int64 l Integer.
INodeFactory factory Node Factory to use for Node creation.
Returns
Type Description
ILiteralNode Literal representing the integer.
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Factory argument is null.
| Improve this Doc View Source

ToLiteral(SByte, INodeFactory)

Creates a new Byte typed literal.
Declaration
public static ILiteralNode ToLiteral(this sbyte b, INodeFactory factory)
Parameters
Type Name Description
System.SByte b Byte.
INodeFactory factory Node Factory to use for Node creation.
Returns
Type Description
ILiteralNode Literal representing the signed bytes.
Remarks
SByte in .Net is directly equivalent to Byte in XML Schema so the type will always be xsd:byte.
| Improve this Doc View Source

ToLiteral(Single, INodeFactory)

Creates a new Float typed literal.
Declaration
public static ILiteralNode ToLiteral(this float f, INodeFactory factory)
Parameters
Type Name Description
System.Single f Float.
INodeFactory factory Node Factory to use for Node creation.
Returns
Type Description
ILiteralNode Literal representing the float.
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Factory argument is null.
| Improve this Doc View Source

ToLiteral(String, INodeFactory)

Creates a new String typed literal.
Declaration
public static ILiteralNode ToLiteral(this string s, INodeFactory factory)
Parameters
Type Name Description
System.String s String.
INodeFactory factory Node Factory to use for Node creation.
Returns
Type Description
ILiteralNode Literal representing the string.
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Graph/String argument is null.
| Improve this Doc View Source

ToLiteral(TimeSpan, INodeFactory)

Creates a new duration typed literal.
Declaration
public static ILiteralNode ToLiteral(this TimeSpan t, INodeFactory factory)
Parameters
Type Name Description
System.TimeSpan t Time Span.
INodeFactory factory Node Factory to use for Node creation.
Returns
Type Description
ILiteralNode Literal representing the time span.
| Improve this Doc View Source

ToLiteralDate(DateTime, INodeFactory)

Creates a new Date typed literal.
Declaration
public static ILiteralNode ToLiteralDate(this DateTime dt, INodeFactory factory)
Parameters
Type Name Description
System.DateTime dt Date Time.
INodeFactory factory Node Factory to use for Node creation.
Returns
Type Description
ILiteralNode
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Factory argument is null.
| Improve this Doc View Source

ToLiteralDate(DateTimeOffset, INodeFactory)

Creates a new Date typed literal.
Declaration
public static ILiteralNode ToLiteralDate(this DateTimeOffset dt, INodeFactory factory)
Parameters
Type Name Description
System.DateTimeOffset dt Date Time.
INodeFactory factory Node Factory to use for Node creation.
Returns
Type Description
ILiteralNode
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Factory argument is null.
| Improve this Doc View Source

ToLiteralTime(DateTime, INodeFactory)

Creates a new Time typed literal.
Declaration
public static ILiteralNode ToLiteralTime(this DateTime dt, INodeFactory factory)
Parameters
Type Name Description
System.DateTime dt Date Time.
INodeFactory factory Node Factory to use for Node creation.
Returns
Type Description
ILiteralNode Literal representing the time.
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Factory argument is null.
| Improve this Doc View Source

ToLiteralTime(DateTime, INodeFactory, Boolean)

Creates a new Time typed literal.
Declaration
public static ILiteralNode ToLiteralTime(this DateTime dt, INodeFactory factory, bool precise)
Parameters
Type Name Description
System.DateTime dt Date Time.
INodeFactory factory Node Factory to use for Node creation.
System.Boolean precise Whether to preserve precisely i.e. include fractional seconds.
Returns
Type Description
ILiteralNode Literal representing the time.
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Factory argument is null.
| Improve this Doc View Source

ToLiteralTime(DateTimeOffset, INodeFactory)

Creates a new Time typed literal.
Declaration
public static ILiteralNode ToLiteralTime(this DateTimeOffset dt, INodeFactory factory)
Parameters
Type Name Description
System.DateTimeOffset dt Date Time.
INodeFactory factory Node Factory to use for Node creation.
Returns
Type Description
ILiteralNode Literal representing the time.
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Factory argument is null.
| Improve this Doc View Source

ToLiteralTime(DateTimeOffset, INodeFactory, Boolean)

Creates a new Time typed literal.
Declaration
public static ILiteralNode ToLiteralTime(this DateTimeOffset dt, INodeFactory factory, bool precise)
Parameters
Type Name Description
System.DateTimeOffset dt Date Time.
INodeFactory factory Node Factory to use for Node creation.
System.Boolean precise Whether to preserve precisely i.e. include fractional seconds.
Returns
Type Description
ILiteralNode Literal representing the time.
Exceptions
Type Condition
System.ArgumentNullException Thrown if the Factory argument is null.
  • Improve this Doc
  • View Source
In This Article
  • Methods
    • ToLiteral(Boolean, INodeFactory)
    • ToLiteral(Byte, INodeFactory)
    • ToLiteral(DateTime, INodeFactory)
    • ToLiteral(DateTime, INodeFactory, Boolean)
    • ToLiteral(DateTimeOffset, INodeFactory)
    • ToLiteral(DateTimeOffset, INodeFactory, Boolean)
    • ToLiteral(Decimal, INodeFactory)
    • ToLiteral(Double, INodeFactory)
    • ToLiteral(Int16, INodeFactory)
    • ToLiteral(Int32, INodeFactory)
    • ToLiteral(Int64, INodeFactory)
    • ToLiteral(SByte, INodeFactory)
    • ToLiteral(Single, INodeFactory)
    • ToLiteral(String, INodeFactory)
    • ToLiteral(TimeSpan, INodeFactory)
    • ToLiteralDate(DateTime, INodeFactory)
    • ToLiteralDate(DateTimeOffset, INodeFactory)
    • ToLiteralTime(DateTime, INodeFactory)
    • ToLiteralTime(DateTime, INodeFactory, Boolean)
    • ToLiteralTime(DateTimeOffset, INodeFactory)
    • ToLiteralTime(DateTimeOffset, INodeFactory, Boolean)
Back to top Generated by DocFX