You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by "M. Arif Wicaksana" <ar...@belalangtempur.com> on 2015/12/09 21:12:32 UTC

Getting all classes and properties from DAML-based ontology

Hi all,

I have a project to use GEDCOM ontology (
http://www.daml.org/2001/01/gedcom/gedcom), enrich it with additional
classes and properties, and do some inferences against an RDF file based on
the enriched GEDCOM ontology.

Currently, I want to print all classes and properties from that ontology
(just to see if Jena can read it properly) using the code I put in the end
of this message. I download the ontology as 'gedcom-ori.xml'. However, the
code returns nothing.

I have tried this code for another ontology which uses OWL. And it works
properly (prints all classes and properties). But I have no idea why it
does not work for GEDCOM ontology above. I suspect the problem is because
the ontology uses DAML. I tried my best to find in the documentation of
Jena about how to read DAML, but I can't find it.

My question is, how can my code print all classes and properties from the
GEDCOM ontology? what is the correct way to read DAML-based ontology using
Jena?

It is very likely that I misunderstand this problem, since I am still new
in this field. If that is the case, would you mind to show me my mistake?

Thanks!


Regards,
Arif


=============
code:

OntModel m = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
    OntDocumentManager dm = m.getDocumentManager();
    dm.addAltEntry("http://www.daml.org/2001/01/gedcom/gedcom",
            "file:/home/arif/workspace/RoyalInference/gedcom-ori.xml");

    m.read("http://www.daml.org/2001/01/gedcom/gedcom");

    if(m.isEmpty()) {
        System.out.println("is empty");
    } else {
        System.out.println("not empty");
    }

    ExtendedIterator allProperties = m.listAllOntProperties();
    while(allProperties.hasNext()) {
        System.out.println("datatypeproperties: " +
allProperties.next().toString());
    }


    ExtendedIterator classes = m.listClasses();

    while(classes.hasNext()) {
        OntClass thisClass= (OntClass) classes.next();
        System.out.println("found class: " + thisClass.toString());

        ExtendedIterator instances = thisClass.listInstances();

        while(instances.hasNext()) {
            Individual thisInstance = (Individual) instances.next();
            System.out.println("found instance: " +
thisInstance.toString());
        }
    }
======================================

Re: Getting all classes and properties from DAML-based ontology

Posted by "M. Arif Wicaksana" <ar...@belalangtempur.com>.
Hi Fajar,

thanks for your answer. I followed your suggestion to rewrite the ontology
in OWL format using protege. I can continue my project now. And thanks for
the reading references as well.

regards,
Arif

On Thu, Dec 10, 2015 at 10:44 AM, Fajar Juang <fa...@gmail.com> wrote:

> Hi Arif,
>
> AFAIK, DAML format is not supported by Jena at the moment (also mentioned
> by Dave before).
> It was used around year 2000 I think, and then replaced by RDF(S)/OWL
> format as a standard.
>
> I check the GEDCOM ontology, and it shouldn’t be too hard to recreate them
> in OWL format from scratch using protege 3.5 [1].
> afterward, you could start to play with them using Jena.
>
> If you’re not familiar with ontology in general, I suggest to read an
> excellent introduction from Noy [1] for starter.
>
> Hope this helps,
> Fajar
>
> [1]
> http://protege.stanford.edu/download/protege/3.5/installanywhere/Web_Installers/
> <
> http://protege.stanford.edu/download/protege/3.5/installanywhere/Web_Installers/
> >
> [2]
> http://protege.stanford.edu/publications/ontology_development/ontology101.pdf
> <
> http://protege.stanford.edu/publications/ontology_development/ontology101.pdf
> >
>
> > On 10 Dec 2015, at 10:19, M. Arif Wicaksana <ar...@belalangtempur.com>
> wrote:
> >
> > Hi Dave,
> >
> > thanks for your response.
> >
> > I tried using RDFS_MEM. It gave me the classes, but I got the following
> > error for printing the properties:
> >
> > Exception in thread "main" org.apache.jena.ontology.ProfileException:
> > Attempted to use language construct OBJECT_PROPERTY that is not supported
> > in the current language profile: RDFS
> >
> > I am not sure I understand about this:
> > "However, for interpreting all the DAML specific things like
> > daml:Restriction you will have to work at the RDF level and do this
> > yourself."
> > What does working at the RDF level mean? (I am sorry, still new in this
> > topic)
> >
> > If DAML support is deprecated, does it mean that I cannot enrich the
> GEDCOM
> > ontology, and use it to do inference on a RDF file?
> >
> >
> > Regards,
> > Arif
> >
> > On Thu, Dec 10, 2015 at 9:55 AM, Dave Reynolds <
> dave.e.reynolds@gmail.com>
> > wrote:
> >
> >> Jena's DAML support was deprecated and then removed some time ago I
> think.
> >>
> >> For just finding the classes you could use an RDFS_MEM model since DAML
> is
> >> using rdfs:Class to declare classes (and not owl:Class).
> >>
> >> However, for interpreting all the DAML specific things like
> >> daml:Restriction you will have to work at the RDF level and do this
> >> yourself.
> >>
> >> Dave
> >>
> >>
> >>
> >> On 09/12/15 20:12, M. Arif Wicaksana wrote:
> >>
> >>> Hi all,
> >>>
> >>> I have a project to use GEDCOM ontology (
> >>> http://www.daml.org/2001/01/gedcom/gedcom), enrich it with additional
> >>> classes and properties, and do some inferences against an RDF file
> based
> >>> on
> >>> the enriched GEDCOM ontology.
> >>>
> >>> Currently, I want to print all classes and properties from that
> ontology
> >>> (just to see if Jena can read it properly) using the code I put in the
> end
> >>> of this message. I download the ontology as 'gedcom-ori.xml'. However,
> the
> >>> code returns nothing.
> >>>
> >>> I have tried this code for another ontology which uses OWL. And it
> works
> >>> properly (prints all classes and properties). But I have no idea why it
> >>> does not work for GEDCOM ontology above. I suspect the problem is
> because
> >>> the ontology uses DAML. I tried my best to find in the documentation of
> >>> Jena about how to read DAML, but I can't find it.
> >>>
> >>> My question is, how can my code print all classes and properties from
> the
> >>> GEDCOM ontology? what is the correct way to read DAML-based ontology
> using
> >>> Jena?
> >>>
> >>> It is very likely that I misunderstand this problem, since I am still
> new
> >>> in this field. If that is the case, would you mind to show me my
> mistake?
> >>>
> >>> Thanks!
> >>>
> >>>
> >>> Regards,
> >>> Arif
> >>>
> >>>
> >>> =============
> >>> code:
> >>>
> >>> OntModel m = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
> >>>     OntDocumentManager dm = m.getDocumentManager();
> >>>     dm.addAltEntry("http://www.daml.org/2001/01/gedcom/gedcom",
> >>>             "file:/home/arif/workspace/RoyalInference/gedcom-ori.xml");
> >>>
> >>>     m.read("http://www.daml.org/2001/01/gedcom/gedcom");
> >>>
> >>>     if(m.isEmpty()) {
> >>>         System.out.println("is empty");
> >>>     } else {
> >>>         System.out.println("not empty");
> >>>     }
> >>>
> >>>     ExtendedIterator allProperties = m.listAllOntProperties();
> >>>     while(allProperties.hasNext()) {
> >>>         System.out.println("datatypeproperties: " +
> >>> allProperties.next().toString());
> >>>     }
> >>>
> >>>
> >>>     ExtendedIterator classes = m.listClasses();
> >>>
> >>>     while(classes.hasNext()) {
> >>>         OntClass thisClass= (OntClass) classes.next();
> >>>         System.out.println("found class: " + thisClass.toString());
> >>>
> >>>         ExtendedIterator instances = thisClass.listInstances();
> >>>
> >>>         while(instances.hasNext()) {
> >>>             Individual thisInstance = (Individual) instances.next();
> >>>             System.out.println("found instance: " +
> >>> thisInstance.toString());
> >>>         }
> >>>     }
> >>> ======================================
> >>>
> >>>
>
>

Re: Getting all classes and properties from DAML-based ontology

Posted by Fajar Juang <fa...@gmail.com>.
Hi Arif, 

AFAIK, DAML format is not supported by Jena at the moment (also mentioned by Dave before).
It was used around year 2000 I think, and then replaced by RDF(S)/OWL format as a standard.

I check the GEDCOM ontology, and it shouldn’t be too hard to recreate them in OWL format from scratch using protege 3.5 [1]. 
afterward, you could start to play with them using Jena. 

If you’re not familiar with ontology in general, I suggest to read an excellent introduction from Noy [1] for starter. 

Hope this helps, 
Fajar

[1] http://protege.stanford.edu/download/protege/3.5/installanywhere/Web_Installers/ <http://protege.stanford.edu/download/protege/3.5/installanywhere/Web_Installers/>
[2] http://protege.stanford.edu/publications/ontology_development/ontology101.pdf <http://protege.stanford.edu/publications/ontology_development/ontology101.pdf>

> On 10 Dec 2015, at 10:19, M. Arif Wicaksana <ar...@belalangtempur.com> wrote:
> 
> Hi Dave,
> 
> thanks for your response.
> 
> I tried using RDFS_MEM. It gave me the classes, but I got the following
> error for printing the properties:
> 
> Exception in thread "main" org.apache.jena.ontology.ProfileException:
> Attempted to use language construct OBJECT_PROPERTY that is not supported
> in the current language profile: RDFS
> 
> I am not sure I understand about this:
> "However, for interpreting all the DAML specific things like
> daml:Restriction you will have to work at the RDF level and do this
> yourself."
> What does working at the RDF level mean? (I am sorry, still new in this
> topic)
> 
> If DAML support is deprecated, does it mean that I cannot enrich the GEDCOM
> ontology, and use it to do inference on a RDF file?
> 
> 
> Regards,
> Arif
> 
> On Thu, Dec 10, 2015 at 9:55 AM, Dave Reynolds <da...@gmail.com>
> wrote:
> 
>> Jena's DAML support was deprecated and then removed some time ago I think.
>> 
>> For just finding the classes you could use an RDFS_MEM model since DAML is
>> using rdfs:Class to declare classes (and not owl:Class).
>> 
>> However, for interpreting all the DAML specific things like
>> daml:Restriction you will have to work at the RDF level and do this
>> yourself.
>> 
>> Dave
>> 
>> 
>> 
>> On 09/12/15 20:12, M. Arif Wicaksana wrote:
>> 
>>> Hi all,
>>> 
>>> I have a project to use GEDCOM ontology (
>>> http://www.daml.org/2001/01/gedcom/gedcom), enrich it with additional
>>> classes and properties, and do some inferences against an RDF file based
>>> on
>>> the enriched GEDCOM ontology.
>>> 
>>> Currently, I want to print all classes and properties from that ontology
>>> (just to see if Jena can read it properly) using the code I put in the end
>>> of this message. I download the ontology as 'gedcom-ori.xml'. However, the
>>> code returns nothing.
>>> 
>>> I have tried this code for another ontology which uses OWL. And it works
>>> properly (prints all classes and properties). But I have no idea why it
>>> does not work for GEDCOM ontology above. I suspect the problem is because
>>> the ontology uses DAML. I tried my best to find in the documentation of
>>> Jena about how to read DAML, but I can't find it.
>>> 
>>> My question is, how can my code print all classes and properties from the
>>> GEDCOM ontology? what is the correct way to read DAML-based ontology using
>>> Jena?
>>> 
>>> It is very likely that I misunderstand this problem, since I am still new
>>> in this field. If that is the case, would you mind to show me my mistake?
>>> 
>>> Thanks!
>>> 
>>> 
>>> Regards,
>>> Arif
>>> 
>>> 
>>> =============
>>> code:
>>> 
>>> OntModel m = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
>>>     OntDocumentManager dm = m.getDocumentManager();
>>>     dm.addAltEntry("http://www.daml.org/2001/01/gedcom/gedcom",
>>>             "file:/home/arif/workspace/RoyalInference/gedcom-ori.xml");
>>> 
>>>     m.read("http://www.daml.org/2001/01/gedcom/gedcom");
>>> 
>>>     if(m.isEmpty()) {
>>>         System.out.println("is empty");
>>>     } else {
>>>         System.out.println("not empty");
>>>     }
>>> 
>>>     ExtendedIterator allProperties = m.listAllOntProperties();
>>>     while(allProperties.hasNext()) {
>>>         System.out.println("datatypeproperties: " +
>>> allProperties.next().toString());
>>>     }
>>> 
>>> 
>>>     ExtendedIterator classes = m.listClasses();
>>> 
>>>     while(classes.hasNext()) {
>>>         OntClass thisClass= (OntClass) classes.next();
>>>         System.out.println("found class: " + thisClass.toString());
>>> 
>>>         ExtendedIterator instances = thisClass.listInstances();
>>> 
>>>         while(instances.hasNext()) {
>>>             Individual thisInstance = (Individual) instances.next();
>>>             System.out.println("found instance: " +
>>> thisInstance.toString());
>>>         }
>>>     }
>>> ======================================
>>> 
>>> 


Re: Getting all classes and properties from DAML-based ontology

Posted by "M. Arif Wicaksana" <ar...@belalangtempur.com>.
Hi Dave,

sorry for my late reply.
Thanks for your answer. I didn't know that DAML interface is not supported
anymore. Maybe that is why I can't find any information about DAML in Jena
documentation. I decided to just rewrite the ontology using OWL
specification. Much much easier to do the rest of my project.

On Thu, Dec 10, 2015 at 10:40 AM, Dave Reynolds <da...@gmail.com>
wrote:

> Hi Arif,
>
>
> On 10/12/15 09:19, M. Arif Wicaksana wrote:
>
>> Hi Dave,
>>
>> thanks for your response.
>>
>> I tried using RDFS_MEM. It gave me the classes, but I got the following
>> error for printing the properties:
>>
>> Exception in thread "main" org.apache.jena.ontology.ProfileException:
>> Attempted to use language construct OBJECT_PROPERTY that is not supported
>> in the current language profile: RDFS
>>
>
> That's because RDFS doesn't have a notion of DatatypeProperty or
> ObjectProperty, just Property.
>
> DAML has it's own thing so ...
>
> I am not sure I understand about this:
>> "However, for interpreting all the DAML specific things like
>> daml:Restriction you will have to work at the RDF level and do this
>> yourself."
>> What does working at the RDF level mean? (I am sorry, still new in this
>> topic)
>>
>
> Well, for example. To list the DAML object properties you could do:
>
>         final String DAML_NS = "http://www.daml.org/2001/03/daml+oil#";
>         OntModel model =
> ModelFactory.createOntologyModel(OntModelSpec.RDFS_MEM);
>         model.read("http://www.daml.org/2001/01/gedcom/gedcom");
>
>         Property damlObjectProperty = model.createProperty(DAML_NS,
> "ObjectProperty");
>         ResIterator i = model.listSubjectsWithProperty(RDF.type,
> damlObjectProperty);
>         while (i.hasNext()) {
>             System.out.println(" - " + i.next());
>         }
>
> which outputs:
>
>  - http://www.daml.org/2001/01/gedcom/gedcom#childIn
>  - http://www.daml.org/2001/01/gedcom/gedcom#birth
>  - http://www.daml.org/2001/01/gedcom/gedcom#spouseIn
>  - http://www.daml.org/2001/01/gedcom/gedcom#eventProperty
>  - http://www.daml.org/2001/01/gedcom/gedcom#individualEventProperty
>  - http://www.daml.org/2001/01/gedcom/gedcom#marriage
>  - http://www.daml.org/2001/01/gedcom/gedcom#divorce
>  - http://www.daml.org/2001/01/gedcom/gedcom#death
>  - http://www.daml.org/2001/01/gedcom/gedcom#familyEventProperty
>
> So you are working at the level of the RDF API - searching individual
> triples and triple patterns.
>
> If DAML support is deprecated, does it mean that I cannot enrich the GEDCOM
>> ontology, and use it to do inference on a RDF file?
>>
>
> You can add more statements using Jena by adding the corresponding RDF
> triples but Jena doesn't support DAML inference.
>
> Dave
>

Re: Getting all classes and properties from DAML-based ontology

Posted by Dave Reynolds <da...@gmail.com>.
Hi Arif,


On 10/12/15 09:19, M. Arif Wicaksana wrote:
> Hi Dave,
>
> thanks for your response.
>
> I tried using RDFS_MEM. It gave me the classes, but I got the following
> error for printing the properties:
>
> Exception in thread "main" org.apache.jena.ontology.ProfileException:
> Attempted to use language construct OBJECT_PROPERTY that is not supported
> in the current language profile: RDFS

That's because RDFS doesn't have a notion of DatatypeProperty or 
ObjectProperty, just Property.

DAML has it's own thing so ...

> I am not sure I understand about this:
> "However, for interpreting all the DAML specific things like
> daml:Restriction you will have to work at the RDF level and do this
> yourself."
> What does working at the RDF level mean? (I am sorry, still new in this
> topic)

Well, for example. To list the DAML object properties you could do:

         final String DAML_NS = "http://www.daml.org/2001/03/daml+oil#";
         OntModel model = 
ModelFactory.createOntologyModel(OntModelSpec.RDFS_MEM);
         model.read("http://www.daml.org/2001/01/gedcom/gedcom");

         Property damlObjectProperty = model.createProperty(DAML_NS, 
"ObjectProperty");
         ResIterator i = model.listSubjectsWithProperty(RDF.type, 
damlObjectProperty);
         while (i.hasNext()) {
             System.out.println(" - " + i.next());
         }

which outputs:

  - http://www.daml.org/2001/01/gedcom/gedcom#childIn
  - http://www.daml.org/2001/01/gedcom/gedcom#birth
  - http://www.daml.org/2001/01/gedcom/gedcom#spouseIn
  - http://www.daml.org/2001/01/gedcom/gedcom#eventProperty
  - http://www.daml.org/2001/01/gedcom/gedcom#individualEventProperty
  - http://www.daml.org/2001/01/gedcom/gedcom#marriage
  - http://www.daml.org/2001/01/gedcom/gedcom#divorce
  - http://www.daml.org/2001/01/gedcom/gedcom#death
  - http://www.daml.org/2001/01/gedcom/gedcom#familyEventProperty

So you are working at the level of the RDF API - searching individual 
triples and triple patterns.

> If DAML support is deprecated, does it mean that I cannot enrich the GEDCOM
> ontology, and use it to do inference on a RDF file?

You can add more statements using Jena by adding the corresponding RDF 
triples but Jena doesn't support DAML inference.

Dave

Re: Getting all classes and properties from DAML-based ontology

Posted by "M. Arif Wicaksana" <ar...@belalangtempur.com>.
Hi Dave,

thanks for your response.

I tried using RDFS_MEM. It gave me the classes, but I got the following
error for printing the properties:

Exception in thread "main" org.apache.jena.ontology.ProfileException:
Attempted to use language construct OBJECT_PROPERTY that is not supported
in the current language profile: RDFS

I am not sure I understand about this:
"However, for interpreting all the DAML specific things like
daml:Restriction you will have to work at the RDF level and do this
yourself."
What does working at the RDF level mean? (I am sorry, still new in this
topic)

If DAML support is deprecated, does it mean that I cannot enrich the GEDCOM
ontology, and use it to do inference on a RDF file?


Regards,
Arif

On Thu, Dec 10, 2015 at 9:55 AM, Dave Reynolds <da...@gmail.com>
wrote:

> Jena's DAML support was deprecated and then removed some time ago I think.
>
> For just finding the classes you could use an RDFS_MEM model since DAML is
> using rdfs:Class to declare classes (and not owl:Class).
>
> However, for interpreting all the DAML specific things like
> daml:Restriction you will have to work at the RDF level and do this
> yourself.
>
> Dave
>
>
>
> On 09/12/15 20:12, M. Arif Wicaksana wrote:
>
>> Hi all,
>>
>> I have a project to use GEDCOM ontology (
>> http://www.daml.org/2001/01/gedcom/gedcom), enrich it with additional
>> classes and properties, and do some inferences against an RDF file based
>> on
>> the enriched GEDCOM ontology.
>>
>> Currently, I want to print all classes and properties from that ontology
>> (just to see if Jena can read it properly) using the code I put in the end
>> of this message. I download the ontology as 'gedcom-ori.xml'. However, the
>> code returns nothing.
>>
>> I have tried this code for another ontology which uses OWL. And it works
>> properly (prints all classes and properties). But I have no idea why it
>> does not work for GEDCOM ontology above. I suspect the problem is because
>> the ontology uses DAML. I tried my best to find in the documentation of
>> Jena about how to read DAML, but I can't find it.
>>
>> My question is, how can my code print all classes and properties from the
>> GEDCOM ontology? what is the correct way to read DAML-based ontology using
>> Jena?
>>
>> It is very likely that I misunderstand this problem, since I am still new
>> in this field. If that is the case, would you mind to show me my mistake?
>>
>> Thanks!
>>
>>
>> Regards,
>> Arif
>>
>>
>> =============
>> code:
>>
>> OntModel m = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
>>      OntDocumentManager dm = m.getDocumentManager();
>>      dm.addAltEntry("http://www.daml.org/2001/01/gedcom/gedcom",
>>              "file:/home/arif/workspace/RoyalInference/gedcom-ori.xml");
>>
>>      m.read("http://www.daml.org/2001/01/gedcom/gedcom");
>>
>>      if(m.isEmpty()) {
>>          System.out.println("is empty");
>>      } else {
>>          System.out.println("not empty");
>>      }
>>
>>      ExtendedIterator allProperties = m.listAllOntProperties();
>>      while(allProperties.hasNext()) {
>>          System.out.println("datatypeproperties: " +
>> allProperties.next().toString());
>>      }
>>
>>
>>      ExtendedIterator classes = m.listClasses();
>>
>>      while(classes.hasNext()) {
>>          OntClass thisClass= (OntClass) classes.next();
>>          System.out.println("found class: " + thisClass.toString());
>>
>>          ExtendedIterator instances = thisClass.listInstances();
>>
>>          while(instances.hasNext()) {
>>              Individual thisInstance = (Individual) instances.next();
>>              System.out.println("found instance: " +
>> thisInstance.toString());
>>          }
>>      }
>> ======================================
>>
>>

Re: Getting all classes and properties from DAML-based ontology

Posted by Dave Reynolds <da...@gmail.com>.
Jena's DAML support was deprecated and then removed some time ago I think.

For just finding the classes you could use an RDFS_MEM model since DAML 
is using rdfs:Class to declare classes (and not owl:Class).

However, for interpreting all the DAML specific things like 
daml:Restriction you will have to work at the RDF level and do this 
yourself.

Dave


On 09/12/15 20:12, M. Arif Wicaksana wrote:
> Hi all,
>
> I have a project to use GEDCOM ontology (
> http://www.daml.org/2001/01/gedcom/gedcom), enrich it with additional
> classes and properties, and do some inferences against an RDF file based on
> the enriched GEDCOM ontology.
>
> Currently, I want to print all classes and properties from that ontology
> (just to see if Jena can read it properly) using the code I put in the end
> of this message. I download the ontology as 'gedcom-ori.xml'. However, the
> code returns nothing.
>
> I have tried this code for another ontology which uses OWL. And it works
> properly (prints all classes and properties). But I have no idea why it
> does not work for GEDCOM ontology above. I suspect the problem is because
> the ontology uses DAML. I tried my best to find in the documentation of
> Jena about how to read DAML, but I can't find it.
>
> My question is, how can my code print all classes and properties from the
> GEDCOM ontology? what is the correct way to read DAML-based ontology using
> Jena?
>
> It is very likely that I misunderstand this problem, since I am still new
> in this field. If that is the case, would you mind to show me my mistake?
>
> Thanks!
>
>
> Regards,
> Arif
>
>
> =============
> code:
>
> OntModel m = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
>      OntDocumentManager dm = m.getDocumentManager();
>      dm.addAltEntry("http://www.daml.org/2001/01/gedcom/gedcom",
>              "file:/home/arif/workspace/RoyalInference/gedcom-ori.xml");
>
>      m.read("http://www.daml.org/2001/01/gedcom/gedcom");
>
>      if(m.isEmpty()) {
>          System.out.println("is empty");
>      } else {
>          System.out.println("not empty");
>      }
>
>      ExtendedIterator allProperties = m.listAllOntProperties();
>      while(allProperties.hasNext()) {
>          System.out.println("datatypeproperties: " +
> allProperties.next().toString());
>      }
>
>
>      ExtendedIterator classes = m.listClasses();
>
>      while(classes.hasNext()) {
>          OntClass thisClass= (OntClass) classes.next();
>          System.out.println("found class: " + thisClass.toString());
>
>          ExtendedIterator instances = thisClass.listInstances();
>
>          while(instances.hasNext()) {
>              Individual thisInstance = (Individual) instances.next();
>              System.out.println("found instance: " +
> thisInstance.toString());
>          }
>      }
> ======================================
>