Class BaseMultiset
Abstract Base Class for representing Multisets.
Inherited Members
Namespace: VDS.RDF.Query.Algebra
Assembly: dotNetRdf.dll
Syntax
public abstract class BaseMultiset
Constructors
| Improve this Doc View SourceBaseMultiset(bool)
Create a new multiset.
Declaration
public BaseMultiset(bool usePLinqEvaluation = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | usePLinqEvaluation | If true, then LINQ parallel operators will be used when evaluating set operations using this multiset. |
Fields
| Improve this Doc View Source_orderedIDs
List of IDs that is used to return the Sets in order if the Multiset has been sorted.
Declaration
protected List<int> _orderedIDs
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<T><int> |
Properties
| Improve this Doc View SourceCount
Gets the Count of Sets in the Multiset.
Declaration
public virtual int Count { get; }
Property Value
Type | Description |
---|---|
int |
IsEmpty
Returns whether the Multiset is Empty.
Declaration
public abstract bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
this[int]
Retrieves the Set with the given ID.
Declaration
public abstract ISet this[int id] { get; }
Parameters
Type | Name | Description |
---|---|---|
int | id | ID. |
Property Value
Type | Description |
---|---|
ISet |
SetIDs
Gets the IDs of Sets in the Multiset.
Declaration
public abstract IEnumerable<int> SetIDs { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><int> |
Sets
Gets the Sets in the Multiset.
Declaration
public abstract IEnumerable<ISet> Sets { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><ISet> |
UsePLinqEvaluation
Get whether this multiset will use LINQ parallel operators for evaluating set operations.
Declaration
public bool UsePLinqEvaluation { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Variables
Gets the Variables in the Multiset.
Declaration
public abstract IEnumerable<string> Variables { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><string> |
VirtualCount
The number of results that would be returned without any limit clause to a query or -1 if not supported. Defaults to the same value as the Count member.
Declaration
public int VirtualCount { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Improve this Doc View SourceAdd(ISet)
Adds a Set to the Multiset.
Declaration
public abstract void Add(ISet s)
Parameters
Type | Name | Description |
---|---|---|
ISet | s | Set to add. |
AddVariable(string)
Adds a Variable to the Multiset.
Declaration
public abstract void AddVariable(string variable)
Parameters
Type | Name | Description |
---|---|---|
string | variable | Variable. |
ContainsValue(string, INode)
Determines whether the Multiset contains the given Value for the given Variable.
Declaration
public abstract bool ContainsValue(string var, INode n)
Parameters
Type | Name | Description |
---|---|---|
string | var | Variable. |
INode | n | Value. |
Returns
Type | Description |
---|---|
System.Boolean |
ContainsVariable(string)
Determines whether the Multiset contains the given Variable.
Declaration
public abstract bool ContainsVariable(string var)
Parameters
Type | Name | Description |
---|---|---|
string | var | Variable. |
Returns
Type | Description |
---|---|
System.Boolean |
ContainsVariables(IEnumerable<string>)
Determines whether the Multiset contains all of the given variables.
Declaration
public abstract bool ContainsVariables(IEnumerable<string> vars)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T><string> | vars | Variables. |
Returns
Type | Description |
---|---|
System.Boolean | True if all of the variables in |
ExistsJoin(BaseMultiset, bool)
Does an Exists Join of this Multiset to another Multiset where the Join is predicated on the existence/non-existence of a joinable solution on the RHS.
Declaration
public virtual BaseMultiset ExistsJoin(BaseMultiset other, bool mustExist)
Parameters
Type | Name | Description |
---|---|---|
BaseMultiset | other | Other Multiset. |
System.Boolean | mustExist | Whether a solution must exist in the Other Multiset for the join to be made. |
Returns
Type | Description |
---|---|
BaseMultiset |
IsDisjointWith(BaseMultiset)
Determines whether the Multiset is disjoint with the given Multiset.
Declaration
public abstract bool IsDisjointWith(BaseMultiset other)
Parameters
Type | Name | Description |
---|---|---|
BaseMultiset | other | Multiset. |
Returns
Type | Description |
---|---|
System.Boolean |
Join(BaseMultiset)
Joins this Multiset to another Multiset.
Declaration
public virtual BaseMultiset Join(BaseMultiset other)
Parameters
Type | Name | Description |
---|---|---|
BaseMultiset | other | Other Multiset. |
Returns
Type | Description |
---|---|
BaseMultiset |
LeftJoin(BaseMultiset, ISparqlExpression, SparqlEvaluationContext, ISparqlExpressionProcessor<IValuedNode, SparqlEvaluationContext, int>)
Does a Left Join of this Multiset to another Multiset where the Join is predicated on the given Expression.
Declaration
public virtual BaseMultiset LeftJoin(BaseMultiset other, ISparqlExpression expr, SparqlEvaluationContext baseContext, ISparqlExpressionProcessor<IValuedNode, SparqlEvaluationContext, int> expressionProcessor)
Parameters
Type | Name | Description |
---|---|---|
BaseMultiset | other | Other Multiset. |
ISparqlExpression | expr | Expression. |
SparqlEvaluationContext | baseContext | The base evaluation context providing access to the query evaluation options to use when evaluating the join. |
ISparqlExpressionProcessor<IValuedNode, SparqlEvaluationContext, int> | expressionProcessor |
Returns
Type | Description |
---|---|
BaseMultiset |
Merge(BaseMultiset)
Does a merge of this multiset and another multiset, avoiding adding duplicate sets to this multiset.
Declaration
public virtual BaseMultiset Merge(BaseMultiset other)
Parameters
Type | Name | Description |
---|---|---|
BaseMultiset | other | The multiset to be merged into this multiset. |
Returns
Type | Description |
---|---|
BaseMultiset | This multiset. |
Remarks
The merge operation adds only sets from other
that do not exist in this multiset.
MinusJoin(BaseMultiset)
Does a Minus Join of this Multiset to another Multiset where any joinable results are subtracted from this Multiset to give the resulting Multiset.
Declaration
public virtual BaseMultiset MinusJoin(BaseMultiset other)
Parameters
Type | Name | Description |
---|---|---|
BaseMultiset | other | Other Multiset. |
Returns
Type | Description |
---|---|
BaseMultiset |
Product(BaseMultiset)
Does a Product of this Multiset and another Multiset.
Declaration
public virtual BaseMultiset Product(BaseMultiset other)
Parameters
Type | Name | Description |
---|---|---|
BaseMultiset | other | Other Multiset. |
Returns
Type | Description |
---|---|
BaseMultiset |
Remove(int)
Removes a Set (by ID) from the Multiset.
Declaration
public abstract void Remove(int id)
Parameters
Type | Name | Description |
---|---|---|
int | id | ID. |
SetVariableOrder(IEnumerable<string>)
Sets the variable ordering for the multiset.
Declaration
public abstract void SetVariableOrder(IEnumerable<string> variables)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T><string> | variables | Variable Ordering. |
Sort(IComparer<ISet>)
Sorts a Set based on the given Comparer.
Declaration
public virtual void Sort(IComparer<ISet> comparer)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IComparer<T><ISet> | comparer | Comparer on Sets. |
ToString()
Gets the string representation of the multiset (intended for debugging only).
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
Trim()
Trims the Multiset of Temporary Variables.
Declaration
public virtual void Trim()
Trim(string)
Trims the Multiset by removing all Values for the given Variable.
Declaration
public virtual void Trim(string variable)
Parameters
Type | Name | Description |
---|---|---|
string | variable | Variable. |
Union(BaseMultiset)
Does a Union of this Multiset and another Multiset.
Declaration
public virtual BaseMultiset Union(BaseMultiset other)
Parameters
Type | Name | Description |
---|---|---|
BaseMultiset | other | Other Multiset. |
Returns
Type | Description |
---|---|
BaseMultiset |