de.fuberlin.wiwiss.d2rq.algebra
Class UnionOverSameBase

java.lang.Object
  extended by de.fuberlin.wiwiss.d2rq.algebra.UnionOverSameBase
All Implemented Interfaces:
RDFRelation, TripleMaker

public class UnionOverSameBase
extends Object
implements RDFRelation

Version:
$Id: UnionOverSameBase.java,v 1.10 2006/09/28 12:17:44 cyganiak Exp $
Author:
Richard Cyganiak (richard@cyganiak.de)

Field Summary
 
Fields inherited from interface de.fuberlin.wiwiss.d2rq.algebra.RDFRelation
EMPTY
 
Constructor Summary
UnionOverSameBase(List baseRelations)
           
 
Method Summary
 Relation baseRelation()
           
static boolean isSameBase(RDFRelation first, RDFRelation second)
          Checks if two RDFRelations can be combined into a single SQL statement.
 boolean isUnique()
           
 Collection makeTriples(ResultRow row)
           
 NodeMaker namedNodeMaker(String name)
           
 Collection names()
           
 NodeMaker nodeMaker(int index)
          TODO Get rid of RDFRelation.nodeMaker(index)
 Set projectionColumns()
           
 RDFRelation renameColumns(ColumnRenamer renamer)
           
 RDFRelation selectTriple(com.hp.hpl.jena.graph.Triple triplePattern)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnionOverSameBase

public UnionOverSameBase(List baseRelations)
Method Detail

isSameBase

public static boolean isSameBase(RDFRelation first,
                                 RDFRelation second)
Checks if two RDFRelations can be combined into a single SQL statement. Relations can be combined iff they access the same database and they contain exactly the same joins and WHERE clauses. If they both contain no joins, they must contain only columns from the same table. TODO This should be done via Relation.equals?

Returns:
true if both arguments are combinable

baseRelation

public Relation baseRelation()
Specified by:
baseRelation in interface RDFRelation

projectionColumns

public Set projectionColumns()
Specified by:
projectionColumns in interface RDFRelation

isUnique

public boolean isUnique()
Specified by:
isUnique in interface RDFRelation

makeTriples

public Collection makeTriples(ResultRow row)
Specified by:
makeTriples in interface TripleMaker

nodeMaker

public NodeMaker nodeMaker(int index)
Description copied from interface: RDFRelation
TODO Get rid of RDFRelation.nodeMaker(index)

Specified by:
nodeMaker in interface RDFRelation
Parameters:
index - 0, 1 or 2
Returns:
The subject, predicate or object NodeMaker

selectTriple

public RDFRelation selectTriple(com.hp.hpl.jena.graph.Triple triplePattern)
Specified by:
selectTriple in interface RDFRelation

renameColumns

public RDFRelation renameColumns(ColumnRenamer renamer)
Specified by:
renameColumns in interface RDFRelation

names

public Collection names()
Specified by:
names in interface RDFRelation

namedNodeMaker

public NodeMaker namedNodeMaker(String name)
Specified by:
namedNodeMaker in interface RDFRelation