de.fuberlin.wiwiss.d2rq.map
Class PropertyBridge

java.lang.Object
  extended byde.fuberlin.wiwiss.d2rq.map.PropertyBridge
All Implemented Interfaces:
java.lang.Cloneable, Prefixable

public class PropertyBridge
extends java.lang.Object
implements Prefixable

A respresentation of a d2rq:PropertyBridge, describing how a set of virtual triples are to be obtained from a database. The virtual subjects, predicates and objects are generated by NodeMakers. TODO: Rename to TripleMap?

History:
06-03-2004: Initial version of this class.
08-03-2004: Many, many changes.

Version:
V0.2
Author:
Chris Bizer chris@bizer.de, Richard Cyganiak

Field Summary
private  java.util.Map aliases
           
private  java.util.Set conditions
           
private  Database database
           
private  com.hp.hpl.jena.graph.Node id
           
private  java.util.Set joins
           
private  boolean mightContainDuplicates
           
private  NodeMaker objectMaker
           
private  NodeMaker predicateMaker
           
private  NodeMaker subjectMaker
           
private  TablePrefixer tablePrefixer
           
private  URIMatchPolicy uriMatchPolicy
           
 
Constructor Summary
PropertyBridge(com.hp.hpl.jena.graph.Node id, NodeMaker subjectMaker, NodeMaker predicateMaker, NodeMaker objectMaker, Database database, java.util.Set joins, java.util.Map aliases)
           
 
Method Summary
 void addConditions(java.util.Set whereConditions)
          Adds SQL WHERE conditions that must evaluate to TRUE for a given database row or the bridge will not generate a triple.
 java.lang.Object clone()
          Make a shallow copy of this.
 boolean couldFit(com.hp.hpl.jena.graph.Triple t, QueryContext context)
          Checks if a given triple could match this bridge without querying the database.
 java.util.Map getAliases()
           
 java.util.Set getConditions()
          Returns the SQL WHERE conditions that must hold for a given database row or the bridge will not generate a triple.
 Database getDatabase()
           
 int getEvaluationPriority()
           
 java.util.Set getJoins()
           
 NodeMaker getObjectMaker()
           
 NodeMaker getPredicateMaker()
           
 NodeMaker getSubjectMaker()
           
 TablePrefixer getTablePrefixer()
           
 boolean mightContainDuplicates()
           
 void prefixTables(TablePrefixer prefixer)
          Changes the fields in a newly created clone that are to be modified when making aliasses.
 void setMightContainDuplicates(boolean mightContainDuplicates)
           
 void setTablePrefixer(TablePrefixer tablePrefixer)
           
 void setURIMatchPolicy(URIMatchPolicy policy)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

private com.hp.hpl.jena.graph.Node id

subjectMaker

private NodeMaker subjectMaker

predicateMaker

private NodeMaker predicateMaker

objectMaker

private NodeMaker objectMaker

database

private Database database

aliases

private java.util.Map aliases

joins

private java.util.Set joins

conditions

private java.util.Set conditions

uriMatchPolicy

private URIMatchPolicy uriMatchPolicy

mightContainDuplicates

private boolean mightContainDuplicates

tablePrefixer

private TablePrefixer tablePrefixer
Constructor Detail

PropertyBridge

public PropertyBridge(com.hp.hpl.jena.graph.Node id,
                      NodeMaker subjectMaker,
                      NodeMaker predicateMaker,
                      NodeMaker objectMaker,
                      Database database,
                      java.util.Set joins,
                      java.util.Map aliases)
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from interface: Prefixable
Make a shallow copy of this. General advice: Do not overwrite clone(). prefixTables() works best with shallow copy which Object implements. Issues: I have not found a (preferred) static equivalent of clone(). Since Objects clone() method is protected, we cannot just declare Cloneable, if we want to call clone() from outside of that class hierarchy. Instead it must be public and implemented in each Prefixable class by a call to super.clone().

Specified by:
clone in interface Prefixable
Throws:
java.lang.CloneNotSupportedException

prefixTables

public void prefixTables(TablePrefixer prefixer)
Description copied from interface: Prefixable
Changes the fields in a newly created clone that are to be modified when making aliasses.

Specified by:
prefixTables in interface Prefixable
Parameters:
prefixer - does the actual prefixing of simple and complex types.

getAliases

public java.util.Map getAliases()

getTablePrefixer

public TablePrefixer getTablePrefixer()

setTablePrefixer

public void setTablePrefixer(TablePrefixer tablePrefixer)

addConditions

public void addConditions(java.util.Set whereConditions)
Adds SQL WHERE conditions that must evaluate to TRUE for a given database row or the bridge will not generate a triple.

Parameters:
whereConditions - a set of Strings

getConditions

public java.util.Set getConditions()
Returns the SQL WHERE conditions that must hold for a given database row or the bridge will not generate a triple.

Returns:
a set of Strings

setURIMatchPolicy

public void setURIMatchPolicy(URIMatchPolicy policy)

getEvaluationPriority

public int getEvaluationPriority()

setMightContainDuplicates

public void setMightContainDuplicates(boolean mightContainDuplicates)

mightContainDuplicates

public boolean mightContainDuplicates()

couldFit

public boolean couldFit(com.hp.hpl.jena.graph.Triple t,
                        QueryContext context)
Checks if a given triple could match this bridge without querying the database.


getDatabase

public Database getDatabase()

getSubjectMaker

public NodeMaker getSubjectMaker()

getPredicateMaker

public NodeMaker getPredicateMaker()

getObjectMaker

public NodeMaker getObjectMaker()

getJoins

public java.util.Set getJoins()

toString

public java.lang.String toString()