Hey list,

I switched from in-memory OntModel

  OntModel model = ModelFactory.createOntologyModel();

to TDB-backed persistent OntModel

  OntModel model =
ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM,
TDBFactory.createNamedModel(ONT_MODEL_URI,
getContext().getRealPath("/WEB-INF/tdb/ontologies")));

And I can see that behavior changed, since I get this exception on
model.listIndividuals() which wasn't there before:

  com.hp.hpl.jena.ontology.ConversionException: Cannot convert node
"http://l-userpic.livejournal.com/83083903/3100850"@en to OntResource

Is OntModelSpec.OWL_MEM not the default model spec used in
createOntologyModel()?

More to the point - I can see that my FOAF data is broken - there is a
literal object where foaf:image expects a resource:

  <foaf:image>http://l-userpic.livejournal.com/67781107/4730072</foaf:image>

but I can't do much about it since it is the kind of raw data I want
to accept from users.

I do not need inference right now but might use it in the future - so
how do I deal with ConversionException on broken data like this?

Thanks,

Martynas
semantic-web.dk

Reply via email to