[Pellet-users] com.hp.hpl.jena.ontology.ConversionException
Can Kayali
magfuego at hotmail.com
Sat Sep 1 14:38:12 UTC 2007
Hi all,
I tried to get a class from a reasoner and met this error:
"Exception in thread "main" com.hp.hpl.jena.ontology.ConversionException:
Cannot convert node http://127.0.0.1/ontology/simplified_sumo.owl#Artifact
to OntClass: it does not have rdf:type owl:Class or equivalent
"
I used other ontologies and the error remains.
My relevant source code is:
URI u1 =
java.net.URI.create("http://127.0.0.1/ontology/simplified_sumo.owl#Artifact")
OntClass c1 = reasoner.getClass(u1);
where reasoner is a Pellet Reasoner and getClass is defined as:
public OntClass getClass(URI uri) throws URISyntaxException,
ConceptNotFoundException {
if (uri==null)
throw new URISyntaxException("URI was not initialized correctly ","URI was
not initialized correctly ");
return (OntClass)getRDFNode(uri).as(OntClass.class);}
The whole error stack is:
Exception in thread "main" com.hp.hpl.jena.ontology.ConversionException:
Cannot convert node http://127.0.0.1/ontology/simplified_sumo.owl#Artifact
to OntClass: it does not have rdf:type owl:Class or equivalent
at com.hp.hpl.jena.ontology.impl.OntClassImpl$1.wrap(OntClassImpl.java:80)
at com.hp.hpl.jena.enhanced.EnhNode.convertTo(EnhNode.java:113)
at com.hp.hpl.jena.enhanced.Polymorphic.asInternal(Polymorphic.java:65)
at com.hp.hpl.jena.enhanced.EnhNode.viewAs(EnhNode.java:64)
at com.hp.hpl.jena.enhanced.EnhNode.as(EnhNode.java:69)
at owlsmx.reasoning.PelletReasoner.getClass(PelletReasoner.java:237)
at owlsmx.Deneme.conceptDegree(Deneme.java:325)
at owlsmx.Deneme.main(Deneme.java:719)
Thanks in advance,
Can
More information about the Pellet-users
mailing list