diff --git a/main/src/com/google/gridworks/protograph/transpose/Transposer.java b/main/src/com/google/gridworks/protograph/transpose/Transposer.java index 46f74c6b9..642e83621 100644 --- a/main/src/com/google/gridworks/protograph/transpose/Transposer.java +++ b/main/src/com/google/gridworks/protograph/transpose/Transposer.java @@ -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) { diff --git a/main/src/com/google/gridworks/protograph/transpose/TripleLoaderTransposedNodeFactory.java b/main/src/com/google/gridworks/protograph/transpose/TripleLoaderTransposedNodeFactory.java index c37c66bef..61722e78b 100644 --- a/main/src/com/google/gridworks/protograph/transpose/TripleLoaderTransposedNodeFactory.java +++ b/main/src/com/google/gridworks/protograph/transpose/TripleLoaderTransposedNodeFactory.java @@ -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) { diff --git a/main/webapp/modules/core/scripts/protograph/schema-alignment-ui-node.js b/main/webapp/modules/core/scripts/protograph/schema-alignment-ui-node.js index f2c0da273..91334c5fe 100644 --- a/main/webapp/modules/core/scripts/protograph/schema-alignment-ui-node.js +++ b/main/webapp/modules/core/scripts/protograph/schema-alignment-ui-node.js @@ -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;