Skip to content

Commit

Permalink
fixing vie2
Browse files Browse the repository at this point in the history
  • Loading branch information
Szaby Grünwald committed May 6, 2011
1 parent 7908a9e commit 6c79aeb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
12 changes: 7 additions & 5 deletions lib/vie2/connector/stanbol.js
Expand Up @@ -54,7 +54,8 @@ VIE2.connectors['stanbol'].analyze = function (object, options) {
'?relation fise:end ?end'],
['?entity a ?type',
'?entity fise:hasTextAnnotation ?relation',
'?entity fise:hasEntityAnnotation ?subject']);
'?entity fise:hasEntityAnnotation ?subject',
'?entity fise:selected-text ?selected-text']);

if (object === undefined) {
VIE2.log ("warn", "VIE2.Connector('" + this.id + "')", "Given object is undefined!");
Expand Down Expand Up @@ -112,15 +113,16 @@ VIE2.connectors['stanbol'].enhance = function (text, callback) {
callback(jQuery.rdf());
}
else {
var that = this;
var c = function(data) {
if (data) {
try {
var rdf = jQuery.rdf().load(data, {});
callback(rdf);
}
catch (e) {
VIE2.log("error", "VIE2.Connector(" + this.id + ")", "Could not connect to stanbol enhancer.");
VIE2.log("error", "VIE2.Connector(" + this.id + ")", data);
VIE2.log("error", "VIE2.Connector(" + that.id + ")", e); // + "Probably could not connect to stanbol enhancer.");
VIE2.log("error", "VIE2.Connector(" + that.id + ")", data);
callback(jQuery.rdf());
}
}
Expand All @@ -144,7 +146,7 @@ VIE2.connectors['stanbol'].queryEnhancer = function (text, callback) {
data: {
proxy_url: enhancer_url,
content: text,
type: "text/plain",
// type: "text/plain",
verb: "POST",
format: "application/rdf+json"
}
Expand Down Expand Up @@ -244,4 +246,4 @@ VIE2.connectors['stanbol'].queryEntityHub = function (uri, callback) {
dataType: "application/rdf+json"
});
}
};
};
8 changes: 4 additions & 4 deletions lib/vie2/vie2-latest.debug.js
Expand Up @@ -442,13 +442,13 @@ VIE2.log = function (level, component, message) {
if (VIE2.logLevels.indexOf(level) > -1) {
switch (level) {
case "info":
console.info(component + ' ' + message);
console.info([component, message]);
break;
case "warn":
console.warn(component + ' ' + message);
console.warn([component, message]);
break;
case "error":
console.error(component + ' ' + message);
console.error([component, message]);
break;
}
}
Expand Down Expand Up @@ -940,4 +940,4 @@ VIE2.Util.isBlank = function (str) {
jQuery(document).vie2();


}).call(this);
}).call(this);

0 comments on commit 6c79aeb

Please sign in to comment.