[Notice: this post is slightly related to
http://tech.groups.yahoo.com/group/jena-dev/message/47883 -- Crosspost from
depreciated List@http://tech.groups.yahoo.com/group/jena-dev/message/47884]

Hi there,

I want to test within my InfModel, how modified (deleted, added) Statements
(via
Jena Java API) are dealt with by the Reasoner.

The Model is initiated by:
infModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);

Then, individuals are added like:
final OntClass classOfferedHandlingCondition = infModel.getResource(
nsImotrisOntology + "#OfferedHandlingCondition").as(OntClass.class);

final Individual individualOfferedService =
classOfferedServices.createIndividual(nsImotrisOntology + "#OfferedService_"
+
offeredService.id);

This works fine _before_ reasoning. However, after Reasoning, the OntClass
cast
fails with:

Cannot convert node
http://www.igd-r.fraunhofer.de/IMOTRIS/Ontologies/imotris.owl#OfferedServiceto
OntClass: it does not have rdf:type owl:Class or equivalent.

But the rdf:type is definitely there: I am printing the related statements
with
listStatements() right before the cast.

[Console Output:] -
(
http://www.igd-r.fraunhofer.de/IMOTRIS/Ontologies/imotris.owl#OfferedService
rdf:type owl:Class)

If I disable the reasoner within exact the same setup, the cast works fine.

The Reasoner is configured as follows:

final GenericRuleReasoner reasoner = new
GenericRuleReasoner(Rule.rulesFromURL(owlResourceReasonerRulesLayer
.getFile().toURI().toURL().toExternalForm()));
infModel = ModelFactory.createInfModel(reasoner, infModel);

And the Rules are shown here: http://pastebin.com/i96sM1W3


So: Why is the OntClass cast impossible after reasoning? I would appreciate
any
hints!

-- Weizen

Reply via email to