de.fuberlin.wiwiss.d2rq.algebra
Class NodeRelation

java.lang.Object
  extended by de.fuberlin.wiwiss.d2rq.algebra.NodeRelation
Direct Known Subclasses:
TripleRelation

public class NodeRelation
extends Object

A Relation associated with a number of named NodeMakers. TODO: This is really just a Relation and a BindingMaker wrapped into one. Refactor as such?

Author:
Richard Cyganiak (richard@cyganiak.de)

Field Summary
static NodeRelation TRUE
           
 
Constructor Summary
NodeRelation(Relation base, Map<Var,NodeMaker> nodeMakers)
           
 
Method Summary
 Relation baseRelation()
           
static NodeRelation empty(Set<Var> variables)
           
 NodeRelation extendWith(Binding binding)
          Joins this NodeRelation with a Binding.
 NodeRelation limit(int limit)
           
 NodeMaker nodeMaker(Var variables)
           
 NodeRelation orderBy(Var variable, boolean ascending)
           
 NodeRelation renameSingleRelation(RelationName oldName, RelationName newName)
           
 NodeRelation select(Expression expression)
           
 String toString()
           
 Set<Var> variables()
           
 NodeRelation withPrefix(int index)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRUE

public static final NodeRelation TRUE
Constructor Detail

NodeRelation

public NodeRelation(Relation base,
                    Map<Var,NodeMaker> nodeMakers)
Method Detail

empty

public static NodeRelation empty(Set<Var> variables)

baseRelation

public Relation baseRelation()

variables

public Set<Var> variables()

nodeMaker

public NodeMaker nodeMaker(Var variables)

withPrefix

public NodeRelation withPrefix(int index)

renameSingleRelation

public NodeRelation renameSingleRelation(RelationName oldName,
                                         RelationName newName)

extendWith

public NodeRelation extendWith(Binding binding)
Joins this NodeRelation with a Binding. Any row in this NodeRelation that is incompatible with the binding will be dropped, and any compatible row will be extended with FixedNodeMakers whose node is taken from the binding.

Parameters:
binding - A binding to join with this NodeRelation
Returns:
The joined NodeRelation

select

public NodeRelation select(Expression expression)

orderBy

public NodeRelation orderBy(Var variable,
                            boolean ascending)

limit

public NodeRelation limit(int limit)

toString

public String toString()
Overrides:
toString in class Object