Show / Hide Table of Contents

Class SparqlNodeComparer

Comparer class for implementing the SPARQL semantics for the relational operators.

Inheritance
object
SparqlNodeComparer
SparqlOrderingComparer
Implements
ISparqlNodeComparer
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF.Query
Assembly: dotNetRdf.dll
Syntax
public class SparqlNodeComparer : ISparqlNodeComparer

Constructors

| Edit this page View Source

SparqlNodeComparer(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 Source

Culture

Get the culture to use for string literal comparison.

Declaration
public CultureInfo Culture { get; }
Property Value
Type Description
CultureInfo
| Edit this page View Source

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 Source

BooleanCompare(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
| Edit this page View Source

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
| Edit this page View Source

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 x compares as greater than y, less than 0 if y compares greater than x.

Exceptions
Type Condition
RdfQueryComparisonException

Raised if the nodes x and y cannot be compared.

| Edit this page View Source

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 x compares as greater than y, less than 0 if y compares greater than x.

Exceptions
Type Condition
RdfQueryComparisonException

Raised if the nodes x and y cannot be compared.

| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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.

| Edit this page View Source

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.

Implements

ISparqlNodeComparer

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • SparqlNodeComparer(CultureInfo, CompareOptions)
  • Properties
    • Culture
    • Options
  • Methods
    • BooleanCompare(INode, INode)
    • BooleanCompare(IValuedNode, IValuedNode)
    • Compare(INode, INode)
    • Compare(IValuedNode, IValuedNode)
    • DateCompare(INode, INode)
    • DateCompare(IValuedNode, IValuedNode)
    • DateTimeCompare(INode, INode)
    • DateTimeCompare(IValuedNode, IValuedNode)
    • NumericCompare(INode, INode, SparqlNumericType)
    • NumericCompare(IValuedNode, IValuedNode, SparqlNumericType)
    • TryCompare(INode, INode, out int)
    • TryCompare(IValuedNode, IValuedNode, out int)
  • Implements
  • Extension Methods
Back to top Generated by DocFX