NotBoundException

5 views
Skip to first unread message

uoccou

unread,
Apr 26, 2010, 5:38:36 AM4/26/10
to jenabean-dev
Hi,

Not sure if this message made it thru on Friday - not showing up in
the list of messages.

Im getting the same problem as Martyna in Oct 09 - NotBoundException.
Have done a bindAll() on the package in question - a copy of the
example.foaf class in the distribution. When I call reader.loadDeep it
gives the exception :

thewebsemantic.NotBoundException: http://uoccou.wordpress.com
exists but is not bound to or able to coerce as class
net.archivelink.foaf.Document

This is the code where it happens :
reader.bindAll("mypackage.example.foaf");
items = reader.loadDeep(c);

This is with a FOAF profile that I've loaded into a Jean 2.62 SDB 1.31
model from a URI using model.load(String uri).
There seems to be a problem with the foaf:homepage triple

<foaf:homepage rdf:resource="http://uoccou.wordpress.com"/>

In the message I sent before I mentioned I was using JenaBean 1.06,
but Ive found this also happens when using the source from svn.

--
You received this message because you are subscribed to the Google Groups "jenabean-dev" group.
To post to this group, send email to jenabe...@googlegroups.com.
To unsubscribe from this group, send email to jenabean-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jenabean-dev?hl=en.

uoc

unread,
Apr 26, 2010, 5:39:45 AM4/26/10
to jenabe...@googlegroups.com, uoccou
On 26/04/2010 10:38, uoccou wrote:
> Hi,
>
> Not sure if this message made it thru on Friday - not showing up in
> the list of messages.
>
> Im getting the same problem as Martyna in Oct 09 - NotBoundException.
> Have done a bindAll() on the package in question - a copy of the
> example.foaf class in the distribution. When I call reader.loadDeep it
> gives the exception :
>
> thewebsemantic.NotBoundException: http://uoccou.wordpress.com
> exists but is not bound to or able to coerce as class
> net.archivelink.foaf.Document
>
> This is the code where it happens :
> reader.bindAll("mypackage.example.foaf");
> items = reader.loadDeep(c);
>
> This is with a FOAF profile that I've loaded into a Jean 2.62 SDB 1.31
> model from a URI using model.load(String uri).
> There seems to be a problem with the foaf:homepage triple
>
> <foaf:homepage rdf:resource="http://uoccou.wordpress.com"/>
>
> In the message I sent before I mentioned I was using JenaBean 1.06,
> but Ive found this also happens when using the source from svn.
>
>
Sorry, that line :

reader.bindAll("mypackage.example.foaf");

should be
reader.bindAll("net.archivelink.foaf");

uoccou

unread,
Apr 26, 2010, 6:59:08 AM4/26/10
to jenabean-dev
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.

Taylor Cowan

unread,
Apr 26, 2010, 3:25:12 PM4/26/10
to jenabe...@googlegroups.com
Got the message, looks familiar, I'll have some input shortly.

uoccou

unread,
May 1, 2010, 6:07:54 AM5/1/10
to jenabean-dev
Gentle bump....

BTW - thanks for creating JenaBean - as I learn my way thru it, trying
to break it :-) its becoming more useful and exciting. Im looking
forward to combining my object model with jena inferencing over
ontologies. Its the future.....

Any "powered by" graphics for when my PoC turns into a real product ?

On Apr 26, 8:25 pm, Taylor Cowan <thewebseman...@gmail.com> wrote:
> Got the message, looks familiar, I'll have some input shortly.
>
>
>
> On Mon, Apr 26, 2010 at 5:59 AM, uoccou <uoc...@googlemail.com> wrote:
> > Stepping thru the source code I see that in
> > private Class<?> javaclass(Resource source, Class<?> c)
>
> > when this is called with source with nodeURIhttp://uoccou.wordpress.com
Reply all
Reply to author
Forward
0 new messages