RE: NotBoundException

0 views
Skip to first unread message

Taylor Cowan

unread,
May 3, 2010, 9:05:05 AM5/3/10
to jenabe...@googlegroups.com
When i wrote j b my assumption was all objects have a type. U can give the property a type uri , itll just load tje uri..
Sent from my HTC

-----Original Message-----
From: uoccou <uoc...@googlemail.com>
Sent: 01 May 2010 5:07 AM
To: jenabean-dev <jenabe...@googlegroups.com>
Subject: Re: NotBoundException

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
> > - 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 h


[The entire original message is not included]

--
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.

Taylor Cowan

unread,
May 3, 2010, 9:08:15 AM5/3/10
to jenabe...@googlegroups.com
See toObject in rdf2bean ...resource or uri or attempt to match a javaclass

Taylor Cowan

unread,
May 3, 2010, 9:20:12 AM5/3/10
to jenabe...@googlegroups.com
So if your graph reaches untyped objects, the property of the Subject should be URI. Sounds lk u r on he right track with 'thing' but realize, j b creates graph disconected Beans, thing is graph connected

Taylor Cowan

unread,
May 3, 2010, 9:48:33 AM5/3/10
to jenabe...@googlegroups.com
Let me summarize:

Apparently your graph has objects which have no type declared. There
are several was to handle this.

1. allow parts of your model to stem out as "URI's". Basically when
jenabean sees a setter/getter of type "URI" it'll just load that from
the graph. thewebsemantic.Resource was an earlier attempt at that,
there for backwards compat, but use simple URI for that situation. So
you use jenabean to load big parts of the graph, but some aspects
remain as URIs, for which you drop down to lower level jena coding
when necessary...the URI's are conventiently brought back in the bean,
taking the URI and the model, you just use regular jena to do the
rest.

2. you have nodes in your graph with meta data, but there is not
information regarding how they should bind back to java land. See the
"bind" methods in RDF2Bean. These look at a package or class, read
it's annotations, and make the bindings available. This is how you'd
bind to 3rd party RDF that you did not create with JenaBean.

finally, JenaBean may need to be improved to "fallback" to using the
class info, sans any RDF type information, and using that to "infer"
the type of the node. In other words, if there is no RDF type info,
JB would just look at the property in context, and use that to infer
what the type should be. That should be a simple change.

Taylor

uoc

unread,
May 3, 2010, 12:22:23 PM5/3/10
to jenabe...@googlegroups.com, Taylor Cowan
Im not at the dev box right now, but I remember that it was failing on
the homepage propety of foaf:Person. This is typed as a URI as far as I
recall, but the exception seems to indicate Jenabean thought it was a
Document. I may have this wrong, but it seemed peculiar. I'll try and
work up a test case tomorrow.

uoccou

unread,
May 7, 2010, 1:13:37 PM5/7/10
to jenabean-dev
I remember I have a todo on this, still havent had the time to
prioritise it, but will do once I have some !
Still also interested in your thoughts on using a skeleton instance of
a class to generate a query or subjectWithProperties call to load
instances from repository, without duplicating jenabean reflection
code etc.
Reply all
Reply to author
Forward
0 new messages