HughP / simal

Automatically exported from code.google.com/p/simal
0 stars 0 forks source link

Queries fail on blank nodes #290

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
There is a bug with queries that result in blank nodes being returned. 
The mechanism below is used in several places, eg. in JenaPersonService : 

      String uri = itr.nextStatement().getSubject().getURI();
      people.add(new Person(model.getResource(uri)));

This leads to a problem with blank nodes, because the URI of a blank node 
is null, thereby leading to the creation of a new blank node by 
model.getResource(null).

Following discussion on the mailing list [1] we assume these can safely be 
replaced by something similar to:

      people.add(itr.nextStatement().getSubject());

[1] http://groups.google.com/group/simal-
contributors/browse_thread/thread/98f134c9aa95dfde?hl=en-GB 

Original issue reported on code.google.com by sander.v...@oucs.ox.ac.uk on 25 May 2010 at 4:14