Made sure in the schema skeleton dialog, in the dialog box for a node, in the "cell-as-topic" section, the type is always recorded.

In the triple loader transposed node factory, use the column's recon config to generate new topics' type.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@1135 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-08-05 00:53:08 +00:00
parent 476c84fa61
commit b8ad56c6db
3 changed files with 38 additions and 32 deletions

View File

@ -105,25 +105,27 @@ public class Transposer {
if (node instanceof CellNode) {
CellNode node2 = (CellNode) node;
Column column = project.columnModel.getColumnByName(node2.columnName);
Cell cell = row.getCell(column.getCellIndex());
if (cell != null && ExpressionUtils.isNonBlankData(cell.value)) {
if (node2 instanceof CellTopicNode &&
(cell.recon == null || cell.recon.judgment == Judgment.None)) {
if (column != null) {
Cell cell = row.getCell(column.getCellIndex());
if (cell != null && ExpressionUtils.isNonBlankData(cell.value)) {
if (node2 instanceof CellTopicNode &&
(cell.recon == null || cell.recon.judgment == Judgment.None)) {
return;
}
context.count++;
if (context.limit > 0 && context.count > context.limit) {
return;
}
tnode = nodeFactory.transposeCellNode(
parentNode,
link,
node2,
rowIndex,
cell
);
}
context.count++;
if (context.limit > 0 && context.count > context.limit) {
return;
}
tnode = nodeFactory.transposeCellNode(
parentNode,
link,
node2,
rowIndex,
cell
);
}
} else {
if (node instanceof AnonymousNode) {

View File

@ -360,7 +360,15 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory
id = "$" + node.columnName.replaceAll("\\W+", "_") + "_" + var;
writeLine(id, "type", node.type.id, project, rowIndex, cellIndex, cell, -1, -1, (Cell) null, !load);
String typeID = node.type.id;
Column column = project.columnModel.getColumnByName(node.columnName);
ReconConfig reconConfig = column.getReconConfig();
if (reconConfig instanceof StandardReconConfig) {
typeID = ((StandardReconConfig) reconConfig).typeID;
}
writeLine(id, "type", typeID, project, rowIndex, cellIndex, cell, -1, -1, (Cell) null, !load);
writeLine(id, "name", cell.value, project, -1, -1, (Cell) null, -1, -1, (Cell) null, !load);
if (cell.recon != null) {

View File

@ -542,21 +542,17 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
node.columnName = $("input[name='schema-align-node-dialog-column']:checked")[0].value;
if (node.nodeType == "cell-as-topic") {
if (elmts.radioNodeTypeCellAsTopicCreate[0].checked) {
node.createForNoReconMatch = true;
var t = elmts.cellAsTopicNodeTypeInput.data("data.suggest");
if (!(t)) {
alert("For creating a new graph node, you need to specify a type for it.");
return null;
}
node.type = {
id: t.id,
name: t.name
};
} else {
node.createForNoReconMatch = false;
node.createForNoReconMatch = elmts.radioNodeTypeCellAsTopicCreate[0].checked;
var t = elmts.cellAsTopicNodeTypeInput.data("data.suggest");
if (!(t) && node.createForNoReconMatch) {
alert("For creating a new graph node, you need to specify a type for it.");
return null;
}
node.type = {
id: t.id,
name: t.name
};
} else if (node.nodeType == "cell-as-value") {
node.valueType = elmts.cellAsValueTypeSelect[0].value;