Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

literals with a lang are not to be stored in VIE as turtle strings

  • Loading branch information...
commit 07aacfd4151141d93ce62093f689008c67c46f4a 1 parent 916e533
Szaby Grünwald authored
Showing with 10 additions and 2 deletions.
  1. +6 −2 src/Util.js
  2. +4 −0 test/service/stanbol.js
View
8 src/Util.js
@@ -202,8 +202,12 @@ VIE.Util = {
function getValue(rdfQueryLiteral){
if(typeof rdfQueryLiteral.value === "string"){
- if (rdfQueryLiteral.lang)
- return rdfQueryLiteral.toString();
+ if (rdfQueryLiteral.lang){
+ rdfQueryLiteral.toString = function(){
+ return this.value;
+ };
+ return rdfQueryLiteral;
+ }
else
return rdfQueryLiteral.value;
return rdfQueryLiteral.value.toString();
View
4 test/service/stanbol.js
@@ -33,6 +33,10 @@ test("VIE.js StanbolService - Analyze", function () {
}
}
ok(allEntities);
+ var firstTextAnnotation = _(entities).filter(function(e){return e.isof("enhancer:TextAnnotation") && e.get("enhancer:selected-text")})[0];
+ var s = firstTextAnnotation.get("enhancer:selected-text").toString();
+
+ ok(s.substring(s.length-4, s.length-2) != "\"@", "Selected text should be converted into a normal string.");
start();
})
.fail(function(f){
Please sign in to comment.
Something went wrong with that request. Please try again.