Increased recon batch size to 10 again. Various style tweaks. Polished up freebase extension's dialogs to be a bit more helpful

git-svn-id: http://google-refine.googlecode.com/svn/trunk@1625 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-10-25 01:07:25 +00:00
parent 424501ba0e
commit 2d9e7c87f6
18 changed files with 296 additions and 226 deletions

View File

@ -1,11 +1,17 @@
<div class="dialog-frame" style="width: 400px;"> <div class="dialog-frame" style="width: 400px;">
<div class="dialog-header" bind="dialogHeader">Are You Sure?</div> <div class="dialog-header" bind="dialogHeader">QA Data Load?</div>
<div class="dialog-body" bind="dialogBody"><table><tr> <div class="dialog-body" bind="dialogBody">
<td width="30%"><img src="/images/cop.png" width="140px"></td> <p class="body-text">Other people will be enlisted to help double-check
<td>Are you sure this data is ready to be <b>tested</b> for upload into <b>Freebase</b>?</td> your data load for quality assurance purposes. Their time and labor
</tr></table></div> have a cost.
</p>
<p class="body-text">You yourself should have taken all reasonable measures
to eliminate errors from your data load. Your prudence is greatly appreciated.
</p>
<p><a href="http://wiki.freebase.com/wiki/Refinery" target="_blank">Tell me more ...</a></p>
</div>
<div class="dialog-footer" bind="dialogFooter"> <div class="dialog-footer" bind="dialogFooter">
<button class="button" bind="okButton">Yes, I'm sure</button> <button class="button" bind="okButton">Yes, QA Data Load</button>
<button class="button" bind="cancelButton">No</button> <button class="button" bind="cancelButton">Cancel</button>
</div> </div>
</div> </div>

View File

@ -1,19 +1,70 @@
<div class="dialog-frame" style="width: 800px;"> <div class="dialog-frame" style="width: 800px;">
<div class="dialog-header" bind="dialogHeader">Load Data into Freebase</div> <div class="dialog-header" bind="dialogHeader">Load Data into Freebase</div>
<div class="dialog-body" bind="dialogBody"> <div class="dialog-body" bind="dialogBody">
<div bind="unalignedCase" style="display: none;" class="freebase-loading-tripleloader-message">
<h2>This dataset has no triples</h2>
<p>Have you aligned it with Freebase's schemas yet? <button class="button" bind="alignButton">Align Now</button></p>
</div>
<div bind="functionalCase" style="display: none;">
<div class="refine-tabs" bind="functionalTabs">
<ul>
<li><a href="#freebase-loading-dialog-functional-tabs-settings">Settings</a></li>
<li><a href="#freebase-loading-dialog-functional-tabs-preview">Preview</a></li>
</ul>
<div id="freebase-loading-dialog-functional-tabs-settings"
class="freebase-loading-dialog-functional-tab-panel"><div class="grid-layout layout-normal"><table>
<tr><td width="20%">Name of data load</td>
<td colspan="2"><input type="text" size="40" id="freebase-loading-source-name" bind="source_name" /></td>
</tr>
<tr><td>Source ID (optional)</td>
<td colspan="2"><input type="text" size="60" id="freebase-loading-source-id" bind="source_id" /></td>
</tr>
<tr><td colspan="3">
<p class="body-text">Note: Your data will only be loaded into
<a href="http://www.sandbox-freebase.com/" target="_blank">Sandbox</a>.
Sandbox is where everyone can experiment with Freebase technologies without disruption
to the official <a href="http://www.freebase.com/">Freebase</a>. Sandbox gets
<a href="http://wiki.freebase.com/wiki/Sandbox" target="_blank">refreshed periodically</a>.
</p>
<p class="body-text">In order to load your data into the official Freebase, you must first load it
into Sandbox. Then it must pass a Quality Assurance (QA) process before it can
be loaded into Freebase proper.
<a href="http://wiki.freebase.com/wiki/Refinery" target="_blank">Find out more ...</a>
</p>
</td>
</tr>
<tr><td>Quality assurance</td>
<td><input bind="qaCheckbox" type="checkbox" name="qa" value="qa" /></td>
<td>After loaded into Sandbox, enlist other people's help to double-check
this data load's quality so that it can be loaded into Freebase.
</td>
</tr>
</table></div></div>
<div id="freebase-loading-dialog-functional-tabs-preview"
class="freebase-loading-dialog-functional-tab-panel freebase-loading-tripleloader-data"
style="display: none;"
bind="previewContainer">
</div>
</div>
</div>
<div bind="loadedCase" style="display: none;" class="freebase-loading-tripleloader-message">
<h2><span bind="tripleCountSpan"></span> triples successfully scheduled for loading</h2>
<h4>Follow the loading progress in the <a bind="refineryLink" target="_new">Freebase Refinery</a>.</h4>
</div>
<div bind="errorCase" style="display: none;" class="freebase-loading-tripleloader-message">
<h2 bind="errorMessage"></h2>
<div bind="errorDetails"></div>
</div>
</div> </div>
<div class="dialog-footer" bind="dialogFooter"> <div class="dialog-footer" bind="dialogFooter"><div class="grid-layout layout-normal layout-full"><table><tr>
<table width="100%"><tr> <td bind="left" style="text-align: left" width="60%" nowrap="true">
<td bind="left" style="text-align: left" width="40%" nowrap="true"> <button class="button" bind="cancelButton" id="freebase-loading-cancel">Cancel</button>
<button class="button" bind="cancelButton" id="freebase-loading-cancel">Cancel</button> </td>
</td> <td bind="center" style="text-align: right" width="20%" nowrap="true">
<td bind="center" style="text-align: center" width="20%" nowrap="true"> <div bind="authorization" class="freebase-loading-authorization"></div>
<div bind="authorization" class="freebase-loading-authorization"></div> </td>
</td> <td bind="right" style="text-align: right" width="20%" nowrap="true">
<td bind="right" style="text-align: right" width="40%" nowrap="true"> <button class="button button-primary button-disabled" bind="loadButton" id="freebase-loading-load" disabled>Load to Sandbox</button>
<span bind="qaCheckboxContainer">Ready to perform QA on this data? <input bind="qaCheckbox" type="checkbox" name="qa" value="qa"></span> </td>
<button class="button" bind="loadButton" id="freebase-loading-load" disabled="disabled">Load to Sandbox</button> </tr></table></div></div>
</td>
</tr></table>
</div>
</div> </div>

View File

@ -59,11 +59,17 @@ FreebaseLoadingDialog.prototype._createDialog = function() {
loadButton.unbind().click(function() { loadButton.unbind().click(function() {
self._load(); self._load();
}); });
self._signedin = true; self._signedin = true;
$("#freebase-loading-source-name").keyup(); $("#freebase-loading-source-name").keyup();
if (typeof cont == "function") cont(data); if (typeof cont == "function") cont(data);
} else { } else {
authorization.html('<a href="javascript:{}" bind="signin">Sign into Freebase</a> to enable loading').show(); authorization.html('<a href="javascript:{}" bind="signin">Sign into Freebase</a> to enable loading').show();
self._signedin = false;
$("#freebase-loading-source-name").keyup();
DOM.bind(authorization).signin.click(function() { DOM.bind(authorization).signin.click(function() {
Sign.signin(function() { Sign.signin(function() {
check_authorization(cont); check_authorization(cont);
@ -105,24 +111,19 @@ FreebaseLoadingDialog.prototype._createDialog = function() {
engine: JSON.stringify(ui.browsingEngine.getJSON()) engine: JSON.stringify(ui.browsingEngine.getJSON())
}, },
function(data) { function(data) {
var body = self._elmts.dialogBody;
if ("tripleloader" in data) { if ("tripleloader" in data) {
body.html( self._elmts.functionalCase.show();
'<div class="freebase-loading-tripleloader-info"><table><tr>' + self._level = DialogSystem.showDialog(dialog);
'<td><div>Name this data load &not; <sup style="color: red">required</sup></div>' +
'<input type="text" size="40" id="freebase-loading-source-name" bind="source_name"></td>' + self._elmts.functionalTabs.tabs();
'<td><div>Source ID &not; <sup style="color: #888">optional</sup></div>' +
'<input type="text" size="60" id="freebase-loading-source-id" bind="source_id"></td>' + self._elmts.previewContainer.text(data.tripleloader).show();
'</tr></table></div>' +
'<div class="freebase-loading-tripleloader-data">' + data.tripleloader + '</div>'
);
self._elmts = DOM.bind(dialog);
self._elmts.source_name.keyup(function() { self._elmts.source_name.keyup(function() {
if (self._signedin && $(this).val() != "") { if (self._signedin && $(this).val() != "") {
loadButton.removeAttr("disabled"); loadButton.removeAttr("disabled").removeClass("button-disabled");
} else { } else {
loadButton.attr("disabled","disabled"); loadButton.attr("disabled","disabled").addClass("button-disabled");
} }
}); });
@ -139,24 +140,21 @@ FreebaseLoadingDialog.prototype._createDialog = function() {
"/command/core/get-preference?" + $.param({ project: theProject.id, name: "freebase.load.jobName" }), "/command/core/get-preference?" + $.param({ project: theProject.id, name: "freebase.load.jobName" }),
null, null,
function(data) { function(data) {
if (data.value != null) { self._elmts.source_name[0].value = (data.value) ? data.value : theProject.metadata.name;
self._elmts.source_name[0].value = data.value;
}
} }
); );
if (typeof cont == "function") cont(); if (typeof cont == "function") cont();
} else { } else {
body.html( self._elmts.unalignedCase.show();
'<div class="freebase-loading-tripleloader-message">'+ self._level = DialogSystem.showDialog(dialog);
'<h2>This dataset has no triples</h2>' +
'<p>Have you aligned it with the Freebase schemas yet?</p>' + self._elmts.alignButton.click(function() {
'</div>' self._dismiss();
); FreebaseExtension.handlers.editSchemaAlignment(false);
self._elmts = DOM.bind(dialog); });
self._end(); self._end();
} }
self._level = DialogSystem.showDialog(dialog);
}, },
"json" "json"
); );
@ -189,12 +187,10 @@ FreebaseLoadingDialog.prototype._load = function() {
var body = self._elmts.dialogBody; var body = self._elmts.dialogBody;
if ("status" in data && typeof data.status == "object" && "code" in data.status && data.status.code == 200) { if ("status" in data && typeof data.status == "object" && "code" in data.status && data.status.code == 200) {
body.html( self._elmts.tripleCountSpan.text(data.result.added);
'<div class="freebase-loading-tripleloader-message">' + self._elmts.refineryLink.attr("href", get_refinery_url(data.result.status_url));
'<h2><span>' + data.result.added + '</span> triples successfully scheduled for loading</h2>' + self._elmts.functionalCase.hide();
'<h4>Follow the loading progress in the <a href="' + get_refinery_url(data.result.status_url) + '" target="_new">Freebase Refinery</a></h4>' + self._elmts.loadedCase.show();
'</div>'
);
self._end(); self._end();
} else { } else {
self._show_error("Error loading data",data); self._show_error("Error loading data",data);
@ -229,25 +225,22 @@ FreebaseLoadingDialog.prototype._dismiss = function() {
}; };
FreebaseLoadingDialog.prototype._show_error = function(msg, error) { FreebaseLoadingDialog.prototype._show_error = function(msg, error) {
console.log(error); this._elmts.dialogBody.children().hide();
var self = this; this._elmts.errorCase.show();
var body = self._elmts.dialogBody; this._elmts.errorMessage.text(msg);
body.html( this._elmts.errorDetails.html(
'<div class="freebase-loading-tripleloader-message">' + (('message' in error) ? '<p>' + error.message + '</p>' : '<pre>' + JSON.stringify(error, null, 2) + '</pre>') +
'<h2>' + msg + '</h2>' + (('stack' in error) ? '<pre>' + error.stack.replace(/\\n/g,'\n').replace(/\\t/g,'\t') + '</pre>' : "")
(('message' in error) ? '<p>' + error.message + '</p>' : '<pre>' + JSON.stringify(error, null, 2) + '</pre>') +
(('stack' in error) ? '<pre>' + error.stack.replace(/\\n/g,'\n').replace(/\\t/g,'\t') + '</pre>' : "") +
'</div>'
); );
this._end(); this._end();
console.log(error);
}; };
FreebaseLoadingDialog.prototype._end = function() { FreebaseLoadingDialog.prototype._end = function() {
var self = this; var self = this;
self._elmts.loadButton.text("Close").removeAttr("disabled").unbind().click(function() { this._elmts.loadButton.text("Close").removeAttr("disabled").removeClass("button-disabled").unbind().click(function() {
self._dismiss(); self._dismiss();
}); });
self._elmts.cancelButton.hide(); this._elmts.cancelButton.hide();
self._elmts.qaCheckboxContainer.hide(); this._elmts.authorization.hide();
self._elmts.authorization.hide();
}; };

View File

@ -166,6 +166,11 @@ SchemaAlignment.createNewRootNode = function() {
function SchemaAlignmentDialog(protograph, onDone) { function SchemaAlignmentDialog(protograph, onDone) {
this._onDone = onDone; this._onDone = onDone;
this._createDialog();
this._reset(protograph);
}
SchemaAlignmentDialog.prototype._reset = function(protograph) {
this._originalProtograph = protograph || { rootNodes: [] }; this._originalProtograph = protograph || { rootNodes: [] };
this._protograph = cloneDeep(this._originalProtograph); // this is what can be munched on this._protograph = cloneDeep(this._originalProtograph); // this is what can be munched on
@ -173,94 +178,9 @@ function SchemaAlignmentDialog(protograph, onDone) {
this._protograph.rootNodes.push(SchemaAlignment.createNewRootNode()); this._protograph.rootNodes.push(SchemaAlignment.createNewRootNode());
} }
$(this._nodeTable).empty();
this._nodeUIs = []; this._nodeUIs = [];
this._createDialog();
this.preview();
}
SchemaAlignmentDialog.prototype._createDialog = function() {
var self = this;
var frame = DialogSystem.createDialog();
frame.width("800px");
var header = $('<div></div>').addClass("dialog-header").text("Schema Alignment").appendTo(frame);
var body = $('<div></div>').addClass("dialog-body").appendTo(frame);
var footer = $('<div></div>').addClass("dialog-footer").appendTo(frame);
this._constructFooter(footer);
this._constructBody(body);
this._level = DialogSystem.showDialog(frame);
this._renderBody(body);
};
SchemaAlignmentDialog.prototype._constructFooter = function(footer) {
var self = this;
$('<button class="button"></button>').html("&nbsp;&nbsp;OK&nbsp;&nbsp;").click(function() {
var protograph = self.getJSON();
Refine.postProcess(
"freebase",
"save-protograph",
{},
{ protograph: JSON.stringify(protograph) },
{},
{
onDone: function() {
DialogSystem.dismissUntil(self._level - 1);
theProject.overlayModels.freebaseProtograph = protograph;
}
}
);
}).appendTo(footer);
$('<button class="button"></button>').text("Cancel").click(function() {
DialogSystem.dismissUntil(self._level - 1);
}).appendTo(footer);
};
SchemaAlignmentDialog.prototype._constructBody = function(body) {
$('<p>' +
'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 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.' +
'</p>').appendTo(body);
$(
'<div id="schema-alignment-tabs" class="refine-tabs">' +
'<ul>' +
'<li><a href="#schema-alignment-tabs-protograph">Skeleton</a></li>' +
'<li><a href="#schema-alignment-tabs-preview-mqllike">MQL-like Preview</a></li>' +
'<li><a href="#schema-alignment-tabs-preview-tripleloader">TripleLoader Preview</a></li>' +
'</ul>' +
'<div id="schema-alignment-tabs-protograph">' +
'<div class="schema-alignment-dialog-canvas"></div>' +
'</div>' +
'<div id="schema-alignment-tabs-preview-mqllike" style="display: none;">' +
'<div class="schema-alignment-dialog-preview"></div>' +
'</div>' +
'<div id="schema-alignment-tabs-preview-tripleloader" style="display: none;">' +
'<div class="schema-alignment-dialog-preview"></div>' +
'</div>' +
'</div>'
).appendTo(body);
};
SchemaAlignmentDialog.prototype._renderBody = function(body) {
var self = this;
$("#schema-alignment-tabs").tabs();
$("#schema-alignment-tabs-preview-mqllike").css("display", "");
$("#schema-alignment-tabs-preview-tripleloader").css("display", "");
this._canvas = $(".schema-alignment-dialog-canvas");
this._nodeTable = $('<table></table>').addClass("schema-alignment-table-layout").appendTo(this._canvas)[0];
for (var i = 0; i < this._protograph.rootNodes.length; i++) { for (var i = 0; i < this._protograph.rootNodes.length; i++) {
this._nodeUIs.push(new SchemaAlignmentDialog.UINode( this._nodeUIs.push(new SchemaAlignmentDialog.UINode(
this, this,
@ -273,7 +193,60 @@ SchemaAlignmentDialog.prototype._renderBody = function(body) {
)); ));
} }
this.preview();
};
SchemaAlignmentDialog.prototype._save = function(onDone) {
var protograph = this.getJSON();
Refine.postProcess(
"freebase",
"save-protograph",
{},
{ protograph: JSON.stringify(protograph) },
{},
{
onDone: function() {
theProject.overlayModels.freebaseProtograph = protograph;
onDone();
}
}
);
};
SchemaAlignmentDialog.prototype._createDialog = function() {
var self = this;
var frame = $(DOM.loadHTML("freebase", "scripts/dialogs/schema-alignment/schema-alignment-dialog.html"));
var elmts = DOM.bind(frame);
this._level = DialogSystem.showDialog(frame);
var dismiss = function() {
DialogSystem.dismissUntil(self._level - 1);
};
elmts.saveAndCloseButton.click(function() {
self._save(dismiss);
});
elmts.saveAndLoadButton.click(function() {
self._save(function() {
dismiss();
FreebaseExtension.handlers.loadIntoFreebase();
});
});
elmts.resetButton.click(function() {
self._reset(null);
});
elmts.cancelButton.click(dismiss);
$("#schema-alignment-tabs").tabs();
$("#schema-alignment-tabs-preview-mqllike").css("display", "");
$("#schema-alignment-tabs-preview-tripleloader").css("display", "");
this._previewPanes = $(".schema-alignment-dialog-preview"); this._previewPanes = $(".schema-alignment-dialog-preview");
this._canvas = $(".schema-alignment-dialog-canvas");
this._nodeTable = $('<table></table>').addClass("schema-alignment-table-layout").appendTo(this._canvas)[0];
}; };
SchemaAlignmentDialog.prototype.getJSON = function() { SchemaAlignmentDialog.prototype.getJSON = function() {

View File

@ -0,0 +1,38 @@
<div class="dialog-frame" style="width: 800px;">
<div class="dialog-header" bind="dialogHeader">Align to Freebase's Schemas</div>
<div class="dialog-body" bind="dialogBody">
<p class="body-text">
The schema alignment skeleton below specifies how the graph-shaped data 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 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.
</p>
<div id="schema-alignment-tabs" class="refine-tabs">
<ul>
<li><a href="#schema-alignment-tabs-protograph">Skeleton</a></li>
<li><a href="#schema-alignment-tabs-preview-mqllike">MQL-like Preview</a></li>
<li><a href="#schema-alignment-tabs-preview-tripleloader">TripleLoader Preview</a></li>
</ul>
<div id="schema-alignment-tabs-protograph">
<div class="schema-alignment-dialog-canvas"></div>
</div>
<div id="schema-alignment-tabs-preview-mqllike" style="display: none;">
<div class="schema-alignment-dialog-preview"></div>
</div>
<div id="schema-alignment-tabs-preview-tripleloader" style="display: none;">
<div class="schema-alignment-dialog-preview"></div>
</div>
</div>
</div>
<div class="dialog-footer" bind="dialogFooter"><div class="grid-layout layout-normal layout-full"><table><tr>
<td>
<button class="button" bind="cancelButton">Cancel</button>
<button class="button" bind="resetButton">Reset</button>
</td>
<td style="text-align:right;">
<button class="button button-primary" bind="saveAndCloseButton">Save &amp; Close</button>
<button class="button" bind="saveAndLoadButton">Save &amp; Load</button>
</td>
</tr></table></div></div>
</div>

View File

@ -33,9 +33,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
var FreebaseExtension = { handlers: {} }; var FreebaseExtension = { handlers: {} };
FreebaseExtension.handlers.editSchemaAlignment = function(reset) { FreebaseExtension.handlers.editSchemaAlignment = function() {
new SchemaAlignmentDialog( new SchemaAlignmentDialog(theProject.overlayModels.freebaseProtograph, function(newProtograph) {});
reset ? null : theProject.overlayModels.freebaseProtograph, function(newProtograph) {});
}; };
FreebaseExtension.handlers.loadIntoFreebase = function() { FreebaseExtension.handlers.loadIntoFreebase = function() {
@ -87,20 +86,15 @@ ExtensionBar.addExtensionMenu({
"submenu" : [ "submenu" : [
{ {
"id" : "freebase/schema-alignment", "id" : "freebase/schema-alignment",
label: "Edit schema aligment skeleton...", label: "Align to Freebase's schemas...",
click: function() { FreebaseExtension.handlers.editSchemaAlignment(false); } click: function() { FreebaseExtension.handlers.editSchemaAlignment(false); }
}, },
{
"id" : "freebase/reset-schema-alignment",
label: "Reset schema alignment skeleton...",
click: function() { FreebaseExtension.handlers.editSchemaAlignment(true); }
},
{},
{ {
"id" : "freebase/load-info-freebase", "id" : "freebase/load-info-freebase",
label: "Load into Freebase...", label: "Load into Freebase...",
click: function() { FreebaseExtension.handlers.loadIntoFreebase(); } click: function() { FreebaseExtension.handlers.loadIntoFreebase(); }
}, },
{},
{ {
"id" : "freebase/browse-load", "id" : "freebase/browse-load",
label: "Browse data load details...", label: "Browse data load details...",

View File

@ -33,10 +33,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@import-less url("../theme.less"); @import-less url("../theme.less");
.freebase-loading-dialog-functional-tab-panel {
height: 400px !important;
}
.freebase-loading-tripleloader-data { .freebase-loading-tripleloader-data {
height: 375px;
width: 99%; width: 99%;
overflow: auto; overflow: scroll;
border: 1px solid #aaa; border: 1px solid #aaa;
white-space: pre; white-space: pre;
padding: 0.3em 0.5em 0.5em 0.5em; padding: 0.3em 0.5em 0.5em 0.5em;
@ -44,50 +46,47 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
} }
.freebase-loading-tripleloader-message { .freebase-loading-tripleloader-message {
height: 500px; height: 400px;
overflow: auto; overflow: auto;
border: 1px solid #aaa; border: 1px solid #aaa;
padding: 0.3em 0.5em 0.5em 0.5em; padding: 1em;
} }
.freebase-loading-tripleloader-message h2 { .freebase-loading-tripleloader-message h2 {
text-align: center; font-size: 150%;
font-size: 150%; font-weight: normal;
margin-top: 3em;
font-weight: normal;
} }
.freebase-loading-tripleloader-message h2 span { .freebase-loading-tripleloader-message h2 span {
font-size; 130%; font-size; 130%;
font-weight: bold; font-weight: bold;
} }
.freebase-loading-tripleloader-message h4 { .freebase-loading-tripleloader-message h4 {
text-align: center; font-size: 120%;
font-size: 120%; margin-top: 2em;
margin-top: 2em; font-weight: normal;
font-weight: normal;
} }
.freebase-loading-tripleloader-message a { .freebase-loading-tripleloader-message a {
font-size: 120%; font-size: 120%;
font-weight: bold; font-weight: bold;
} }
.freebase-loading-authorization { .freebase-loading-authorization {
margin: 0em 2em; margin: 0em 2em;
padding: 0.6em 0.8em; padding: 0.6em 0.8em;
border: 1px solid #ccc; border: 1px solid #ccc;
background-color: #fff; background-color: #fff;
-moz-border-radius: 0.8em; -moz-border-radius: 0.8em;
-webkit-border-radius: 0.8em; -webkit-border-radius: 0.8em;
} }
.freebase-loading-tripleloader-info { .freebase-loading-tripleloader-info {
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
.freebase-loading-tripleloader-info textarea { .freebase-loading-tripleloader-info textarea {
width: 99%; width: 99%;
height: 5em; height: 5em;
} }

View File

@ -190,7 +190,7 @@ public class StandardReconConfig extends ReconConfig {
@Override @Override
public int getBatchSize() { public int getBatchSize() {
return 3; return 10;
} }
@Override @Override

View File

@ -1,43 +1,52 @@
<div class="dialog-frame" style="width: 900px;"> <div class="dialog-frame" style="width: 1000px;">
<div class="dialog-header" bind="dialogHeader"></div> <div class="dialog-header" bind="dialogHeader"></div>
<div class="dialog-body" bind="dialogBody"> <div class="dialog-body" bind="dialogBody">
<div class="grid-layout layout-normal layout-full"><table> <div class="grid-layout layout-normal layout-full"><table>
<tr>
<td colspan="4">
This feature helps you find groups of different cell values that might be
alternative representations of the same thing. For example, the two strings
"New York" and "new york" are very likely to refer to the same concept and
just have capitalization differences, and "Gödel" and "Godel" probably refer
to the same person.
<a href="http://code.google.com/p/google-refine/wiki/Clustering" target="_blank">Find out more ...</a>
</td>
</tr>
<tr> <tr>
<td> <td>
Method: Method&nbsp;<select bind="methodSelector">
<select bind="methodSelector">
<option selected="true">key collision</option> <option selected="true">key collision</option>
<option>nearest neighbor</option> <option>nearest neighbor</option>
</select> </select>
</td> </td>
<td> <td>
<div class="binning-controls">Keying Function: <select bind="keyingFunctionSelector"> <div class="binning-controls">Keying&nbsp;Function&nbsp;<select bind="keyingFunctionSelector">
<option selected="true">fingerprint</option> <option selected="true">fingerprint</option>
<option>ngram-fingerprint</option> <option>ngram-fingerprint</option>
<option>double-metaphone</option> <option>double-metaphone</option>
</select></div> </select></div>
<div class="knn-controls hidden">Distance Function: <select bind="distanceFunctionSelector"> <div class="knn-controls hidden">Distance&nbsp;Function&nbsp;<select bind="distanceFunctionSelector">
<option selected="true">levenshtein</option> <option selected="true">levenshtein</option>
<option>PPM</option> <option>PPM</option>
</select></div> </select></div>
</td> </td>
<td> <td>
<div id="ngram-fingerprint-params" class="function-params hidden"> <div id="ngram-fingerprint-params" class="function-params hidden">
'Ngram Size: <input type="text" value="2" bind="ngramSize" name="ngram-size" size="3" class="param" datatype="int"> Ngram&nbsp;Size&nbsp;<input type="text" value="2" bind="ngramSize" name="ngram-size" size="2" class="param" datatype="int">
</div> </div>
<div class="knn-controls hidden"> <div class="knn-controls hidden">
<span style="margin-right: 1em">Radius: <input type="text" value="1.0" bind="radius" name="radius" size="3" class="param" datatype="float"></span> <span style="margin-right: 1em">Radius&nbsp;<input type="text" value="1.0" bind="radius" name="radius" size="2" class="param" datatype="float"></span>
<span>Block Chars: <input type="text" value="6" bind="ngramBlock" name="blocking-ngram-size" size="3" class="param" datatype="int"></span> <span>Block&nbsp;Chars&nbsp;<input type="text" value="6" bind="ngramBlock" name="blocking-ngram-size" size="2" class="param" datatype="int"></span>
</div> </div>
</td> </td>
<td bind="resultSummary" align="right"> <td bind="resultSummary" style="text-align:right;">
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="3"> <td colspan="3">
<div bind="tableContainer" class="clustering-dialog-table-container"></div> <div bind="tableContainer" class="clustering-dialog-table-container"></div>
</td> </td>
<td bind="facetContainer" width="200"></td> <td colspan="1" bind="facetContainer" width="250"></td>
</tr> </tr>
</table></div> </table></div>
</div> </div>
@ -48,8 +57,8 @@
<button class="button" bind="deselectAllButton">Deselect All</button> <button class="button" bind="deselectAllButton">Deselect All</button>
</td> </td>
<td class="right" style="text-align: right"> <td class="right" style="text-align: right">
<button class="button" bind="applyReClusterButton">Apply &amp; Re-Cluster</button> <button class="button button-primary" bind="applyReClusterButton">Merge Selected &amp; Re-Cluster</button>
<button class="button" bind="applyCloseButton">Apply &amp; Close</button> <button class="button" bind="applyCloseButton">Merge Selected &amp; Close</button>
<button class="button" bind="closeButton">Close</button> <button class="button" bind="closeButton">Close</button>
</td> </td>
</tr></table> </tr></table>

View File

@ -386,10 +386,10 @@ ClusteringDialog.prototype._resetFacets = function() {
} }
this._facets = []; this._facets = [];
this._createFacet("Cluster Size", "size"); this._createFacet("# Choices in Cluster", "size");
this._createFacet("Row Count", "rowCount"); this._createFacet("# Rows in Cluster", "rowCount");
this._createFacet("Value Length Average", "avg"); this._createFacet("Average Length of Choices", "avg");
this._createFacet("Value Length Variance", "variance"); this._createFacet("Length Variance of Choices", "variance");
}; };
ClusteringDialog.prototype._createFacet = function(title, property) { ClusteringDialog.prototype._createFacet = function(title, property) {

View File

@ -214,7 +214,7 @@ ReconDialog.prototype._onAddNamespacedService = function() {
var namespaceData = elmts.namespaceInput.data("data.suggest"); var namespaceData = elmts.namespaceInput.data("data.suggest");
var typeData = elmts.typeInput.data("data.suggest"); var typeData = elmts.typeInput.data("data.suggest");
if (namespaceData) { if (namespaceData) {
var url = "http://2.standard-reconcile.dfhuynh.user.dev.freebaseapps.com/namespace_reconcile?namespace=" + var url = "http://4.standard-reconcile.dfhuynh.user.dev.freebaseapps.com/namespace_reconcile?namespace=" +
escape(namespaceData.id); escape(namespaceData.id);
if (typeData) { if (typeData) {
url += "&type=" + typeData.id; url += "&type=" + typeData.id;

View File

@ -150,7 +150,7 @@ ReconciliationManager.save = function(f) {
ReconciliationManager._rebuildMap(); ReconciliationManager._rebuildMap();
} else { } else {
ReconciliationManager.registerStandardService( ReconciliationManager.registerStandardService(
"http://3.standard-reconcile.dfhuynh.user.dev.freebaseapps.com/reconcile"); "http://4.standard-reconcile.dfhuynh.user.dev.freebaseapps.com/reconcile");
} }
}, },
dataType: "json" dataType: "json"

View File

@ -196,10 +196,9 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) {
ui.browsingEngine.addFacet( ui.browsingEngine.addFacet(
"list", "list",
{ {
"name" : column.name, "name" : column.name + ": judgment",
"columnName" : column.name, "columnName" : column.name,
"expression" : "cell.recon.judgment", "expression" : 'forNonBlank(cell.recon.judgment, v, v, if(isNonBlank(value), "(unreconciled)", "(blank)"))'
"omitError" : true
}, },
{ {
"scroll" : false "scroll" : false
@ -215,7 +214,7 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) {
ui.browsingEngine.addFacet( ui.browsingEngine.addFacet(
"range", "range",
{ {
"name" : column.name, "name" : column.name + ": best candidate's score",
"columnName" : column.name, "columnName" : column.name,
"expression" : "cell.recon.best.score", "expression" : "cell.recon.best.score",
"mode" : "range" "mode" : "range"
@ -232,10 +231,9 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) {
ui.browsingEngine.addFacet( ui.browsingEngine.addFacet(
"list", "list",
{ {
"name" : column.name, "name" : column.name + ": best candidate's types match?",
"columnName" : column.name, "columnName" : column.name,
"expression" : "cell.recon.features.typeMatch", "expression" : 'forNonBlank(cell.recon.features.typeMatch, v, v, if(isNonBlank(value), "(unreconciled)", "(blank)"))'
"omitError" : true
}, },
{ {
"scroll" : false "scroll" : false
@ -250,10 +248,9 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) {
ui.browsingEngine.addFacet( ui.browsingEngine.addFacet(
"list", "list",
{ {
"name" : column.name, "name" : column.name + ": best candidate's name match?",
"columnName" : column.name, "columnName" : column.name,
"expression" : "cell.recon.features.nameMatch", "expression" : 'forNonBlank(cell.recon.features.nameMatch, v, v, if(isNonBlank(value), "(unreconciled)", "(blank)"))'
"omitError" : true
}, },
{ {
"scroll" : false "scroll" : false
@ -269,7 +266,7 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) {
ui.browsingEngine.addFacet( ui.browsingEngine.addFacet(
"range", "range",
{ {
"name" : column.name, "name" : column.name + ": best candidate's name edit distance",
"columnName" : column.name, "columnName" : column.name,
"expression" : "cell.recon.features.nameLevenshtein", "expression" : "cell.recon.features.nameLevenshtein",
"mode" : "range" "mode" : "range"
@ -286,7 +283,7 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) {
ui.browsingEngine.addFacet( ui.browsingEngine.addFacet(
"range", "range",
{ {
"name" : column.name, "name" : column.name + ": best candidate's name word similarity",
"columnName" : column.name, "columnName" : column.name,
"expression" : "cell.recon.features.nameWordDistance", "expression" : "cell.recon.features.nameWordDistance",
"mode" : "range" "mode" : "range"
@ -304,10 +301,9 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) {
ui.browsingEngine.addFacet( ui.browsingEngine.addFacet(
"list", "list",
{ {
"name" : column.name, "name" : column.name + ": best candidate's types",
"columnName" : column.name, "columnName" : column.name,
"expression" : "cell.recon.best.type", "expression" : 'forNonBlank(cell.recon.best.type, v, v, if(isNonBlank(value), "(unreconciled)", "(blank)"))'
"omitError" : true
} }
); );
} }

View File

@ -139,7 +139,7 @@ a img {
.sharp_corners_right(); .sharp_corners_right();
} }
.button-disabled, a.button-disabled { .button-disabled, a.button-disabled, .button.button-disabled, a.button.button-disabled {
color: #666; color: #666;
border: 1px solid #ddd; border: 1px solid #ddd;
background: #f3f3f3; background: #f3f3f3;
@ -399,3 +399,7 @@ img {
font-family: inherit; font-family: inherit;
font-size: inherit; font-size: inherit;
} }
p.body-text {
margin-bottom: 1em;
}

View File

@ -34,7 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@import-less url("../theme.less"); @import-less url("../theme.less");
.clustering-dialog-table-container { .clustering-dialog-table-container {
height: 500px; height: 450px;
overflow: auto; overflow: auto;
border: 1px solid #aaa; border: 1px solid #aaa;
} }

View File

@ -96,8 +96,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.ui-tabs .ui-tabs-panel { .ui-tabs .ui-tabs-panel {
margin: 0; margin: 0;
padding: 0; padding: @padding_normal;
border-top: 1px solid @chrome_primary; border: 1px solid @chrome_primary;
background: white; background: white;
} }

View File

@ -80,6 +80,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
font-size: 1.3em; font-size: 1.3em;
background: @chrome_secondary; background: @chrome_secondary;
} }
#left-panel .ui-tabs .ui-tabs-panel {
border-left: none;
border-right: none;
border-bottom: none;
padding: 0;
}
#right-panel { #right-panel {
position: fixed; position: fixed;

View File

@ -41,4 +41,4 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
background: -webkit-gradient(linear, left top, left bottom, from(#e3e3e3), to(#f9f9f9)); background: -webkit-gradient(linear, left top, left bottom, from(#e3e3e3), to(#f9f9f9));
background: -moz-linear-gradient(top, #e3e3e3, #f9f9f9); background: -moz-linear-gradient(top, #e3e3e3, #f9f9f9);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e3e3e3', endColorstr='#f9f9f9'); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e3e3e3', endColorstr='#f9f9f9');
} }