Thanks Dave, this was the answer I was looking for. I expected it would require a process like this. I assume you are referring to InfModel.validate(), which returns a ValidityReport. No need to respond, unless I am wrong in the prior sentence.
-----Original Message----- From: Dave Reynolds [mailto:[email protected]] Sent: Friday, February 22, 2013 12:27 PM To: [email protected] Subject: Re: testing whether an instance could be associated with a class There's no specific API for testing hypothetical assertions against an ontology. So you would need to create a model which includes (possibly by import rather than copying) - the definitions of B (and anything those depend on) - the definition of a123 and all that depends on (which includes the definition of A) - the statement that a123 rdf:type B then you would use validate() to test if that model is consistent. Reasoners like Pellet may have native APIs which streamline this sort of checking. Dave On 22/02/13 17:11, David Jordan wrote: > My original question WAS about an individual a of class A, let me call it > a123, so not to confuse it with the word "a". I may have taken things to the > class level in my discussion, but the question is about an individual. So my > original question was to see whether you could take individual a123 and > declare that it is a B, taking into account any restrictions that may be > defined for B. You say that a reasoner can determine that. So my question was > how, with using the Jena API, that I can determine whether a123 can be made > into a B (via :a123 a :B). What is the approach using Jena to check this? > > -----Original Message----- > From: Joshua TAYLOR [mailto:[email protected]] > Sent: Friday, February 22, 2013 11:41 AM > To: [email protected] > Subject: Re: testing whether an instance could be associated with a > class > >> -----Original Message----- >> From: Joshua TAYLOR [mailto:[email protected]] >> Sent: Friday, February 22, 2013 10:26 AM >> To: [email protected] >> Subject: Re: testing whether an instance could be associated with a >> class >> >> On Fri, Feb 22, 2013 at 9:38 AM, David Jordan <[email protected]> wrote: >>> I have a question about how to express something in Jena. Assume we have an >>> individual a that is of type A, where A would actually be a collection of >>> classes and subclasses. Also assume we have a class B that has been >>> defined. B may include some class restrictions that place constraints on >>> which resources can be instances of that class. As a simple case, B may be >>> defined as disjoint with A. What would be the means of asking whether >>> individual a can be of class B based on currently defined constraints? >>> >>> Individual.addOntClass returns void and throws no exception, so that would >>> not seem to work. >>> >>> Would another approach be to get the OntClasses associated with individual >>> a and then calling OntClass.isDisjointWith? >> >> Even using OntClass#isDisjointWith is unlikely to work except in the case of >> explicit disjointness declarations, unless you have a reasoner running. >> With a reasoner running, you could ask whether B is disjoint from A. Even >> so, it might not be consistent for *some particular* instance of B to be an >> instance of A, even if A and B aren't, in general disjoint. >> >> Once you've got a reasoner running: >> >> * You could check whether A and B are disjoint. >> * You could check whether a *some particular instance* of B is an instance >> of *the complement of A* (i.e., not A). If the reasoner can guarantee that >> it is, then (since it can't be an instance of A and of not A), then that >> instance can't be an instance of A. >> >> I know the Jena rule-based reasoners aren't complete for OWL, so I >> don't know whether they'll cover these cases or not. Others (e.g., >> Pellet) are available that should cover these cases. > > On Fri, Feb 22, 2013 at 11:04 AM, David Jordan <[email protected]> wrote: >> >> Suppose class B includes a restriction that states that a property cannot >> include a particular value x. An individual a may have that property with >> the value x. I don't understand how your suggestions would cover that case. >> And assume there is a reasoned involved. > > Forgive me, but I don't understand how that case relates to the original > question, which I think had two possible interpretations: > * check whether "Some B's could be A's" > * check whether "some particular B, say, b34, could be an A" > > Suppose "B includes a restriction that states that a property cannot include > a particular value x". > > If some individual a23 has x as a value for that property, then a23 cannot be > a B. A reasoner could confirm that. > > That doesn't say anything about whether "some B's could be A's". > It doesn't say anything about whether "some particular B, say, b34, could be > an A" > > Do you have a particular example at hand that you can share? > > //JT > > -- > Joshua Taylor, http://www.cs.rpi.edu/~tayloj/ >
