On Sat, 2011-04-30 at 13:05 +0800, 朱曼 wrote: 
> Dear all,
> 
> Hi!
> 
> Currently I am using Jena to process ontology and create ontology classes.
> But I confront a problem: how can I create a class which is existentially
> restricted by the inverse of an existed property(hasValue inverseOf
> Property)? I tried "property.getInverse()", but I get a
> NullPointerException, I think that is because the inverse property doesn't
> really exist in the current ontology. And I also notice there is a
> createInverseFunctionalProperty method in OntModel, but how can I create an
> inverse property based on an existed property, so far as the
> createInverseFunctionalProperty method only have "uri" and "functional"
> parameters?

You want OntProperty#addInverseOf  (not sure why it is called "add.."
rather than "create..")

Dave


Reply via email to