Class ConstructContext
Context used for Constructing Triples in SPARQL Query/Update.
Inherited Members
Namespace: VDS.RDF.Query.Construct
Assembly: dotNetRdf.dll
Syntax
public class ConstructContext
  Constructors
| Edit this page View SourceConstructContext(IGraph, bool)
Creates a new Construct Context.
Declaration
public ConstructContext(IGraph g, bool preserveBNodes)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IGraph | g | Graph to construct Triples in. May be null.  | 
      
| bool | preserveBNodes | Whether Blank Nodes bound to variables should be preserved as-is.  | 
      
ConstructContext(INodeFactory, bool)
Creates a new Construct Context.
Declaration
public ConstructContext(INodeFactory factory, bool preserveBNodes)
  Parameters
| Type | Name | Description | 
|---|---|---|
| INodeFactory | factory | Factory to create nodes with. May be null.  | 
      
| bool | preserveBNodes | Whether Blank Nodes bound to variables should be preserved as-is.  | 
      
Properties
| Edit this page View SourceGraph
Gets the Graph that Triples should be constructed in.
Declaration
public IGraph Graph { get; }
  Property Value
| Type | Description | 
|---|---|
| IGraph | 
PreserveBlankNodes
Gets whether Blank Nodes bound to variables should be preserved.
Declaration
public bool PreserveBlankNodes { get; }
  Property Value
| Type | Description | 
|---|---|
| bool | 
Set
Gets the Set that this Context pertains to.
Declaration
public ISet Set { get; }
  Property Value
| Type | Description | 
|---|---|
| ISet | 
Methods
| Edit this page View SourceGetBlankNode(string)
Creates a new Blank Node for this Context.
Declaration
public INode GetBlankNode(string id)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | id | ID.  | 
      
Returns
| Type | Description | 
|---|---|
| INode | 
Remarks
If the same Blank Node ID is used multiple times in this Context you will always get the same Blank Node for that ID.
GetNode(INode)
Creates a Node for the Context.
Declaration
public INode GetNode(INode n)
  Parameters
| Type | Name | Description | 
|---|---|---|
| INode | n | Node.  | 
      
Returns
| Type | Description | 
|---|---|
| INode | 
Remarks
In effect all this does is ensure that all Nodes end up in the same Graph which may occasionally not happen otherwise when Graph wrappers are involved.