Class AskBgp
Represents a BGP which is a set of Triple Patterns.
Inherited Members
Namespace: VDS.RDF.Query.Algebra
Assembly: dotNetRdf.dll
Syntax
public class AskBgp : IBgp, ITerminalOperator, ISparqlAlgebra, IVisitable, IProcessable
Remarks
An Ask BGP differs from a BGP in that rather than evaluating each Triple Pattern in turn it evaluates across all Triple Patterns. This is used for ASK queries where we are only concerned with whether a BGP matches and not in the specific solutions.
An Ask BGP can only contain concrete Triple Patterns and/or FILTERs and not any of the other specialised Triple Pattern classes.
Constructors
| Edit this page View SourceAskBgp(IEnumerable<ITriplePattern>)
Creates a Streamed BGP containing a set of Triple Patterns.
Declaration
public AskBgp(IEnumerable<ITriplePattern> ps)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ITriplePattern> | ps | Triple Patterns. |
AskBgp(ITriplePattern)
Creates a Streamed BGP containing a single Triple Pattern.
Declaration
public AskBgp(ITriplePattern p)
Parameters
Type | Name | Description |
---|---|---|
ITriplePattern | p | Triple Pattern. |
Properties
| Edit this page View SourceFixedVariables
Gets the enumeration of fixed variables in the algebra i.e. variables that are guaranteed to have a bound value.
Declaration
public IEnumerable<string> FixedVariables { get; }
Property Value
Type | Description |
---|---|
IEnumerable<string> |
FloatingVariables
Gets the enumeration of floating variables in the algebra i.e. variables that are not guaranteed to have a bound value.
Declaration
public IEnumerable<string> FloatingVariables { get; }
Property Value
Type | Description |
---|---|
IEnumerable<string> |
IsEmpty
Gets whether the BGP is the empty BGP.
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
bool |
PatternCount
Gets the number of Triple Patterns in the BGP.
Declaration
public int PatternCount { get; }
Property Value
Type | Description |
---|---|
int |
TriplePatterns
Gets the Triple Patterns in the BGP.
Declaration
public IReadOnlyList<ITriplePattern> TriplePatterns { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<ITriplePattern> |
Variables
Gets the Variables used in the Algebra.
Declaration
public IEnumerable<string> Variables { get; }
Property Value
Type | Description |
---|---|
IEnumerable<string> |
Methods
| Edit this page View SourceAccept<T>(ISparqlAlgebraVisitor<T>)
Accept a simple algebra visitor.
Declaration
public T Accept<T>(ISparqlAlgebraVisitor<T> visitor)
Parameters
Type | Name | Description |
---|---|---|
ISparqlAlgebraVisitor<T> | visitor | The visitor implementation. |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T | The type returned by the Visit methods of the visitor. |
Accept<TResult, TContext>(ISparqlQueryAlgebraProcessor<TResult, TContext>, TContext)
Called by an algebra visitor to process an item by invoking the appropriate method on the processor
passed in.
Declaration
public TResult Accept<TResult, TContext>(ISparqlQueryAlgebraProcessor<TResult, TContext> processor, TContext context)
Parameters
Type | Name | Description |
---|---|---|
ISparqlQueryAlgebraProcessor<TResult, TContext> | processor | The processor to invoke. |
TContext | context | The context to pass to the processor. |
Returns
Type | Description |
---|---|
TResult | The result of invoking the processor method. |
Type Parameters
Name | Description |
---|---|
TResult | The type of result returned by the processor. |
TContext | The type of the context object to be provided to the processor. |
ToGraphPattern()
Converts the BGP back to a Graph Pattern.
Declaration
public GraphPattern ToGraphPattern()
Returns
Type | Description |
---|---|
GraphPattern |
ToQuery()
Converts the Algebra back to a SPARQL Query.
Declaration
public SparqlQuery ToQuery()
Returns
Type | Description |
---|---|
SparqlQuery |
ToString()
Gets the String representation of the Algebra.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |