Class SparqlNodeComparer
Comparer class for implementing the SPARQL semantics for the relational operators.
Implements
Inherited Members
Namespace: VDS.RDF.Query
Assembly: dotNetRdf.dll
Syntax
public class SparqlNodeComparer : ISparqlNodeComparer
  Constructors
| Edit this page View SourceSparqlNodeComparer(CultureInfo, CompareOptions)
Create a new comparer that will use the specified culture and options when comparing string literals.
Declaration
public SparqlNodeComparer(CultureInfo culture, CompareOptions options)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CultureInfo | culture | The culture to use for string literal comparison.  | 
      
| CompareOptions | options | The options to apply to string literal comparison.  | 
      
Properties
| Edit this page View SourceCulture
Get the culture to use for string literal comparison.
Declaration
public CultureInfo Culture { get; }
  Property Value
| Type | Description | 
|---|---|
| CultureInfo | 
Options
Get the options to apply to string literal comparison.
Declaration
public CompareOptions Options { get; }
  Property Value
| Type | Description | 
|---|---|
| CompareOptions | 
Methods
| Edit this page View SourceBooleanCompare(INode, INode)
Compare two nodes as boolean values.
Declaration
protected virtual int BooleanCompare(INode x, INode y)
  Parameters
| Type | Name | Description | 
|---|---|---|
| INode | x | |
| INode | y | 
Returns
| Type | Description | 
|---|---|
| int | 
BooleanCompare(IValuedNode, IValuedNode)
Compare two nodes as boolean values.
Declaration
protected virtual int BooleanCompare(IValuedNode x, IValuedNode y)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IValuedNode | x | |
| IValuedNode | y | 
Returns
| Type | Description | 
|---|---|
| int | 
Exceptions
| Type | Condition | 
|---|---|
| RdfQueryException | 
Compare(INode, INode)
Compares two Nodes.
Declaration
public virtual int Compare(INode x, INode y)
  Parameters
| Type | Name | Description | 
|---|---|---|
| INode | x | Node.  | 
      
| INode | y | Node.  | 
      
Returns
| Type | Description | 
|---|---|
| int | 0 if nodes compare equal, greater than 0 if   | 
      
Exceptions
| Type | Condition | 
|---|---|
| RdfQueryComparisonException | Raised if the nodes   | 
      
Compare(IValuedNode, IValuedNode)
Compares two valued Nodes.
Declaration
public virtual int Compare(IValuedNode x, IValuedNode y)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IValuedNode | x | Node.  | 
      
| IValuedNode | y | Node.  | 
      
Returns
| Type | Description | 
|---|---|
| int | 0 if nodes compare equal, greater than 0 if   | 
      
Exceptions
| Type | Condition | 
|---|---|
| RdfQueryComparisonException | Raised if the nodes   | 
      
DateCompare(INode, INode)
Compares two Dates for Date ordering.
Declaration
protected virtual int DateCompare(INode x, INode y)
  Parameters
| Type | Name | Description | 
|---|---|---|
| INode | x | Node.  | 
      
| INode | y | Node.  | 
      
Returns
| Type | Description | 
|---|---|
| int | 
DateCompare(IValuedNode, IValuedNode)
Compares two Dates for Date ordering.
Declaration
protected virtual int DateCompare(IValuedNode x, IValuedNode y)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IValuedNode | x | Node.  | 
      
| IValuedNode | y | Node.  | 
      
Returns
| Type | Description | 
|---|---|
| int | 
DateTimeCompare(INode, INode)
Compares two Date Times for Date Time ordering.
Declaration
protected virtual int DateTimeCompare(INode x, INode y)
  Parameters
| Type | Name | Description | 
|---|---|---|
| INode | x | Node.  | 
      
| INode | y | Node.  | 
      
Returns
| Type | Description | 
|---|---|
| int | 
DateTimeCompare(IValuedNode, IValuedNode)
Compares two Date Times for Date Time ordering.
Declaration
protected virtual int DateTimeCompare(IValuedNode x, IValuedNode y)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IValuedNode | x | Node.  | 
      
| IValuedNode | y | Node.  | 
      
Returns
| Type | Description | 
|---|---|
| int | 
NumericCompare(INode, INode, SparqlNumericType)
Compares two Nodes for Numeric Ordering.
Declaration
protected virtual int NumericCompare(INode x, INode y, SparqlNumericType type)
  Parameters
| Type | Name | Description | 
|---|---|---|
| INode | x | Node.  | 
      
| INode | y | Node.  | 
      
| SparqlNumericType | type | Numeric Type.  | 
      
Returns
| Type | Description | 
|---|---|
| int | 
NumericCompare(IValuedNode, IValuedNode, SparqlNumericType)
Compares two Nodes for Numeric Ordering.
Declaration
protected virtual int NumericCompare(IValuedNode x, IValuedNode y, SparqlNumericType type)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IValuedNode | x | Node.  | 
      
| IValuedNode | y | Node.  | 
      
| SparqlNumericType | type | Numeric Type.  | 
      
Returns
| Type | Description | 
|---|---|
| int | 
TryCompare(INode, INode, out int)
Attempt to compare the specified nodes.
Declaration
public bool TryCompare(INode x, INode y, out int result)
  Parameters
| Type | Name | Description | 
|---|---|---|
| INode | x | Node to be compared.  | 
      
| INode | y | Node to be compared.  | 
      
| int | result | Comparison result.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | True if a comparison could be made, false otherwise.  | 
      
Remarks
result is set to 0 if the nodes compare as equal, a positive value if x compares greater than y, or a negative value if y compares greater than x.
TryCompare(IValuedNode, IValuedNode, out int)
Attempt to compare the specified nodes.
Declaration
public bool TryCompare(IValuedNode x, IValuedNode y, out int result)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IValuedNode | x | Node to be compared.  | 
      
| IValuedNode | y | Node to be compared.  | 
      
| int | result | Comparison result.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | True if a comparison could be made, false otherwise.  | 
      
Remarks
result is set to 0 if the nodes compare as equal, a positive value if x compares greater than y, or a negative value if y compares greater than x.