org.nsdl.mptstore.query.provider
Class TriplePatternSQLProvider

java.lang.Object
  extended by org.nsdl.mptstore.query.provider.TriplePatternSQLProvider
All Implemented Interfaces:
SQLProvider

public class TriplePatternSQLProvider
extends java.lang.Object
implements SQLProvider

Translates a TriplePattern into a series of SQL statements.

Author:
cwilper@cs.cornell.edu.

Constructor Summary
TriplePatternSQLProvider(TableManager tableManager, boolean backslashIsEscape, TriplePattern pattern, java.util.List<java.lang.String> targets)
          Instantiate from the given values.
 
Method Summary
 java.util.List<java.lang.String> getSQL()
          Get the sequence of SELECT statements.
 java.util.List<java.lang.String> getTargets()
          Get the names of the values that are being selected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TriplePatternSQLProvider

public TriplePatternSQLProvider(TableManager tableManager,
                                boolean backslashIsEscape,
                                TriplePattern pattern,
                                java.util.List<java.lang.String> targets)
Instantiate from the given values.

Parameters:
tableManager - the table manager to use for getting table names.
backslashIsEscape - whether backslash should be escaped in SQL.
pattern - the triple pattern.
targets - the variable names to use.
Method Detail

getTargets

public java.util.List<java.lang.String> getTargets()
Get the names of the values that are being selected. These should be in the same order specified in the original RDF query, and should match the order of the associated values in the SQL.

Specified by:
getTargets in interface SQLProvider
Returns:
the target names.

getSQL

public java.util.List<java.lang.String> getSQL()
Get the sequence of SELECT statements.

Specified by:
getSQL in interface SQLProvider
Returns:
the SELECT statements.