diff --git a/main/src/com/metaweb/gridworks/commands/freebase/GuessTypesOfColumnCommand.java b/main/src/com/metaweb/gridworks/commands/freebase/GuessTypesOfColumnCommand.java index 8827a6a28..0cc6a3a95 100644 --- a/main/src/com/metaweb/gridworks/commands/freebase/GuessTypesOfColumnCommand.java +++ b/main/src/com/metaweb/gridworks/commands/freebase/GuessTypesOfColumnCommand.java @@ -20,6 +20,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.json.JSONArray; +import org.json.JSONException; import org.json.JSONObject; import org.json.JSONWriter; @@ -78,7 +79,7 @@ public class GuessTypesOfColumnCommand extends Command { } } - final static int s_sampleSize = 20; + final static int s_sampleSize = 10; /** * Run relevance searches for the first n cells in the given column and @@ -111,10 +112,9 @@ public class GuessTypesOfColumnCommand extends Command { } } + StringWriter stringWriter = new StringWriter(); try { - StringWriter stringWriter = new StringWriter(); JSONWriter jsonWriter = new JSONWriter(stringWriter); - jsonWriter.object(); for (int i = 0; i < samples.size(); i++) { jsonWriter.key("q" + i); @@ -126,8 +126,12 @@ public class GuessTypesOfColumnCommand extends Command { jsonWriter.endObject(); } jsonWriter.endObject(); - - String queriesString = stringWriter.toString(); + } catch (JSONException e) { + // ignore + } + + String queriesString = stringWriter.toString(); + try { URL url = new URL(serviceUrl); URLConnection connection = url.openConnection(); { @@ -201,7 +205,7 @@ public class GuessTypesOfColumnCommand extends Command { is.close(); } } catch (Exception e) { - e.printStackTrace(); + logger.error("Failed to guess cell types for load\n" + queriesString, e); } List types = new ArrayList(map.values()); diff --git a/main/src/com/metaweb/gridworks/model/recon/StandardReconConfig.java b/main/src/com/metaweb/gridworks/model/recon/StandardReconConfig.java index 47bd37f44..abf006c5e 100644 --- a/main/src/com/metaweb/gridworks/model/recon/StandardReconConfig.java +++ b/main/src/com/metaweb/gridworks/model/recon/StandardReconConfig.java @@ -330,6 +330,13 @@ public class StandardReconConfig extends ReconConfig { score ); + if (i == 0 && result.has("match") && result.getBoolean("match")) { + recon.match = candidate; + recon.matchRank = 0; + recon.judgment = Judgment.Matched; + recon.judgmentAction = "auto"; + } + recon.addCandidate(candidate); count++; } @@ -345,12 +352,6 @@ public class StandardReconConfig extends ReconConfig { for (String typeID : candidate.types) { if (this.typeID.equals(typeID)) { recon.setFeature(Recon.Feature_typeMatch, true); - if (autoMatch && candidate.score >= 100 && (count == 1 || candidate.score / recon.candidates.get(1).score >= 1.5)) { - recon.match = candidate; - recon.matchRank = 0; - recon.judgment = Judgment.Matched; - recon.judgmentAction = "auto"; - } break; } } diff --git a/main/webapp/modules/core/MOD-INF/controller.js b/main/webapp/modules/core/MOD-INF/controller.js index b20707ceb..3fc3b243c 100644 --- a/main/webapp/modules/core/MOD-INF/controller.js +++ b/main/webapp/modules/core/MOD-INF/controller.js @@ -102,12 +102,14 @@ function init() { "styles/views/data-table-view.css", "styles/dialogs/expression-preview-dialog.css", - "styles/dialogs/recon-dialog.css", "styles/dialogs/clustering-dialog.css", "styles/dialogs/scatterplot-dialog.css", "styles/dialogs/freebase-loading-dialog.css", "styles/dialogs/extend-data-preview-dialog.css", + "styles/reconciliation/recon-dialog.css", + "styles/reconciliation/standard-service-panel.css", + "styles/protograph/schema-alignment-dialog.css" ] ); diff --git a/main/webapp/modules/core/scripts/reconciliation/add-namespaced-service-dialog.html b/main/webapp/modules/core/scripts/reconciliation/add-namespaced-service-dialog.html new file mode 100644 index 000000000..39ce54813 --- /dev/null +++ b/main/webapp/modules/core/scripts/reconciliation/add-namespaced-service-dialog.html @@ -0,0 +1,13 @@ +
+
Add Namespaced Reconciliation Service
+
+ + + + +
Namespace:
Type of Entities (optional):
+ +
\ No newline at end of file diff --git a/main/webapp/modules/core/scripts/reconciliation/add-standard-service-dialog.html b/main/webapp/modules/core/scripts/reconciliation/add-standard-service-dialog.html new file mode 100644 index 000000000..cd0ae186a --- /dev/null +++ b/main/webapp/modules/core/scripts/reconciliation/add-standard-service-dialog.html @@ -0,0 +1,11 @@ +
+
Add Standard Reconciliation Service
+
+

Enter the service's URL:

+
+
+ +
\ No newline at end of file diff --git a/main/webapp/modules/core/scripts/reconciliation/recon-dialog.html b/main/webapp/modules/core/scripts/reconciliation/recon-dialog.html index 0e8f9a06a..376fc11a8 100644 --- a/main/webapp/modules/core/scripts/reconciliation/recon-dialog.html +++ b/main/webapp/modules/core/scripts/reconciliation/recon-dialog.html @@ -1,19 +1,25 @@
-
+
- +
-
Services and Extensions
-
- -
+
+ Pick a Service or Extension on Left +
+
-