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:
parent
476c84fa61
commit
b8ad56c6db
@ -105,6 +105,7 @@ public class Transposer {
|
|||||||
if (node instanceof CellNode) {
|
if (node instanceof CellNode) {
|
||||||
CellNode node2 = (CellNode) node;
|
CellNode node2 = (CellNode) node;
|
||||||
Column column = project.columnModel.getColumnByName(node2.columnName);
|
Column column = project.columnModel.getColumnByName(node2.columnName);
|
||||||
|
if (column != null) {
|
||||||
Cell cell = row.getCell(column.getCellIndex());
|
Cell cell = row.getCell(column.getCellIndex());
|
||||||
if (cell != null && ExpressionUtils.isNonBlankData(cell.value)) {
|
if (cell != null && ExpressionUtils.isNonBlankData(cell.value)) {
|
||||||
if (node2 instanceof CellTopicNode &&
|
if (node2 instanceof CellTopicNode &&
|
||||||
@ -125,6 +126,7 @@ public class Transposer {
|
|||||||
cell
|
cell
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (node instanceof AnonymousNode) {
|
if (node instanceof AnonymousNode) {
|
||||||
tnode = nodeFactory.transposeAnonymousNode(
|
tnode = nodeFactory.transposeAnonymousNode(
|
||||||
|
@ -360,7 +360,15 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
|
|
||||||
id = "$" + node.columnName.replaceAll("\\W+", "_") + "_" + var;
|
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);
|
writeLine(id, "name", cell.value, project, -1, -1, (Cell) null, -1, -1, (Cell) null, !load);
|
||||||
|
|
||||||
if (cell.recon != null) {
|
if (cell.recon != null) {
|
||||||
|
@ -542,11 +542,10 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
|
|||||||
node.columnName = $("input[name='schema-align-node-dialog-column']:checked")[0].value;
|
node.columnName = $("input[name='schema-align-node-dialog-column']:checked")[0].value;
|
||||||
|
|
||||||
if (node.nodeType == "cell-as-topic") {
|
if (node.nodeType == "cell-as-topic") {
|
||||||
if (elmts.radioNodeTypeCellAsTopicCreate[0].checked) {
|
node.createForNoReconMatch = elmts.radioNodeTypeCellAsTopicCreate[0].checked;
|
||||||
node.createForNoReconMatch = true;
|
|
||||||
|
|
||||||
var t = elmts.cellAsTopicNodeTypeInput.data("data.suggest");
|
var t = elmts.cellAsTopicNodeTypeInput.data("data.suggest");
|
||||||
if (!(t)) {
|
if (!(t) && node.createForNoReconMatch) {
|
||||||
alert("For creating a new graph node, you need to specify a type for it.");
|
alert("For creating a new graph node, you need to specify a type for it.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -554,9 +553,6 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
|
|||||||
id: t.id,
|
id: t.id,
|
||||||
name: t.name
|
name: t.name
|
||||||
};
|
};
|
||||||
} else {
|
|
||||||
node.createForNoReconMatch = false;
|
|
||||||
}
|
|
||||||
} else if (node.nodeType == "cell-as-value") {
|
} else if (node.nodeType == "cell-as-value") {
|
||||||
node.valueType = elmts.cellAsValueTypeSelect[0].value;
|
node.valueType = elmts.cellAsValueTypeSelect[0].value;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user