org.d2rq.values
Class BlankNodeIDValueMaker

java.lang.Object
  extended by org.d2rq.values.BlankNodeIDValueMaker
All Implemented Interfaces:
ValueMaker

public class BlankNodeIDValueMaker
extends Object
implements ValueMaker

A blank node identifier that uniquely identifies all resources generated from a specific ClassMap.

(Note: The implementation makes some assumptions about the Column class to keep the code simple and fast. This means BlankNodeIdentifier might not work with some hypothetical subclasses of Column.)

Author:
Richard Cyganiak (richard@cyganiak.de)

Field Summary
 
Fields inherited from interface org.d2rq.values.ValueMaker
NULL
 
Constructor Summary
BlankNodeIDValueMaker(String id, List<ColumnName> columns)
          Constructs a new blank node identifier.
 
Method Summary
 void describeSelf(NodeSetFilter c)
           
 List<ColumnName> getColumns()
           
 String getID()
           
 String makeValue(ResultRow row)
          Creates an identifier from a database row.
 boolean matches(String value)
          A string matches if it contains the correct number of delimiters, and the first delimited part is the correct ID.
 List<OrderOp.OrderSpec> orderSpecs(boolean ascending)
           
 Set<ProjectionSpec> projectionSpecs()
          Returns a set of all ProjectionSpecs containing data necessary for this ValueSource.
 ValueMaker rename(Renamer renamer)
           
 Expression toExpression()
           
 String toString()
           
 Expression valueExpression(String value, DatabaseOp table, Vendor vendor)
          A SQL expression that selects only rows where this value maker produces the specified value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BlankNodeIDValueMaker

public BlankNodeIDValueMaker(String id,
                             List<ColumnName> columns)
Constructs a new blank node identifier.

Parameters:
id - A string that is unique for the class map whose resources are identified by this BlankNodeIdentifier
columns - A set of ColumnNames that uniquely identify the nodes
Method Detail

getColumns

public List<ColumnName> getColumns()

getID

public String getID()

describeSelf

public void describeSelf(NodeSetFilter c)
Specified by:
describeSelf in interface ValueMaker

matches

public boolean matches(String value)
A string matches if it contains the correct number of delimiters, and the first delimited part is the correct ID.

Specified by:
matches in interface ValueMaker
Returns:
true iff this node maker is capable of producing the value

valueExpression

public Expression valueExpression(String value,
                                  DatabaseOp table,
                                  Vendor vendor)
Description copied from interface: ValueMaker
A SQL expression that selects only rows where this value maker produces the specified value. Expression.FALSE if this value maker is incapable of producing the value.

Specified by:
valueExpression in interface ValueMaker
Parameters:
value - A value
table - The table to which the expression will be applicable
vendor - A vendor instance for datatyping etc.
Returns:
An expression that selects rows that produce this value

projectionSpecs

public Set<ProjectionSpec> projectionSpecs()
Description copied from interface: ValueMaker
Returns a set of all ProjectionSpecs containing data necessary for this ValueSource.

Specified by:
projectionSpecs in interface ValueMaker
Returns:
a set of ProjectionSpecs

makeValue

public String makeValue(ResultRow row)
Creates an identifier from a database row.

Specified by:
makeValue in interface ValueMaker
Parameters:
row - a database row
Returns:
this column's blank node identifier

rename

public ValueMaker rename(Renamer renamer)
Specified by:
rename in interface ValueMaker

orderSpecs

public List<OrderOp.OrderSpec> orderSpecs(boolean ascending)
Specified by:
orderSpecs in interface ValueMaker

toString

public String toString()
Overrides:
toString in class Object

toExpression

public Expression toExpression()