org.d2rq.values
Interface ValueMaker

All Known Implementing Classes:
BaseIRIValueMaker, BlankNodeIDValueMaker, ColumnValueMaker, DecoratingValueMaker, TemplateValueMaker

public interface ValueMaker

Describes a set of strings that are obtained in some way from one or more database columns.

Typical implementations are ColumnValueMaker (describing the set of strings contained in one database column), TemplateValueMaker (describing the set of strings that is obtained by sticking the values of several database fields into a string pattern), and BlankNodeIDValueMaker (similar).

There are several other implementations that modify the behaviour of another underlying ValueMaker, implementing the Decorator pattern. This includes TranslationTable, TranslatingValueMaker (translates values using a translation table or translation class) and the various value restrictions (@link RegexRestriction et. al.).

ValueMakers are used by NodeMakers. A node maker wraps the strings into Jena nodes, thus creating a description of a set of RDF nodes.

Author:
Richard Cyganiak (richard@cyganiak.de)

Field Summary
static ValueMaker NULL
          A value maker that never produces a value.
 
Method Summary
 void describeSelf(NodeSetFilter c)
           
 String makeValue(ResultRow row)
          Retrieves a value from a database row according to some rule or pattern.
 boolean matches(String value)
          Indicates whether the node maker is capable of producing a given value, as far as can be told without having access to the actual database.
 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 valueExpression(String value, DatabaseOp tabular, Vendor vendor)
          A SQL expression that selects only rows where this value maker produces the specified value.
 

Field Detail

NULL

static final ValueMaker NULL
A value maker that never produces a value.

Method Detail

matches

boolean matches(String value)
Indicates whether the node maker is capable of producing a given value, as far as can be told without having access to the actual database.

Returns:
true iff this node maker is capable of producing the value

valueExpression

Expression valueExpression(String value,
                           DatabaseOp tabular,
                           Vendor vendor)
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.

Parameters:
value - A value
tabular - 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

Set<ProjectionSpec> projectionSpecs()
Returns a set of all ProjectionSpecs containing data necessary for this ValueSource.

Returns:
a set of ProjectionSpecs

makeValue

String makeValue(ResultRow row)
Retrieves a value from a database row according to some rule or pattern.

Parameters:
row - the database row
Returns:
a value created from the row

describeSelf

void describeSelf(NodeSetFilter c)

rename

ValueMaker rename(Renamer renamer)

orderSpecs

List<OrderOp.OrderSpec> orderSpecs(boolean ascending)