Author: rwesten
Date: Thu Feb 16 07:30:30 2012
New Revision: 1244867

URL: http://svn.apache.org/viewvc?rev=1244867&view=rev
Log:
The RdfEntityIterator now checks of a Jena URI resource is empty. This is 
necessary because Jena allows empty URIs to be used in RDF graphs.

Modified:
    
incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/main/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSource.java

Modified: 
incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/main/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSource.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/main/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSource.java?rev=1244867&r1=1244866&r2=1244867&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/main/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSource.java
 (original)
+++ 
incubator/stanbol/trunk/entityhub/indexing/source/jenatdb/src/main/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/RdfIndexingSource.java
 Thu Feb 16 07:30:30 2012
@@ -530,7 +530,9 @@ public class RdfIndexingSource implement
             while(!next && resultSet.hasNext()){
                 Binding binding = resultSet.nextBinding();
                 Node entityNode = binding.get(entityVar);
-                if(entityNode.isURI()){
+                if(entityNode.isURI() && 
+                        // it's unbelievable, but Jena URIs might be empty!
+                        !entityNode.toString().isEmpty()){
                     if(!entityNode.equals(currentEntity)){
                         //start of next Entity
                         this.nextEntity = entityNode; //store the node for the 
next entity
@@ -541,7 +543,7 @@ public class RdfIndexingSource implement
                         processSolution(binding);
                     }
                 } else {
-                    log.warn(String.format("Current Entity %s is not a URI 
Node -> ignored",entityNode));
+                    log.warn(String.format("Current Entity '%s' is not a valid 
URI Node -> skiped",entityNode));
                 }
             }
             if(!next){ // exit the loop but still no new entity ... that means


Reply via email to