Why should a method called "listOntClasses" just return a single class?
The usage of the plural form should be clear enough. And Javadoc Javadoc
Javadoc,...
> Dave, I have read some where that Individual#listOntClasses will only list
> one class at one time.
>
> And yes employee is individual and programmer, manager and worker are class
> variables.
>
> On Fri, Jan 27, 2017 at 12:23 AM, Dave Reynolds <[email protected]>
> wrote:
>
>> On 26/01/2017 21:08, tina sani wrote:
>>
>>> Hi Dave, Will this work?
>>>
>>> if ((employee1.hasOntClass(programmer)) &&
>>> ((employee1.hasOntClass(manager)) &&((employee1.hasOntClass(worker))
>>> {
>>>
>>> }
>>>
>> Try it and see!
>>
>> There's not enough there for us to tell for sure. If the variable
>> employee1 is an Individual and if variables programmer, manager and worker
>> are all Resources correctly corresponding to your classes then that will
>> test if that Individual has all three of those classes in the model
>> (whether asserted or inferred by rules).
>>
>> To add to my earlier answer, if you have an Individual rather than just
>> and OntResource then Individual#listOntClasses will enable you to enumerate
>> the classes conveniently.
>>
>> Dave
>>
>>
>> On Thu, Jan 26, 2017 at 11:32 PM, Dave Reynolds <[email protected]
>>> wrote:
>>>
>>> On 26/01/2017 15:20, tina sani wrote:
>>>> How can I get all the classes of which an individual is a type? After
>>>>> Jena
>>>>> rules executed, my individual has multiple class like:
>>>>> Employee001 is of type: Worker, Programmer, Manager.
>>>>>
>>>>> So can I get all these three classes in Jena ? I have read somewhere
>>>>> that
>>>>> getOntClass() only return one class at a time and that is on random
>>>>> basis.
>>>>>
>>>>> See OntResource#listRDFTypes or, if you just have a Resource then
>>>>>
>>>> Resource#listProperties(RDF.type) or, as Charles says, use SPARQL.
>>>>
>>>> Dave
>>>>
>>>>
>>>>
>>>> ---
>>>> This email has been checked for viruses by Avast antivirus software.
>>>> https://www.avast.com/antivirus
>>>>
>>>>
>>>>
>> ---
>> This email has been checked for viruses by Avast antivirus software.
>> https://www.avast.com/antivirus
>>
>>
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

Reply via email to