Remove various references to Freebase, where I'm confident
This commit is contained in:
parent
5d8d372244
commit
aaf8f93c04
@ -69,7 +69,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
OpenRefine is a power tool for working with messy data. Use it to improve data consistency,
|
OpenRefine is a power tool for working with messy data. Use it to improve data consistency,
|
||||||
link it to data registries like Freebase, augment it with data from other sources, transform it
|
link it to data registries like Wikidata, augment it with data from other sources, transform it
|
||||||
into different formats for other tools to consume, and contribute it to back to the original
|
into different formats for other tools to consume, and contribute it to back to the original
|
||||||
sources. OpenRefine is not a web service but a desktop app that runs on your own computer,
|
sources. OpenRefine is not a web service but a desktop app that runs on your own computer,
|
||||||
so you can process sensitive data with privacy.
|
so you can process sensitive data with privacy.
|
||||||
|
@ -1,141 +0,0 @@
|
|||||||
/*
|
|
||||||
|
|
||||||
Copyright 2010, Google Inc.
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are
|
|
||||||
met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above
|
|
||||||
copyright notice, this list of conditions and the following disclaimer
|
|
||||||
in the documentation and/or other materials provided with the
|
|
||||||
distribution.
|
|
||||||
* Neither the name of Google Inc. nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived from
|
|
||||||
this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
function ReconFreebaseQueryPanel(column, service, container) {
|
|
||||||
this._column = column;
|
|
||||||
this._service = service;
|
|
||||||
this._container = container;
|
|
||||||
|
|
||||||
this._constructUI();
|
|
||||||
}
|
|
||||||
|
|
||||||
ReconFreebaseQueryPanel.prototype.activate = function() {
|
|
||||||
this._panel.show();
|
|
||||||
};
|
|
||||||
|
|
||||||
ReconFreebaseQueryPanel.prototype.deactivate = function() {
|
|
||||||
this._panel.hide();
|
|
||||||
};
|
|
||||||
|
|
||||||
ReconFreebaseQueryPanel.prototype.dispose = function() {
|
|
||||||
this._panel.remove();
|
|
||||||
this._panel = null;
|
|
||||||
|
|
||||||
this._column = null;
|
|
||||||
this._service = null;
|
|
||||||
this._container = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
ReconFreebaseQueryPanel.prototype._constructUI = function() {
|
|
||||||
var self = this;
|
|
||||||
this._panel = $(DOM.loadHTML("core", "scripts/reconciliation/freebase-query-panel.html")).appendTo(this._container);
|
|
||||||
this._elmts = DOM.bind(this._panel);
|
|
||||||
|
|
||||||
this._elmts.or_recon_contain.html($.i18n._('core-recon')["cell-contains"]);
|
|
||||||
this._elmts.or_recon_fbId.html($.i18n._('core-recon')["fb-id"]);
|
|
||||||
this._elmts.or_recon_fbGuid.html($.i18n._('core-recon')["fb-guid"]);
|
|
||||||
this._elmts.or_recon_fbKey.html($.i18n._('core-recon')["fb-key"]);
|
|
||||||
this._elmts.or_recon_fbEnNs.html($.i18n._('core-recon')["fb-en-ns"]);
|
|
||||||
this._elmts.or_recon_thisNs.html($.i18n._('core-recon')["this-ns"]);
|
|
||||||
|
|
||||||
this._wireEvents();
|
|
||||||
};
|
|
||||||
|
|
||||||
ReconFreebaseQueryPanel.prototype._wireEvents = function() {
|
|
||||||
var self = this;
|
|
||||||
this._elmts.strictNamespaceInput
|
|
||||||
.suggest({ filter : '(all type:/type/namespace)' })
|
|
||||||
.bind("fb-select", function(e, data) {
|
|
||||||
self._panel.find('input[name="recon-dialog-strict-choice"][value="key"]').attr("checked", "true");
|
|
||||||
self._panel.find('input[name="recon-dialog-strict-namespace-choice"][value="other"]').attr("checked", "true");
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
ReconFreebaseQueryPanel.prototype.start = function() {
|
|
||||||
var bodyParams;
|
|
||||||
|
|
||||||
var match = $('input[name="recon-dialog-strict-choice"]:checked')[0].value;
|
|
||||||
if (match == "key") {
|
|
||||||
var namespaceChoice = $('input[name="recon-dialog-strict-namespace-choice"]:checked')[0];
|
|
||||||
var namespace;
|
|
||||||
|
|
||||||
if (namespaceChoice.value == "other") {
|
|
||||||
var suggest = this._elmts.strictNamespaceInput.data("data.suggest");
|
|
||||||
if (!suggest) {
|
|
||||||
alert($.i18n._('core-recon')["specify-ns"]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
namespace = {
|
|
||||||
id: suggest.id,
|
|
||||||
name: suggest.name
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
namespace = {
|
|
||||||
id: namespaceChoice.value,
|
|
||||||
name: namespaceChoice.getAttribute("nsName")
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
bodyParams = {
|
|
||||||
columnName: this._column.name,
|
|
||||||
config: JSON.stringify({
|
|
||||||
mode: "freebase/strict",
|
|
||||||
match: "key",
|
|
||||||
namespace: namespace
|
|
||||||
})
|
|
||||||
};
|
|
||||||
} else if (match == "id") {
|
|
||||||
bodyParams = {
|
|
||||||
columnName: this._column.name,
|
|
||||||
config: JSON.stringify({
|
|
||||||
mode: "freebase/strict",
|
|
||||||
match: "id"
|
|
||||||
})
|
|
||||||
};
|
|
||||||
} else if (match == "guid") {
|
|
||||||
bodyParams = {
|
|
||||||
columnName: this._column.name,
|
|
||||||
config: JSON.stringify({
|
|
||||||
mode: "freebase/strict",
|
|
||||||
match: "guid"
|
|
||||||
})
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
Refine.postCoreProcess(
|
|
||||||
"reconcile",
|
|
||||||
{},
|
|
||||||
bodyParams,
|
|
||||||
{ cellsChanged: true, columnStatsChanged: true }
|
|
||||||
);
|
|
||||||
};
|
|
@ -269,4 +269,4 @@ ReconDialog.prototype._onAddNamespacedService = function() {
|
|||||||
dismiss();
|
dismiss();
|
||||||
});
|
});
|
||||||
elmts.namespaceInput.focus().data("suggest").textchange();
|
elmts.namespaceInput.focus().data("suggest").textchange();
|
||||||
};
|
};
|
||||||
|
@ -37,18 +37,6 @@ var ReconciliationManager = {
|
|||||||
_urlMap : {}
|
_urlMap : {}
|
||||||
};
|
};
|
||||||
|
|
||||||
ReconciliationManager.isFreebaseId = function(s) {
|
|
||||||
return s == "http://rdf.freebase.com/ns/type.object.id";
|
|
||||||
};
|
|
||||||
|
|
||||||
ReconciliationManager.isFreebaseMid = function(s) {
|
|
||||||
return s == "http://rdf.freebase.com/ns/type.object.mid";
|
|
||||||
};
|
|
||||||
|
|
||||||
ReconciliationManager.isFreebaseIdOrMid = function(s) {
|
|
||||||
return ReconciliationManager.isFreebaseMid(s) || ReconciliationManager.isFreebaseId(s);
|
|
||||||
};
|
|
||||||
|
|
||||||
ReconciliationManager._rebuildMap = function() {
|
ReconciliationManager._rebuildMap = function() {
|
||||||
var map = {};
|
var map = {};
|
||||||
$.each(ReconciliationManager.getAllServices(), function(i, service) {
|
$.each(ReconciliationManager.getAllServices(), function(i, service) {
|
||||||
|
@ -222,8 +222,6 @@ ReconStandardServicePanel.prototype._wireEvents = function() {
|
|||||||
suggestOptions.key = null;
|
suggestOptions.key = null;
|
||||||
suggestOptions.query_param_name = "prefix";
|
suggestOptions.query_param_name = "prefix";
|
||||||
input.suggestT(suggestOptions);
|
input.suggestT(suggestOptions);
|
||||||
} else if (this._isInFreebaseSchemaSpace()) {
|
|
||||||
input.suggestT({ filter : '(all type:/type/type)' });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
input.bind("fb-select", function(e, data) {
|
input.bind("fb-select", function(e, data) {
|
||||||
@ -251,22 +249,9 @@ ReconStandardServicePanel.prototype._rewirePropertySuggests = function(type) {
|
|||||||
suggestOptions.ac_param = { schema: typeof type == "string" ? type : type.id };
|
suggestOptions.ac_param = { schema: typeof type == "string" ? type : type.id };
|
||||||
}
|
}
|
||||||
inputs.suggestP(suggestOptions);
|
inputs.suggestP(suggestOptions);
|
||||||
} else if (this._isInFreebaseSchemaSpace()) {
|
|
||||||
var namespace = (type) ? (typeof type == "string" ? type : type.id) : "/common/topic"
|
|
||||||
inputs.suggestP({
|
|
||||||
filter : '(should (any namespace:/type/object namespace:' + namespace + '))'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ReconStandardServicePanel.prototype._isInFreebaseIdentifierSpace = function() {
|
|
||||||
return ReconciliationManager.isFreebaseIdOrMid(this._service.identifierSpace);
|
|
||||||
};
|
|
||||||
|
|
||||||
ReconStandardServicePanel.prototype._isInFreebaseSchemaSpace = function() {
|
|
||||||
return ReconciliationManager.isFreebaseId(this._service.schemaSpace);
|
|
||||||
};
|
|
||||||
|
|
||||||
ReconStandardServicePanel.prototype.start = function() {
|
ReconStandardServicePanel.prototype.start = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
@ -33,16 +33,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
var CustomSuggest = {};
|
var CustomSuggest = {};
|
||||||
|
|
||||||
// Default API key for Refine to use for freebase suggest widget
|
|
||||||
//CustomSuggest.setFreebaseAPIKey("AIzaSyBBTAtJ31v_jlg_ImbQuBNnAaAyrHzRyW8"); // Google key
|
|
||||||
CustomSuggest.FREEBASE_API_KEY = "AIzaSyBAZ_EjMPKlOzyyZXv6JKXPPwJFISVji3M"; // OpenRefine default key
|
|
||||||
|
|
||||||
CustomSuggest.setFreebaseAPIKey = function(freebaseAPIKey) {
|
|
||||||
$.suggest.suggest.defaults.key = freebaseAPIKey;
|
|
||||||
$.suggest.suggestT.defaults.key = freebaseAPIKey;
|
|
||||||
$.suggest.suggestP.defaults.key = freebaseAPIKey;
|
|
||||||
};
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -168,18 +158,4 @@ CustomSuggest.setFreebaseAPIKey = function(freebaseAPIKey) {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// Use Freebase API Key
|
})();
|
||||||
$.ajax("command/core/get-preference",
|
|
||||||
{
|
|
||||||
async: false,
|
|
||||||
data: {name: "freebase.api.key"},
|
|
||||||
success: function(data) {
|
|
||||||
if (data.value && data.value != "null") {
|
|
||||||
CustomSuggest.setFreebaseAPIKey(data.value);
|
|
||||||
} else {
|
|
||||||
CustomSuggest.setFreebaseAPIKey(CustomSuggest.FREEBASE_API_KEY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
})();
|
|
||||||
|
@ -106,8 +106,6 @@ DataTableCellUI.prototype._render = function() {
|
|||||||
|
|
||||||
if (service && (service.view) && (service.view.url)) {
|
if (service && (service.view) && (service.view.url)) {
|
||||||
a.attr("href", encodeURI(service.view.url.replace("{{id}}", match.id)));
|
a.attr("href", encodeURI(service.view.url.replace("{{id}}", match.id)));
|
||||||
} else if (ReconciliationManager.isFreebaseIdOrMid(r.identifierSpace)) {
|
|
||||||
a.attr("href", "http://www.freebase.com/view" + match.id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$('<span> </span>').appendTo(divContent);
|
$('<span> </span>').appendTo(divContent);
|
||||||
@ -150,17 +148,13 @@ DataTableCellUI.prototype._render = function() {
|
|||||||
|
|
||||||
if ((service) && (service.view) && (service.view.url)) {
|
if ((service) && (service.view) && (service.view.url)) {
|
||||||
a.attr("href", encodeURI(service.view.url.replace("{{id}}", candidate.id)));
|
a.attr("href", encodeURI(service.view.url.replace("{{id}}", candidate.id)));
|
||||||
} else if (ReconciliationManager.isFreebaseIdOrMid(r.identifierSpace)) {
|
|
||||||
a.attr("href", "http://www.freebase.com/view" + candidate.id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var preview = null;
|
var preview = null;
|
||||||
if ((service) && (service.preview)
|
if ((service) && (service.preview)) {
|
||||||
&& service.preview.url.indexOf("http://www.freebase.com/widget/topic") < 0) {
|
|
||||||
preview = service.preview;
|
preview = service.preview;
|
||||||
} else if (ReconciliationManager.isFreebaseIdOrMid(r.identifierSpace)) {
|
|
||||||
preview = DataTableCellUI.internalPreview;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preview) {
|
if (preview) {
|
||||||
a.click(function(evt) {
|
a.click(function(evt) {
|
||||||
if (!evt.metaKey && !evt.ctrlKey) {
|
if (!evt.metaKey && !evt.ctrlKey) {
|
||||||
@ -207,8 +201,6 @@ DataTableCellUI.prototype._render = function() {
|
|||||||
if ((service) && (service.suggest) && (service.suggest.entity)) {
|
if ((service) && (service.suggest) && (service.suggest.entity)) {
|
||||||
suggestOptions = service.suggest.entity;
|
suggestOptions = service.suggest.entity;
|
||||||
addSuggest = true;
|
addSuggest = true;
|
||||||
} else if (ReconciliationManager.isFreebaseIdOrMid(r.identifierSpace)) {
|
|
||||||
addSuggest = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var extraChoices = $('<div>').addClass("data-table-recon-extra").appendTo(divContent);
|
var extraChoices = $('<div>').addClass("data-table-recon-extra").appendTo(divContent);
|
||||||
@ -436,6 +428,7 @@ DataTableCellUI.prototype._postProcessSeveralCells = function(command, params, b
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// TODO delete this
|
||||||
DataTableCellUI.internalPreview = {
|
DataTableCellUI.internalPreview = {
|
||||||
srchurl: 'https://www.googleapis.com/freebase/v1/search?filter=(all mid:${id})'
|
srchurl: 'https://www.googleapis.com/freebase/v1/search?filter=(all mid:${id})'
|
||||||
+ '&output=(notable:/client/summary (description citation provenance) type)'
|
+ '&output=(notable:/client/summary (description citation provenance) type)'
|
||||||
|
Loading…
Reference in New Issue
Block a user