org.nsdl.mptstore.core
Interface DDLGenerator

All Known Implementing Classes:
AbstractDDLGenerator, DerbyDDLGenerator, H2DDLGenerator, PostgresDDLGenerator

public interface DDLGenerator

Provides RDBMS-specific DDL string(s) for table management functions.

The map table should have columns pKey (which holds an auto-incremented integer) and p (which holds the actual predicate in N-Triples format).

The SO (predicate) tables should each have columns s and o, for holding the subject and object strings in N-Triples format.

Note on Datatypes

Typically the s, p, and o datatypes be declared as TEXT or CLOB in the underlying database, but they can also be defined as varchars if the data set is known to fit within some pre-determined range. The type should be such that comparisons are case sensitive, as N-Triples is a case sensitive format.

Note on Character Encoding

Note: The database need only be capable of storing 7-bit ASCII because the RDF is stored in N-Triples format. In fact, it will likely perform better if the database is defined as such because more data will fit in less space if characters only take up 1 byte in the database.

Author:
cwilper@cs.cornell.edu

Method Summary
 java.util.List<java.lang.String> getCreateMapTableDDL(java.lang.String table)
          Get the DDL command(s) necessary to create a map table with the given name.
 java.util.List<java.lang.String> getCreateSOTableDDL(java.lang.String table)
          Get the DDL command(s) necessary to create a subject-object relationship table (aka predicate table) with the given name.
 java.util.List<java.lang.String> getDropMapTableDDL(java.lang.String table)
          Get the DDL command(s) necessary to drop a map table with the given name.
 java.util.List<java.lang.String> getDropSOTableDDL(java.lang.String table)
          Get the DDL command(s) necessary to drop a subject-object relationship table (aka predicate table) with the given name.
 

Method Detail

getCreateMapTableDDL

java.util.List<java.lang.String> getCreateMapTableDDL(java.lang.String table)
Get the DDL command(s) necessary to create a map table with the given name.

Parameters:
table - The map table name.
Returns:
The necessary DDL.

getDropMapTableDDL

java.util.List<java.lang.String> getDropMapTableDDL(java.lang.String table)
Get the DDL command(s) necessary to drop a map table with the given name.

Parameters:
table - The map table name.
Returns:
The necessary DDL.

getCreateSOTableDDL

java.util.List<java.lang.String> getCreateSOTableDDL(java.lang.String table)
Get the DDL command(s) necessary to create a subject-object relationship table (aka predicate table) with the given name.

Parameters:
table - The relationship table name.
Returns:
The necessary DDL.

getDropSOTableDDL

java.util.List<java.lang.String> getDropSOTableDDL(java.lang.String table)
Get the DDL command(s) necessary to drop a subject-object relationship table (aka predicate table) with the given name.

Parameters:
table - The relationship table name.
Returns:
The necessary DDL.