Class BaseTripleNode
Base class for triple nodes.
Implements
Inherited Members
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public abstract class BaseTripleNode : BaseNode, ITripleNode, IRefNode, IEquatable<BaseTripleNode>, IComparable<BaseTripleNode>, 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
| Improve this Doc View SourceBaseTripleNode(Triple)
Internal-only constructor for triple nodes.
Declaration
protected BaseTripleNode(Triple triple)
Parameters
Type | Name | Description |
---|---|---|
Triple | triple | The triple that is the value of this node. |
Properties
| Improve this Doc 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 |
Remarks
Either String.Empty if no type or the string form of the type URI.
NumericType
Gets the Numeric Type of the Node.
Declaration
public SparqlNumericType NumericType { get; }
Property Value
Type | Description |
---|---|
SparqlNumericType |
Triple
Get the triple that is the value of this node.
Declaration
public Triple Triple { get; }
Property Value
Type | Description |
---|---|
Triple |
Methods
| Improve this Doc View SourceAsBoolean()
Gets the Boolean value of the Node.
Declaration
public bool AsBoolean()
Returns
Type | Description |
---|---|
System.Boolean |
Exceptions
Type | Condition |
---|---|
RdfQueryException | Thrown if the Node cannot be converted to a Boolean. |
AsDateTime()
Gets the Date Time value of the Node.
Declaration
public DateTime AsDateTime()
Returns
Type | Description |
---|---|
System.DateTime |
Exceptions
Type | Condition |
---|---|
RdfQueryException | Thrown if the Node cannot be converted to a Date Time. |
AsDateTimeOffset()
Gets the Date Time Offset value of the Node.
Declaration
public DateTimeOffset AsDateTimeOffset()
Returns
Type | Description |
---|---|
System.DateTimeOffset |
Exceptions
Type | Condition |
---|---|
RdfQueryException | Thrown if the Node cannot be converted to a Date Time Offset. |
AsDecimal()
Gets the Decimal value of the Node.
Declaration
public decimal AsDecimal()
Returns
Type | Description |
---|---|
decimal |
Exceptions
Type | Condition |
---|---|
RdfQueryException | Thrown if the Node cannot be converted to a Decimal. |
AsDouble()
Gets the Double value of the Node.
Declaration
public double AsDouble()
Returns
Type | Description |
---|---|
double |
Exceptions
Type | Condition |
---|---|
RdfQueryException | Thrown if the Node cannot be converted to a Double. |
AsFloat()
Gets the Float value of the Node.
Declaration
public float AsFloat()
Returns
Type | Description |
---|---|
float |
Exceptions
Type | Condition |
---|---|
RdfQueryException | Thrown if the Node cannot be converted to a Float. |
AsInteger()
Gets the Long value of the Node.
Declaration
public long AsInteger()
Returns
Type | Description |
---|---|
long |
Exceptions
Type | Condition |
---|---|
RdfQueryException | Thrown if the Node cannot be converted to a Long. |
AsString()
Gets the String value of the Node.
Declaration
public string AsString()
Returns
Type | Description |
---|---|
string |
Remarks
This is distinct from ToString() because that method will typically include additional information like language specifier/datatype as appropriate whereas this method is used to produce a string as would be produced by applying the STR() function from SPARQL.
AsTimeSpan()
Gets the Time Span value of the Node.
Declaration
public TimeSpan AsTimeSpan()
Returns
Type | Description |
---|---|
System.TimeSpan |
CompareTo(BaseTripleNode)
Returns an Integer indicating the Ordering of this Node compared to another Node.
Declaration
public int CompareTo(BaseTripleNode other)
Parameters
Type | Name | Description |
---|---|---|
BaseTripleNode | other | Node to test against. |
Returns
Type | Description |
---|---|
int |
CompareTo(IBlankNode)
Returns an Integer indicating the Ordering of this Node compared to another Node.
Declaration
public override int CompareTo(IBlankNode other)
Parameters
Type | Name | Description |
---|---|---|
IBlankNode | other | Node to test against. |
Returns
Type | Description |
---|---|
int |
Overrides
| Improve this Doc View SourceCompareTo(IGraphLiteralNode)
Returns an Integer indicating the Ordering of this Node compared to another Node.
Declaration
public override int CompareTo(IGraphLiteralNode other)
Parameters
Type | Name | Description |
---|---|---|
IGraphLiteralNode | other | Node to test against. |
Returns
Type | Description |
---|---|
int |
Overrides
| Improve this Doc View SourceCompareTo(ILiteralNode)
Returns an Integer indicating the Ordering of this Node compared to another Node.
Declaration
public override int CompareTo(ILiteralNode other)
Parameters
Type | Name | Description |
---|---|---|
ILiteralNode | other | Node to test against. |
Returns
Type | Description |
---|---|
int |
Overrides
| Improve this Doc View SourceCompareTo(INode)
Returns an Integer indicating the Ordering of this Node compared to another Node.
Declaration
public override int CompareTo(INode other)
Parameters
Type | Name | Description |
---|---|---|
INode | other | Node to test against. |
Returns
Type | Description |
---|---|
int |
Overrides
| Improve this Doc View SourceCompareTo(IRefNode)
Returns an Integer indicating the Ordering of this Node compared to another Node.
Declaration
public override int CompareTo(IRefNode other)
Parameters
Type | Name | Description |
---|---|---|
IRefNode | other | Node to test against. |
Returns
Type | Description |
---|---|
int |
Overrides
| Improve this Doc View SourceCompareTo(ITripleNode)
Returns an Integer indicating the Ordering of this Node compared to another Node.
Declaration
public override int CompareTo(ITripleNode other)
Parameters
Type | Name | Description |
---|---|---|
ITripleNode | other | Node to test against. |
Returns
Type | Description |
---|---|
int |
Overrides
| Improve this Doc View SourceCompareTo(IUriNode)
Returns an Integer indicating the Ordering of this Node compared to another Node.
Declaration
public override int CompareTo(IUriNode other)
Parameters
Type | Name | Description |
---|---|---|
IUriNode | other | Node to test against. |
Returns
Type | Description |
---|---|
int |
Overrides
| Improve this Doc View SourceCompareTo(IVariableNode)
Returns an Integer indicating the Ordering of this Node compared to another Node.
Declaration
public override int CompareTo(IVariableNode other)
Parameters
Type | Name | Description |
---|---|---|
IVariableNode | other | Node to test against. |
Returns
Type | Description |
---|---|
int |
Overrides
| Improve this Doc View SourceEquals(object)
Object equality for triple nodes.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to compare this node with. |
Returns
Type | Description |
---|---|
System.Boolean | True if |
Overrides
| Improve this Doc View SourceEquals(BaseTripleNode)
Determines whether this node is equal to another triple node.
Declaration
public bool Equals(BaseTripleNode other)
Parameters
Type | Name | Description |
---|---|---|
BaseTripleNode | other | The other node to compare with. |
Returns
Type | Description |
---|---|
System.Boolean | True if the Triple property of |
Equals(IBlankNode)
Determines whether this node is equal to a blank node.
Declaration
public override bool Equals(IBlankNode other)
Parameters
Type | Name | Description |
---|---|---|
IBlankNode | other | The node to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | Always false. |
Overrides
| Improve this Doc View SourceEquals(IGraphLiteralNode)
Determines whether this node is equal to a graph literal node.
Declaration
public override bool Equals(IGraphLiteralNode other)
Parameters
Type | Name | Description |
---|---|---|
IGraphLiteralNode | other | The node to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | Always false. |
Overrides
| Improve this Doc View SourceEquals(ILiteralNode)
Determines whether this node is equal to a literal node.
Declaration
public override bool Equals(ILiteralNode other)
Parameters
Type | Name | Description |
---|---|---|
ILiteralNode | other | The node to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | Always false. |
Overrides
| Improve this Doc View SourceEquals(INode)
Determines whether this node is equal to another node.
Declaration
public override bool Equals(INode other)
Parameters
Type | Name | Description |
---|---|---|
INode | other | The other node to compare with. |
Returns
Type | Description |
---|---|
System.Boolean | True if |
Overrides
| Improve this Doc View SourceEquals(IRefNode)
Determines whether this node is equal to another resource reference node.
Declaration
public override bool Equals(IRefNode other)
Parameters
Type | Name | Description |
---|---|---|
IRefNode | other | The other node to compare with. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceEquals(ITripleNode)
Determines whether this node is equal to another triple node.
Declaration
public override bool Equals(ITripleNode other)
Parameters
Type | Name | Description |
---|---|---|
ITripleNode | other | The other node to compare with. |
Returns
Type | Description |
---|---|
System.Boolean | True if the Triple property of |
Overrides
| Improve this Doc View SourceEquals(IUriNode)
Determines whether this node is equal to a URI node.
Declaration
public override bool Equals(IUriNode other)
Parameters
Type | Name | Description |
---|---|---|
IUriNode | other | The node to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | Always false. |
Overrides
| Improve this Doc View SourceEquals(IVariableNode)
Determines whether this node is equal to a variable node.
Declaration
public override bool Equals(IVariableNode other)
Parameters
Type | Name | Description |
---|---|---|
IVariableNode | other | The node to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | Always false. |
Overrides
| Improve this Doc View SourceGetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for the current object. |
Overrides
| Improve this Doc View SourceToString()
Get a string representation of a triple node.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | Gives the string value of Triple enclosed in the RDF-star << >> quotes. |