diff --git a/src/main/java/com/metaweb/gridworks/protograph/transpose/TripleLoaderTransposedNodeFactory.java b/src/main/java/com/metaweb/gridworks/protograph/transpose/TripleLoaderTransposedNodeFactory.java index 22696e34d..1361aa59d 100644 --- a/src/main/java/com/metaweb/gridworks/protograph/transpose/TripleLoaderTransposedNodeFactory.java +++ b/src/main/java/com/metaweb/gridworks/protograph/transpose/TripleLoaderTransposedNodeFactory.java @@ -151,20 +151,22 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory String object = cell.value instanceof String ? JSONObject.quote((String) cell.value) : cell.value.toString(); - if ("/type/text".equals(node.lang)) { - writeLine( - "{ 's' : '" + subject + - "', 'p' : '" + predicate + - "', 'o' : " + object + - ", 'lang' : '" + node.lang + - "' }" - ); - } else { - writeLine( - "{ 's' : '" + subject + - "', 'p' : '" + predicate + - "', 'o' : " + object + " }" - ); + if (subject != null) { + if ("/type/text".equals(node.lang)) { + writeLine( + "{ 's' : '" + subject + + "', 'p' : '" + predicate + + "', 'o' : " + object + + ", 'lang' : '" + node.lang + + "' }" + ); + } else { + writeLine( + "{ 's' : '" + subject + + "', 'p' : '" + predicate + + "', 'o' : " + object + " }" + ); + } } return object; diff --git a/src/main/webapp/scripts/project/menu-bar.js b/src/main/webapp/scripts/project/menu-bar.js index e464667cc..d167f76c6 100644 --- a/src/main/webapp/scripts/project/menu-bar.js +++ b/src/main/webapp/scripts/project/menu-bar.js @@ -24,8 +24,17 @@ MenuBar.prototype._initializeUI = function() { click: function() { self._doAutoSchemaAlignment(); } },*/ { - label: "Edit Schema Alignment ...", - click: function() { self._doEditSchemaAlignment(); } + label: "Edit Schema Aligment Skeleton ...", + click: function() { self._doEditSchemaAlignment(false); } + }, + { + label: "Reset Schema Alignment Skeleton ...", + click: function() { self._doEditSchemaAlignment(true); } + }, + {}, + { + label: "Load into Freebase ...", + click: function() {} } ]); @@ -139,6 +148,6 @@ MenuBar.prototype._doAutoSchemaAlignment = function() { //SchemaAlignment.autoAlign(); }; -MenuBar.prototype._doEditSchemaAlignment = function() { - new SchemaAlignmentDialog(theProject.protograph, function(newProtograph) {}); +MenuBar.prototype._doEditSchemaAlignment = function(reset) { + new SchemaAlignmentDialog(reset ? null : theProject.protograph, function(newProtograph) {}); }; diff --git a/src/main/webapp/scripts/project/schema-alignment-ui-link.js b/src/main/webapp/scripts/project/schema-alignment-ui-link.js index ef2023939..cacce5df6 100644 --- a/src/main/webapp/scripts/project/schema-alignment-ui-link.js +++ b/src/main/webapp/scripts/project/schema-alignment-ui-link.js @@ -67,7 +67,7 @@ SchemaAlignmentDialog.UILink.prototype._renderMain = function() { .html(label) .appendTo(this._tdMain) .click(function(evt) { - self._showPropertySuggestPopup(this); + self._startEditProperty(this); }); $('').attr("src", "images/arrow-start.png").prependTo(a); @@ -75,51 +75,247 @@ SchemaAlignmentDialog.UILink.prototype._renderMain = function() { }; SchemaAlignmentDialog.UILink.prototype._renderDetails = function() { - var tableDetails = $('
' + - 'The protograph serves as a skeleton for the graph-shaped data that will get generated ' + + 'The schema alignment skeleton below specifies how the graph-shaped data that will get generated ' + 'from your grid-shaped data and written into Freebase. The cells in each record of your data will ' + - 'get placed into nodes within the protograph. Configure the protograph by specifying which ' + + 'get placed into nodes within the skeleton. Configure the skeleton by specifying which ' + 'column to substitute into which node. A node can also be an automatically generated ' + 'anonymous node, or it can be an explicit value or topic that is the same for all records.' + '
').appendTo(body); @@ -202,7 +202,7 @@ SchemaAlignmentDialog.prototype._constructBody = function(body) { $( '