Stepping thru the source code I see that in
private Class<?> javaclass(Resource source, Class<?> c)
when this is called with source with nodeURI
http://uoccou.wordpress.com
- object of the foaf:homepage property the iterator retrieved from the
call
StmtIterator it = source.listProperties(RDF.type);
is empty
The Model doesnt contain any information about the resource at that
URI, so it doesnt attempt to check if it isAssignableFrom the declared
class, the method throws a NotBoundException and nothing gets loaded.
So, if I catch the exception in applyProperties I can at least get
some of the data back.
private void applyIndividual(ValuesContext ctx, Resource i) {
try {
ctx.setProperty(toObject(ctx.type(), i));
} catch (NotBoundException nbe){
System.err.println("That resource cant be bound : " + i);
}
}
In doing so, I can see that any subject with an object which is an
external URI has this problem. Ideally, something would be returned
here, at least a URI. I tried getting the foaf classes to extend Thing
and the javaclass method to return Thing when no properties are found,
but it starts getting messy. Is there anything that can be done here ?
Obviously, in a Linked Data world, even with Objects that I create
within my own control Im going to have references to external URIs,
and this needs to be catered for.