You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by rw...@apache.org on 2013/04/15 08:49:33 UTC

svn commit: r1467866 - /stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/processor/LdpathSourceProcessor.java

Author: rwesten
Date: Mon Apr 15 06:49:33 2013
New Revision: 1467866

URL: http://svn.apache.org/r1467866
Log:
STANBOL-1031: Also adapted the LDpath source processor to ignore empty literal languages

Modified:
    stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/processor/LdpathSourceProcessor.java

Modified: stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/processor/LdpathSourceProcessor.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/processor/LdpathSourceProcessor.java?rev=1467866&r1=1467865&r2=1467866&view=diff
==============================================================================
--- stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/processor/LdpathSourceProcessor.java (original)
+++ stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/processor/LdpathSourceProcessor.java Mon Apr 15 06:49:33 2013
@@ -228,9 +228,11 @@ public class LdpathSourceProcessor imple
                     if(backend.isURI(value)){
                         result.addReference(entry.getKey(), backend.stringValue(value));
                     } else if(backend.isLiteral(value)){ //literal
-                        Locale lang = backend.getLiteralLanguage(value);
-                        if(lang != null){ //text with language
-                            result.addNaturalText(entry.getKey(), backend.stringValue(value), lang.getLanguage());
+                        Locale locale = backend.getLiteralLanguage(value);
+                        if(locale != null){ //text with language
+                            String lang = locale.getLanguage();
+                            result.addNaturalText(entry.getKey(), backend.stringValue(value), 
+                                lang.isEmpty() ? null : lang);
                         } else { // no language
                             URI type = backend.getLiteralType(value);
                             if(type != null){ //typed literal -> need to transform