NotBound Exception ... exists but is not bound to or able to coerce as class

24 views
Skip to first unread message

Arthur

unread,
Jul 8, 2010, 10:25:41 AM7/8/10
to jenabean-dev
I am using JenaBeans to access an existing owl model containing an
instance (of Well) that imports a schema model (containing the Well
class). I open the instance model, but when I use the RDF2Bean reader
to load Well instances, it throws an exception. It is finding the
correct instance (of Well), but it says that it cannot bind or coerce
to the class (Well). I am sure this is just a configuration issue.
Any ideas?

Exception in thread "main" thewebsemantic.NotBoundException:
http://www.objectreservoir.com/owl/2010/04/14/BP/SampleWell#SampleWell
exists but is not bound to or able to coerce as class
com.or.orka.jena_reference.Well
at thewebsemantic.RDF2Bean.javaclass(RDF2Bean.java:528)
at thewebsemantic.RDF2Bean.newInstance(RDF2Bean.java:496)
at thewebsemantic.RDF2Bean.applyProperties(RDF2Bean.java:436)
at thewebsemantic.RDF2Bean.testCycle(RDF2Bean.java:397)
at thewebsemantic.RDF2Bean.toObject(RDF2Bean.java:393)
at thewebsemantic.RDF2Bean.loadIndividuals(RDF2Bean.java:178)
at thewebsemantic.RDF2Bean.loadAll(RDF2Bean.java:172)
at thewebsemantic.RDF2Bean.load(RDF2Bean.java:156)
at thewebsemantic.RDF2Bean.load(RDF2Bean.java:123)
at
com.or.orka.jena_reference.WorkspaceManager.main(WorkspaceManager.java:
55)

Here is the Well Class. I am not mapping to all the properties of
Well as this is a feasibility test and well has about 30 properties.
Could that be the issue?

@Namespace("http://www.objectreservoir.com/owl/2010/02/22/well#")
public class Well {

String name;
String API;
@Id
URI uri;

public Well(URI uri) {
this.uri = uri;
}

public String getAPI() {
return API;
}

public void setAPI(String API) {
this.API = API;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public URI getUri() {
return uri;
}

public void setUri(URI uri) {
this.uri = uri;
}
}

Here is how I am accessing the model. The SampleWell model imports
the Well model

OntModel ontModel =
ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null);

ontModel.getDocumentManager().getFileManager().setLocationMapper(mgr.localMapper.getLocationMapper());
ontModel.read("http://www.objectreservoir.com/owl/2010/04/14/
BP/SampleWell");
RDF2Bean reader = new RDF2Bean(ontModel);
Collection<Well> wells = reader.load(Well.class);
for (Well well : wells) {
System.out.println("2) Well name is " + well.name);
System.out.println("2) Well API is " + well.API);
}

Taylor Cowan

unread,
Jul 8, 2010, 12:43:44 PM7/8/10
to jenabe...@googlegroups.com
When working with existing rdf you need 2 help jb bind. You can do this in several ways, see bind() method on RDF2bean

Sent from my HTC

public v

[The entire original message is not included]

Arthur Keen

unread,
Jul 8, 2010, 1:03:42 PM7/8/10
to jenabe...@googlegroups.com
Thanks, that got it working.

Sent from my iPhone

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

Reply all
Reply to author
Forward
0 new messages