Class GraphPattern
Class for representing Graph Patterns in Sparql Queries.
Inheritance
System.Object
GraphPattern
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: VDS.RDF.Query.Patterns
Assembly: dotNetRDF.dll
Syntax
public class GraphPattern
Properties
| Improve this Doc View SourceChildGraphPatterns
Gets the Child Graph Patterns of this Pattern.
Declaration
public List<GraphPattern> ChildGraphPatterns { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<GraphPattern> |
Filter
Gets/Sets the FILTER that applies to this Graph Pattern.
Declaration
public ISparqlFilter Filter { get; }
Property Value
| Type | Description |
|---|---|
| ISparqlFilter |
GraphSpecifier
Gets/Sets the Graph Specifier that applies to this Graph Pattern.
Declaration
public IToken GraphSpecifier { get; }
Property Value
| Type | Description |
|---|---|
| IToken |
Remarks
This property is also used internally for SERVICE specifiers to save adding an additional property unnecessarily.
|
Improve this Doc
View Source
HasChildGraphPatterns
Checks whether this Pattern has any Child Graph Patterns.
Declaration
public bool HasChildGraphPatterns { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
HasInlineData
Gets whether this Graph Pattern contains an Inline Data block (VALUES clause).
Declaration
public bool HasInlineData { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
HasModifier
Determines whether the Graph Pattern has any kind of Modifier (GRAPH, MINUS, OPTIONAL etc) applied.
Declaration
public bool HasModifier { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
InlineData
Gets the inline data (VALUES block if any).
Declaration
public BindingsPattern InlineData { get; }
Property Value
| Type | Description |
|---|---|
| BindingsPattern |
IsEmpty
Gets whether this is an empty Graph Pattern.
Declaration
public bool IsEmpty { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsExists
Gets/Sets whether the Graph Pattern is an EXISTS clause.
Declaration
public bool IsExists { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsFiltered
Gets/Sets whether the Graph Pattern is Filtered.
Declaration
public bool IsFiltered { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsGraph
Gets/Sets whether the Graph Pattern operates on a specific Graph.
Declaration
public bool IsGraph { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsMinus
Gets/Sets whether the Graph Pattern is a MINUS clause.
Declaration
public bool IsMinus { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsNotExists
Gets/Sets whether the Graph Pattern is a NOT EXISTS clause.
Declaration
public bool IsNotExists { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsOptimised
Gets whether Optimisation has been applied to this query.
Declaration
public bool IsOptimised { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This only indicates that an Optimiser has been applied to the Pattern. You can always reoptimise by calling the Optimise() method with an optimiser of your choice on the query to which this Pattern belongs.
|
Improve this Doc
View Source
IsOptional
Gets/Sets whether the Graph Pattern is Optional.
Declaration
public bool IsOptional { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsService
Gets/Sets whether the Graph Pattern is a SERVICE clause.
Declaration
public bool IsService { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsSilent
Gets whether Evaluation Errors in this Graph Pattern are suppressed (currently only valid with SERVICE).
Declaration
public bool IsSilent { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsSubQuery
Gets whether this Graph Pattern is a Sub-query which can be simplified.
Declaration
public bool IsSubQuery { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsUnion
Gets/Sets whether the Graph Pattern is a Union of its Child Graph Patterns.
Declaration
public bool IsUnion { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
TriplePatterns
Gets the Triple Patterns in this Pattern.
Declaration
public List<ITriplePattern> TriplePatterns { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<ITriplePattern> |
UnplacedAssignments
Gets the enumeration of LET assignments that are in this Graph Pattern which will be placed appropriately later.
Declaration
public IEnumerable<IAssignmentPattern> UnplacedAssignments { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IAssignmentPattern> |
UnplacedFilters
Gets the enumeration of Filters that apply to this Graph Pattern which will have yet to be placed within the Graph Pattern.
Declaration
public IEnumerable<ISparqlFilter> UnplacedFilters { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<ISparqlFilter> |
UsesDefaultDataset
Gets whether the Graph Pattern uses the Default Dataset.
Declaration
public bool UsesDefaultDataset { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
Graph Patterns generally use the Default Dataset unless they are a GRAPH pattern or they contain a Triple Pattern, child Graph Pattern or a FILTER/BIND which does not use the default dataset.
|
Improve this Doc
View Source
Variables
Gets the Variables used in the Pattern.
Declaration
public IEnumerable<string> Variables { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<System.String> |
Methods
| Improve this Doc View SourceAddInlineData(BindingsPattern)
Adds inline data to a Graph Pattern respecting any BGP breaks.
Declaration
public void AddInlineData(BindingsPattern data)
Parameters
| Type | Name | Description |
|---|---|---|
| BindingsPattern | data |
InsertAssignment(IAssignmentPattern, Int32)
Inserts an Assignment at a given position.
Declaration
public void InsertAssignment(IAssignmentPattern assignment, int i)
Parameters
| Type | Name | Description |
|---|---|---|
| IAssignmentPattern | assignment | Assignment. |
| System.Int32 | i | Position to insert at. |
Remarks
Intended for use by Query Optimisers.
|
Improve this Doc
View Source
InsertFilter(ISparqlFilter, Int32)
Inserts a Filter at a given position.
Declaration
public void InsertFilter(ISparqlFilter filter, int i)
Parameters
| Type | Name | Description |
|---|---|---|
| ISparqlFilter | filter | Filter. |
| System.Int32 | i | Position to insert at. |
Remarks
Intended for use by Query Optimisers.
|
Improve this Doc
View Source
Optimise()
Optimises the Graph Pattern using the current global optimiser.
Declaration
public void Optimise()
Optimise(IQueryOptimiser)
Optimises the Graph Pattern using the given optimiser.
Declaration
public void Optimise(IQueryOptimiser optimiser)
Parameters
| Type | Name | Description |
|---|---|---|
| IQueryOptimiser | optimiser | Query Optimiser. |
Remarks
Important: If a Pattern has already been optimized then calling this again is a no-op.
For finer grained control of what gets optimized you can use QueryOptimisation to disable automatic optimisation and then manually call this method as necessary.
Optimise(IQueryOptimiser, IEnumerable<String>)
Optimises the Graph Pattern using the given optimiser and with the given variables.
Declaration
public void Optimise(IQueryOptimiser optimiser, IEnumerable<string> vars)
Parameters
| Type | Name | Description |
|---|---|---|
| IQueryOptimiser | optimiser | Query Optimiser. |
| System.Collections.Generic.IEnumerable<System.String> | vars | Variables. |
Remarks
Important: If a Pattern has already been optimized then calling this again is a no-op.
For finer grained control of what gets optimized you can use QueryOptimisation to disable automatic optimisation and then manually call this method as necessary.
The vars parameter contains Variables mentioned in the parent Graph Pattern (if any) that can be used to guide optimisation of child graph patterns.
SwapTriplePatterns(Int32, Int32)
Swaps the position of the two given Triple Patterns.
Declaration
public void SwapTriplePatterns(int i, int j)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | i | First Position. |
| System.Int32 | j | Second Position. |
Remarks
Intended for use by Query Optimisers.
|
Improve this Doc
View Source
ToAlgebra()
Gets the Algebra representation of the Graph Pattern.
Declaration
public ISparqlAlgebra ToAlgebra()
Returns
| Type | Description |
|---|---|
| ISparqlAlgebra |
ToString()
Gets the String representation of the Graph Pattern.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String |
Overrides
System.Object.ToString()