Class NumericNode
A Valued Node with a numeric value.
Inheritance
NumericNode
Implements
Inherited Members
Namespace: VDS.RDF.Nodes
Assembly: dotNetRdf.dll
Syntax
public abstract class NumericNode : LiteralNode, ILiteralNode, IEquatable<BaseLiteralNode>, IComparable<BaseLiteralNode>, IEquatable<LiteralNode>, IComparable<LiteralNode>, IValuedNode, INode, IComparable<INode>, IComparable<IBlankNode>, IComparable<IGraphLiteralNode>, IComparable<ILiteralNode>, IComparable<IUriNode>, IComparable<IVariableNode>, IComparable<IRefNode>, IComparable<ITripleNode>, IEquatable<INode>, IEquatable<IBlankNode>, IEquatable<IGraphLiteralNode>, IEquatable<ILiteralNode>, IEquatable<IUriNode>, IEquatable<IVariableNode>, IEquatable<IRefNode>, IEquatable<ITripleNode>
Constructors
| Edit this page View SourceNumericNode(string, Uri, SparqlNumericType, bool)
Creates a new numeric valued node.
Declaration
protected NumericNode(string value, Uri datatype, SparqlNumericType numType, bool normalizeLiteralValue = false)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | Lexical Value. |
| Uri | datatype | Datatype URI. |
| SparqlNumericType | numType | SPARQL Numeric Type. |
| bool | normalizeLiteralValue | Whether to perform unicode normalization on |
Properties
| Edit this page View SourceEffectiveType
Gets the URI of the datatype this valued node represents as a String.
Declaration
public string EffectiveType { get; }
Property Value
| Type | Description |
|---|---|
| string |
NumericType
Gets the numeric type of the node.
Declaration
public SparqlNumericType NumericType { get; }
Property Value
| Type | Description |
|---|---|
| SparqlNumericType |
Methods
| Edit this page View SourceAsBoolean()
Gets the boolean value.
Declaration
public bool AsBoolean()
Returns
| Type | Description |
|---|---|
| bool |
AsDateTime()
Throws an error as numerics cannot be converted to date times.
Declaration
public DateTime AsDateTime()
Returns
| Type | Description |
|---|---|
| DateTime |
AsDateTimeOffset()
Throws an error as numerics cannot be converted to date times.
Declaration
public DateTimeOffset AsDateTimeOffset()
Returns
| Type | Description |
|---|---|
| DateTimeOffset |
AsDecimal()
Gets the decimal value.
Declaration
public abstract decimal AsDecimal()
Returns
| Type | Description |
|---|---|
| decimal |
AsDouble()
Gets the double value.
Declaration
public abstract double AsDouble()
Returns
| Type | Description |
|---|---|
| double |
AsFloat()
Gets the float value.
Declaration
public abstract float AsFloat()
Returns
| Type | Description |
|---|---|
| float |
AsInteger()
Gets the integer value.
Declaration
public abstract long AsInteger()
Returns
| Type | Description |
|---|---|
| long |
AsString()
Gets the string value of the node.
Declaration
public string AsString()
Returns
| Type | Description |
|---|---|
| string |
AsTimeSpan()
Throws an error as numerics cannot be cast to a time span.
Declaration
public TimeSpan AsTimeSpan()
Returns
| Type | Description |
|---|---|
| TimeSpan |