de.fuberlin.wiwiss.d2rq.fastpath
Class NodeConstraintImpl

java.lang.Object
  extended by de.fuberlin.wiwiss.d2rq.fastpath.NodeConstraintImpl
All Implemented Interfaces:
NodeSetFilter

public class NodeConstraintImpl
extends Object
implements NodeSetFilter

Holds constraint information for a variable node. In a query a variable node is either a result value, or a shared variable or both. If it is a shared variable, we collect into a NodeConstraint all constraining information that we know about the different node positions from the TripleRelations.

Version:
$Id: NodeConstraintImpl.java,v 1.6 2006/12/06 11:25:50 cyganiak Exp $
Author:
jg

Field Summary
static int BlankNodeType
           
static int LiteralNodeType
           
static int NotFixedNodeType
           
static int UriNodeType
           
 
Constructor Summary
NodeConstraintImpl()
           
 
Method Summary
 void addConstraintsToSQL(SelectStatementBuilder sql)
          The collected constraints are created as SQL constraints.
 Set columns()
           
 Node fixedNode()
           
 boolean infoAdded()
           
 boolean isPossible()
           
 void limitTo(Node node)
          We see a fixed NodeMaker.
 void limitToBlankNodes()
          Limits this node set to blank nodes.
 void limitToEmptySet()
          Limits the node set to the empty set.
 void limitToLiterals(String language, RDFDatatype datatype)
          Limits this node set to literals having a particular language tag and datatype.
 void limitToURIs()
          Limits this node set to URI nodes.
 void limitValuesToAttribute(Attribute c)
          Constraints given on Nodes that are equal to Columns can be directly translated to Column constraints.
 void limitValuesToBlankNodeID(BlankNodeID id)
          Limits this node set to nodes whose value matches the values produced by a blank node ID.
 void limitValuesToPattern(Pattern p)
          Pattern-Constraints can be translated to column constraints.
 Set patterns()
           
 void resetInfoAdded()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NotFixedNodeType

public static final int NotFixedNodeType
See Also:
Constant Field Values

BlankNodeType

public static final int BlankNodeType
See Also:
Constant Field Values

UriNodeType

public static final int UriNodeType
See Also:
Constant Field Values

LiteralNodeType

public static final int LiteralNodeType
See Also:
Constant Field Values
Constructor Detail

NodeConstraintImpl

public NodeConstraintImpl()
Method Detail

isPossible

public boolean isPossible()

limitToEmptySet

public void limitToEmptySet()
Description copied from interface: NodeSetFilter
Limits the node set to the empty set.

Specified by:
limitToEmptySet in interface NodeSetFilter

resetInfoAdded

public void resetInfoAdded()

infoAdded

public boolean infoAdded()

fixedNode

public Node fixedNode()

patterns

public Set patterns()

columns

public Set columns()

limitToLiterals

public void limitToLiterals(String language,
                            RDFDatatype datatype)
Description copied from interface: NodeSetFilter
Limits this node set to literals having a particular language tag and datatype.

Specified by:
limitToLiterals in interface NodeSetFilter
Parameters:
language - The language tag of all nodes in the set, or null for plain or datatype literals
datatype - The datatype of all nodes in the set, or null for plain literals

limitTo

public void limitTo(Node node)
We see a fixed NodeMaker.

Specified by:
limitTo in interface NodeSetFilter
Parameters:
node -

limitToURIs

public void limitToURIs()
Description copied from interface: NodeSetFilter
Limits this node set to URI nodes.

Specified by:
limitToURIs in interface NodeSetFilter

limitToBlankNodes

public void limitToBlankNodes()
Description copied from interface: NodeSetFilter
Limits this node set to blank nodes.

Specified by:
limitToBlankNodes in interface NodeSetFilter

limitValuesToAttribute

public void limitValuesToAttribute(Attribute c)
Constraints given on Nodes that are equal to Columns can be directly translated to Column constraints. NodeMakers with an attached ValueMaker call this.

Specified by:
limitValuesToAttribute in interface NodeSetFilter
Parameters:
c -

limitValuesToPattern

public void limitValuesToPattern(Pattern p)
Pattern-Constraints can be translated to column constraints. NodeMakers with an attached ValueMaker call this.

Specified by:
limitValuesToPattern in interface NodeSetFilter
Parameters:
p -

limitValuesToBlankNodeID

public void limitValuesToBlankNodeID(BlankNodeID id)
Description copied from interface: NodeSetFilter
Limits this node set to nodes whose value matches the values produced by a blank node ID.

Specified by:
limitValuesToBlankNodeID in interface NodeSetFilter
Parameters:
id - The blank node ID producing possible values

addConstraintsToSQL

public void addConstraintsToSQL(SelectStatementBuilder sql)
The collected constraints are created as SQL constraints.

Parameters:
sql - the statment maker that gets the constraints. It knows about Alias and correct quoting of values for integer/string database columns.