|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.d2rq.mapgen.D2RQTarget
public class D2RQTarget
Constructor Summary | |
---|---|
D2RQTarget()
|
Method Summary | |
---|---|
void |
addPrefix(String prefix,
String uri)
Adds a prefix mapping. |
void |
close()
Will be called when generation is complete. |
void |
generateColumnProperty(Property property,
TableName table,
Identifier column,
DataType datatype)
Generates a mapping from one column to a property. |
void |
generateDatabase(SQLConnection connection,
String startupSQLScript)
Generates a database connection. |
void |
generateEntities(Resource class_,
TableName table,
TemplateValueMaker iriTemplate,
List<Identifier> blankNodeColumns)
Generates a mapping from one table to a set of entities. |
void |
generateEntityLabels(TemplateValueMaker labelTemplate,
TableName table)
Generates a label template for the entities of one table, as part of that table's mapping. |
void |
generateLinkProperty(Property property,
TableName table,
ForeignKey fk1,
ForeignKey fk2)
Generates a mapping from one N:M table to a property. |
void |
generateRefProperty(Property property,
TableName table,
ForeignKey foreignKey)
Generates a mapping from a foreign key to a property. |
Mapping |
getMapping()
|
void |
init(String baseIRI,
Resource generatedOntology,
boolean serveVocabulary,
boolean generateDefinitionLabels)
Called before generation starts. |
void |
skipColumn(TableName table,
Identifier column,
String reason)
Informs the Target instance that a certain column has been
skipped. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public D2RQTarget()
Method Detail |
---|
public Mapping getMapping()
public void init(String baseIRI, Resource generatedOntology, boolean serveVocabulary, boolean generateDefinitionLabels)
Target
init
in interface Target
baseIRI
- A base IRI for absolutizing relative IRI templatesgeneratedOntology
- A URI that identifies the generated vocabularyserveVocabulary
- true
iff the generated mapping is supposed to include vocabulary definitionsgenerateDefinitionLabels
- true
iff the generated mapping is supposed to include labels for generated classes and propertiespublic void addPrefix(String prefix, String uri)
Target
addPrefix
in interface Target
public void generateDatabase(SQLConnection connection, String startupSQLScript)
Target
generateDatabase
in interface Target
connection
- Connection information to the databasestartupSQLScript
- A SQL file that was used to populate/initialize the database connection; may be null
public void generateEntities(Resource class_, TableName table, TemplateValueMaker iriTemplate, List<Identifier> blankNodeColumns)
Target
null
.
generateEntities
in interface Target
class_
- RDFS/OWL class of the entities; may be null
table
- Name of the tableiriTemplate
- IRI template for generating entity IRIs, possibly relativeblankNodeColumns
- List of columns for generating unique blank nodespublic void generateEntityLabels(TemplateValueMaker labelTemplate, TableName table)
Target
generateEntityLabels
in interface Target
labelTemplate
- Template for the labelstable
- Name of the tablepublic void generateColumnProperty(Property property, TableName table, Identifier column, DataType datatype)
Target
generateColumnProperty
in interface Target
property
- The target propertytable
- The source tablecolumn
- The source columndatatype
- The column's datatype; guaranteed to be non-null
public void generateRefProperty(Property property, TableName table, ForeignKey foreignKey)
Target
generateRefProperty
in interface Target
property
- The target propertytable
- The table on which the foreign key constraint is definedforeignKey
- The foreign keypublic void generateLinkProperty(Property property, TableName table, ForeignKey fk1, ForeignKey fk2)
Target
generateLinkProperty
in interface Target
property
- The target propertytable
- Name of the N:M tablefk1
- The foreign key constraint on the N:M table that points to the table containing subjectsfk2
- The foreign key constraint on the N:M table that points to the table containing objectspublic void skipColumn(TableName table, Identifier column, String reason)
Target
Target
instance that a certain column has been
skipped. May be useful for logging etc.
skipColumn
in interface Target
public void close()
Target
close
in interface Target
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |