Class StringNode
Valued node whose value is a string or can only be converted to a string.
Implements
Inherited Members
Namespace: VDS.RDF.Nodes
Assembly: dotNetRdf.dll
Syntax
public class StringNode : 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 SourceStringNode(string)
Creates a new String Node.
Declaration
public StringNode(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | String value. |
StringNode(string, string)
Creates a new String Node.
Declaration
public StringNode(string value, string lang)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | String value. |
| string | lang | Language Specifier. |
StringNode(string, Uri)
Creates a new String Node.
Declaration
public StringNode(string value, Uri datatype)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | String value. |
| Uri | datatype | Datatype URI. |
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 expression.
Declaration
public SparqlNumericType NumericType { get; }
Property Value
| Type | Description |
|---|---|
| SparqlNumericType |
Methods
| Edit this page View SourceAsBoolean()
Gets the boolean value of the string.
Declaration
public bool AsBoolean()
Returns
| Type | Description |
|---|---|
| bool |
AsDateTime()
Throws an error as the string cannot be cast to a date time.
Declaration
public DateTime AsDateTime()
Returns
| Type | Description |
|---|---|
| DateTime |
AsDateTimeOffset()
Throws an error as the string cannot be cast to a date time.
Declaration
public DateTimeOffset AsDateTimeOffset()
Returns
| Type | Description |
|---|---|
| DateTimeOffset |
AsDecimal()
Throws an error as the string cannot be cast to a decimal.
Declaration
public decimal AsDecimal()
Returns
| Type | Description |
|---|---|
| decimal |
AsDouble()
Throws an error as the string cannot be cast to a double.
Declaration
public double AsDouble()
Returns
| Type | Description |
|---|---|
| double |
AsFloat()
Throws an error as the string cannot be cast to a float.
Declaration
public float AsFloat()
Returns
| Type | Description |
|---|---|
| float |
AsInteger()
Throws an error as the string cannot be cast to an integer.
Declaration
public long AsInteger()
Returns
| Type | Description |
|---|---|
| long |
AsString()
Gets the string value.
Declaration
public string AsString()
Returns
| Type | Description |
|---|---|
| string |
AsTimeSpan()
Throws an error as the string cannot be cast to a time span.
Declaration
public TimeSpan AsTimeSpan()
Returns
| Type | Description |
|---|---|
| TimeSpan |