Hi Emanuel,

I don't know if I have a good solution for you (I'm not the best
programmer), but recently I made this: Search for all classes of ontology.
For each class X, return the set of classes that is disjoint with X:

        model.read(new InputStreamReader(in), ""); //read the ontology

        Iterator classes = model.listClasses(); //list all classes in
ontology
        while (classes.hasNext()){
            OntClass ontologyClass = (OntClass) classes.next(); //get one
class

            //get list of disjoint classes from ontologyClass
            Iterator disjointClasses = ontologyClass.listDisjointWith();

            while(disjointClasses.hasNext()){
            System.out.print("Class "+ontologyClass.getLocalName()+" is
disjoint with: ");
            System.out.println(disjointClasses.next());
            }
            System.out.println("");

        }

This will help? My some mistake?


2013/1/24 Emanuel Santos <[email protected]>

> Hi,
>
> I just started using Jena.
> Any easyway to get all set of classes "disjointWith" ?
>
> Thanks
>



-- 
Fabio Aiub Sperotto
Mestrando em Modelagem Computacional
about.me/fabiosperotto
www.twitter.com/fabio_gk

Reply via email to