Show / Hide Table of Contents

Class GraphPattern

Class for representing Graph Patterns in Sparql Queries.

Inheritance
object
GraphPattern
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: VDS.RDF.Query.Patterns
Assembly: dotNetRdf.dll
Syntax
public class GraphPattern

Constructors

| Edit this page View Source

GraphPattern()

Creates a new Graph Pattern.

Declaration
public GraphPattern()

Properties

| Edit this page View Source

ChildGraphPatterns

Gets the Child Graph Patterns of this Pattern.

Declaration
public List<GraphPattern> ChildGraphPatterns { get; }
Property Value
Type Description
List<GraphPattern>
| Edit this page View Source

Filter

Gets/Sets the FILTER that applies to this Graph Pattern.

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

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.

| Edit this page View Source

HasChildGraphPatterns

Checks whether this Pattern has any Child Graph Patterns.

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

HasInlineData

Gets whether this Graph Pattern contains an Inline Data block (VALUES clause).

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

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

InlineData

Gets the inline data (VALUES block if any).

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

IsEmpty

Gets whether this is an empty Graph Pattern.

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

IsExists

Gets/Sets whether the Graph Pattern is an EXISTS clause.

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

IsFiltered

Gets/Sets whether the Graph Pattern is Filtered.

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

IsGraph

Gets/Sets whether the Graph Pattern operates on a specific Graph.

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

IsMinus

Gets/Sets whether the Graph Pattern is a MINUS clause.

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

IsNotExists

Gets/Sets whether the Graph Pattern is a NOT EXISTS clause.

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

IsOptimised

Gets whether Optimisation has been applied to this query.

Declaration
public bool IsOptimised { get; }
Property Value
Type Description
bool
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.

| Edit this page View Source

IsOptional

Gets/Sets whether the Graph Pattern is Optional.

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

IsService

Gets/Sets whether the Graph Pattern is a SERVICE clause.

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

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

IsSubQuery

Gets whether this Graph Pattern is a Sub-query which can be simplified.

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

IsUnion

Gets/Sets whether the Graph Pattern is a Union of its Child Graph Patterns.

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

TriplePatterns

Gets the Triple Patterns in this Pattern.

Declaration
public List<ITriplePattern> TriplePatterns { get; }
Property Value
Type Description
List<ITriplePattern>
| Edit this page View Source

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

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

UsesDefaultDataset

Gets whether the Graph Pattern uses the Default Dataset.

Declaration
public bool UsesDefaultDataset { get; }
Property Value
Type Description
bool
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.

| Edit this page View Source

Variables

Gets the Variables used in the Pattern.

Declaration
public IEnumerable<string> Variables { get; }
Property Value
Type Description
IEnumerable<string>

Methods

| Edit this page View Source

AddInlineData(BindingsPattern)

Adds inline data to a Graph Pattern respecting any BGP breaks.

Declaration
public void AddInlineData(BindingsPattern data)
Parameters
Type Name Description
BindingsPattern data
| Edit this page View Source

AddTriplePattern(ITriplePattern)

Adds a Triple Pattern to the Graph Pattern respecting any BGP breaks.

Declaration
public void AddTriplePattern(ITriplePattern p)
Parameters
Type Name Description
ITriplePattern p

Triple Pattern.

| Edit this page View Source

InsertAssignment(IAssignmentPattern, int)

Inserts an Assignment at a given position.

Declaration
public void InsertAssignment(IAssignmentPattern assignment, int i)
Parameters
Type Name Description
IAssignmentPattern assignment

Assignment.

int i

Position to insert at.

Remarks

Intended for use by Query Optimisers.

| Edit this page View Source

InsertFilter(ISparqlFilter, int)

Inserts a Filter at a given position.

Declaration
public void InsertFilter(ISparqlFilter filter, int i)
Parameters
Type Name Description
ISparqlFilter filter

Filter.

int i

Position to insert at.

Remarks

Intended for use by Query Optimisers.

| Edit this page View Source

Optimise()

Optimises the Graph Pattern using the default query optimiser.

Declaration
public void Optimise()
| Edit this page View Source

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 or QueryOptimisation to disable automatic optimisation and then manually call this method as necessary.

| Edit this page View Source

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.

IEnumerable<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 or 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.

| Edit this page View Source

SwapTriplePatterns(int, int)

Swaps the position of the two given Triple Patterns.

Declaration
public void SwapTriplePatterns(int i, int j)
Parameters
Type Name Description
int i

First Position.

int j

Second Position.

Remarks

Intended for use by Query Optimisers.

| Edit this page View Source

ToAlgebra()

Gets the Algebra representation of the Graph Pattern.

Declaration
public ISparqlAlgebra ToAlgebra()
Returns
Type Description
ISparqlAlgebra
| Edit this page View Source

ToString()

Gets the String representation of the Graph Pattern.

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • GraphPattern()
  • Properties
    • ChildGraphPatterns
    • Filter
    • GraphSpecifier
    • HasChildGraphPatterns
    • HasInlineData
    • HasModifier
    • InlineData
    • IsEmpty
    • IsExists
    • IsFiltered
    • IsGraph
    • IsMinus
    • IsNotExists
    • IsOptimised
    • IsOptional
    • IsService
    • IsSilent
    • IsSubQuery
    • IsUnion
    • TriplePatterns
    • UnplacedAssignments
    • UnplacedFilters
    • UsesDefaultDataset
    • Variables
  • Methods
    • AddInlineData(BindingsPattern)
    • AddTriplePattern(ITriplePattern)
    • InsertAssignment(IAssignmentPattern, int)
    • InsertFilter(ISparqlFilter, int)
    • Optimise()
    • Optimise(IQueryOptimiser)
    • Optimise(IQueryOptimiser, IEnumerable<string>)
    • SwapTriplePatterns(int, int)
    • ToAlgebra()
    • ToString()
  • Extension Methods
Back to top Generated by DocFX