Fwd: Error using setSubclassesDisjoint

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: Error using setSubclassesDisjoint

Anurag Bhavsar
Hello,

I am getting below error when I am trying to make all sub-classes of my super class disjoint.

Exception in thread "main" java.lang.RuntimeException: Could not find slot http://protege.stanford.edu/plugins/owl/protege#subclassesDisjoint
at edu.stanford.smi.protegex.owl.model.impl.DefaultOWLNamedClass.setSubclassesDisjoint(Unknown Source)
at version1.myOntology.ont1(myOntology.java:482)
at version1.myOntology.main(myOntology.java:47)

Code:

import edu.stanford.smi.protegex.owl.model.OWLModel;
import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
import edu.stanford.smi.protegex.owl.model.*;
import edu.stanford.smi.protegex.owl.model.OWLObjectProperty;
import edu.stanford.smi.protege.exception.OntologyLoadException;
import edu.stanford.smi.protegex.owl.ProtegeOWL;
import edu.stanford.smi.protegex.owl.ui.properties.*;
import edu.stanford.smi.protegex.owl.model.ProtegeSlot;
import edu.stanford.smi.protege.exception.OntologyLoadException;
import edu.stanford.smi.protegex.owl.jena.*;
import edu.stanford.smi.protegex.owl.jena.JenaOWLModel;

public class myOntology {
public static void main(String args[]){ 
OWLModel owlModel = ProtegeOWL.createJenaOWLModel();
owlModel.getNamespaceManager().setDefaultNamespace("http://www.test.com#");
OWLNamedClass mythings = owlModel.createOWLNamedClass("mythings");
OWLNamedClass animal = owlModel.createOWLNamedSubclass("Animals",mythings);
OWLNamedClass human = owlModel.createOWLNamedSubclass("humans",mythings);
mythings.setSubclassesDisjoint(true);
}
}



Thanks,
AB


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Error using setSubclassesDisjoint

samsontu
Hi,

http://protege.stanford.edu/plugins/owl/protege#subclassesDisjoint was used in the implementation of Protege 3.x OWL plugin. 

I am not sure whether anyone would remember much about the Protege 3.x OWL API that you are using. I’d strongly encourage you to use the OWL API to manage your ontologies. You can find documentation on Github [1].

Samson





On Jun 2, 2017, at 8:00 AM, Anurag Bhavsar <[hidden email]> wrote:

Hello,

I am getting below error when I am trying to make all sub-classes of my super class disjoint.

Exception in thread "main" java.lang.RuntimeException: Could not find slot http://protege.stanford.edu/plugins/owl/protege#subclassesDisjoint
at edu.stanford.smi.protegex.owl.model.impl.DefaultOWLNamedClass.setSubclassesDisjoint(Unknown Source)
at version1.myOntology.ont1(myOntology.java:482)
at version1.myOntology.main(myOntology.java:47)

Code:

import edu.stanford.smi.protegex.owl.model.OWLModel;
import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
import edu.stanford.smi.protegex.owl.model.*;
import edu.stanford.smi.protegex.owl.model.OWLObjectProperty;
import edu.stanford.smi.protege.exception.OntologyLoadException;
import edu.stanford.smi.protegex.owl.ProtegeOWL;
import edu.stanford.smi.protegex.owl.ui.properties.*;
import edu.stanford.smi.protegex.owl.model.ProtegeSlot;
import edu.stanford.smi.protege.exception.OntologyLoadException;
import edu.stanford.smi.protegex.owl.jena.*;
import edu.stanford.smi.protegex.owl.jena.JenaOWLModel;

public class myOntology {
public static void main(String args[]){ 
OWLModel owlModel = ProtegeOWL.createJenaOWLModel();
owlModel.getNamespaceManager().setDefaultNamespace("http://www.test.com#");
OWLNamedClass mythings = owlModel.createOWLNamedClass("mythings");
OWLNamedClass animal = owlModel.createOWLNamedSubclass("Animals",mythings);
OWLNamedClass human = owlModel.createOWLNamedSubclass("humans",mythings);
mythings.setSubclassesDisjoint(true);
}
}



Thanks,
AB

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Error using setSubclassesDisjoint

Anurag Bhavsar
Hey Samson,

The reason I am using protege 3.X OWL API plugin is because there is not much reference code available for OWL api using JAVA, especially creating Ontology in Java not loading a pre-existing ontology.

Please let me know if you could share any codes that you have for reference.

Thanks,
Anurag

On Fri, Jun 2, 2017 at 9:22 AM, Samson Tu <[hidden email]> wrote:
Hi,

http://protege.stanford.edu/plugins/owl/protege#subclassesDisjoint was used in the implementation of Protege 3.x OWL plugin. 

I am not sure whether anyone would remember much about the Protege 3.x OWL API that you are using. I’d strongly encourage you to use the OWL API to manage your ontologies. You can find documentation on Github [1].

Samson





On Jun 2, 2017, at 8:00 AM, Anurag Bhavsar <[hidden email]> wrote:

Hello,

I am getting below error when I am trying to make all sub-classes of my super class disjoint.

Exception in thread "main" java.lang.RuntimeException: Could not find slot http://protege.stanford.edu/plugins/owl/protege#subclassesDisjoint
at edu.stanford.smi.protegex.owl.model.impl.DefaultOWLNamedClass.setSubclassesDisjoint(Unknown Source)
at version1.myOntology.ont1(myOntology.java:482)
at version1.myOntology.main(myOntology.java:47)

Code:

import edu.stanford.smi.protegex.owl.model.OWLModel;
import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
import edu.stanford.smi.protegex.owl.model.*;
import edu.stanford.smi.protegex.owl.model.OWLObjectProperty;
import edu.stanford.smi.protege.exception.OntologyLoadException;
import edu.stanford.smi.protegex.owl.ProtegeOWL;
import edu.stanford.smi.protegex.owl.ui.properties.*;
import edu.stanford.smi.protegex.owl.model.ProtegeSlot;
import edu.stanford.smi.protege.exception.OntologyLoadException;
import edu.stanford.smi.protegex.owl.jena.*;
import edu.stanford.smi.protegex.owl.jena.JenaOWLModel;

public class myOntology {
public static void main(String args[]){ 
OWLModel owlModel = ProtegeOWL.createJenaOWLModel();
owlModel.getNamespaceManager().setDefaultNamespace("http://www.test.com#");
OWLNamedClass mythings = owlModel.createOWLNamedClass("mythings");
OWLNamedClass animal = owlModel.createOWLNamedSubclass("Animals",mythings);
OWLNamedClass human = owlModel.createOWLNamedSubclass("humans",mythings);
mythings.setSubclassesDisjoint(true);
}
}



Thanks,
AB

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user



_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Error using setSubclassesDisjoint

samsontu

On Jun 2, 2017, at 8:29 AM, Anurag Bhavsar <[hidden email]> wrote:

Hey Samson,

The reason I am using protege 3.X OWL API plugin is because there is not much reference code available for OWL api using JAVA, especially creating Ontology in Java not loading a pre-existing ontology.

There are a lot of OWL API code examples. For creating an empty ontology, see [1].

With best regards,
Samson







Please let me know if you could share any codes that you have for reference.

Thanks,
Anurag

On Fri, Jun 2, 2017 at 9:22 AM, Samson Tu <[hidden email]> wrote:
Hi,

http://protege.stanford.edu/plugins/owl/protege#subclassesDisjoint was used in the implementation of Protege 3.x OWL plugin. 

I am not sure whether anyone would remember much about the Protege 3.x OWL API that you are using. I’d strongly encourage you to use the OWL API to manage your ontologies. You can find documentation on Github [1].

Samson





On Jun 2, 2017, at 8:00 AM, Anurag Bhavsar <[hidden email]> wrote:

Hello,

I am getting below error when I am trying to make all sub-classes of my super class disjoint.

Exception in thread "main" java.lang.RuntimeException: Could not find slot http://protege.stanford.edu/plugins/owl/protege#subclassesDisjoint
at edu.stanford.smi.protegex.owl.model.impl.DefaultOWLNamedClass.setSubclassesDisjoint(Unknown Source)
at version1.myOntology.ont1(myOntology.java:482)
at version1.myOntology.main(myOntology.java:47)

Code:

import edu.stanford.smi.protegex.owl.model.OWLModel;
import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
import edu.stanford.smi.protegex.owl.model.*;
import edu.stanford.smi.protegex.owl.model.OWLObjectProperty;
import edu.stanford.smi.protege.exception.OntologyLoadException;
import edu.stanford.smi.protegex.owl.ProtegeOWL;
import edu.stanford.smi.protegex.owl.ui.properties.*;
import edu.stanford.smi.protegex.owl.model.ProtegeSlot;
import edu.stanford.smi.protege.exception.OntologyLoadException;
import edu.stanford.smi.protegex.owl.jena.*;
import edu.stanford.smi.protegex.owl.jena.JenaOWLModel;

public class myOntology {
public static void main(String args[]){ 
OWLModel owlModel = ProtegeOWL.createJenaOWLModel();
owlModel.getNamespaceManager().setDefaultNamespace("http://www.test.com#");
OWLNamedClass mythings = owlModel.createOWLNamedClass("mythings");
OWLNamedClass animal = owlModel.createOWLNamedSubclass("Animals",mythings);
OWLNamedClass human = owlModel.createOWLNamedSubclass("humans",mythings);
mythings.setSubclassesDisjoint(true);
}
}



Thanks,
AB

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: 1-650-725-3391
Stanford University                                          fax: 1-650-725-7944




_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Error using setSubclassesDisjoint

Anurag Bhavsar
Thanks for your reply. But even these examples dont have a way to make all sub classes disjoint.

On Fri, Jun 2, 2017 at 10:08 AM, Samson Tu <[hidden email]> wrote:

On Jun 2, 2017, at 8:29 AM, Anurag Bhavsar <[hidden email]> wrote:

Hey Samson,

The reason I am using protege 3.X OWL API plugin is because there is not much reference code available for OWL api using JAVA, especially creating Ontology in Java not loading a pre-existing ontology.

There are a lot of OWL API code examples. For creating an empty ontology, see [1].

With best regards,
Samson







Please let me know if you could share any codes that you have for reference.

Thanks,
Anurag

On Fri, Jun 2, 2017 at 9:22 AM, Samson Tu <[hidden email]> wrote:
Hi,

http://protege.stanford.edu/plugins/owl/protege#subclassesDisjoint was used in the implementation of Protege 3.x OWL plugin. 

I am not sure whether anyone would remember much about the Protege 3.x OWL API that you are using. I’d strongly encourage you to use the OWL API to manage your ontologies. You can find documentation on Github [1].

Samson





On Jun 2, 2017, at 8:00 AM, Anurag Bhavsar <[hidden email]> wrote:

Hello,

I am getting below error when I am trying to make all sub-classes of my super class disjoint.

Exception in thread "main" java.lang.RuntimeException: Could not find slot http://protege.stanford.edu/plugins/owl/protege#subclassesDisjoint
at edu.stanford.smi.protegex.owl.model.impl.DefaultOWLNamedClass.setSubclassesDisjoint(Unknown Source)
at version1.myOntology.ont1(myOntology.java:482)
at version1.myOntology.main(myOntology.java:47)

Code:

import edu.stanford.smi.protegex.owl.model.OWLModel;
import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
import edu.stanford.smi.protegex.owl.model.*;
import edu.stanford.smi.protegex.owl.model.OWLObjectProperty;
import edu.stanford.smi.protege.exception.OntologyLoadException;
import edu.stanford.smi.protegex.owl.ProtegeOWL;
import edu.stanford.smi.protegex.owl.ui.properties.*;
import edu.stanford.smi.protegex.owl.model.ProtegeSlot;
import edu.stanford.smi.protege.exception.OntologyLoadException;
import edu.stanford.smi.protegex.owl.jena.*;
import edu.stanford.smi.protegex.owl.jena.JenaOWLModel;

public class myOntology {
public static void main(String args[]){ 
OWLModel owlModel = ProtegeOWL.createJenaOWLModel();
owlModel.getNamespaceManager().setDefaultNamespace("http://www.test.com#");
OWLNamedClass mythings = owlModel.createOWLNamedClass("mythings");
OWLNamedClass animal = owlModel.createOWLNamedSubclass("Animals",mythings);
OWLNamedClass human = owlModel.createOWLNamedSubclass("humans",mythings);
mythings.setSubclassesDisjoint(true);
}
}



Thanks,
AB

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: <a href="tel:(650)%20725-3391" value="+16507253391" target="_blank">1-650-725-3391
Stanford University                                          fax: <a href="tel:(650)%20725-7944" value="+16507257944" target="_blank">1-650-725-7944




_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user



_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Error using setSubclassesDisjoint

Balhoff, James Patrick
You can use:


then



Best regards,
Jim


On Jun 2, 2017, at 12:44 PM, Anurag Bhavsar <[hidden email]> wrote:

Thanks for your reply. But even these examples dont have a way to make all sub classes disjoint.

On Fri, Jun 2, 2017 at 10:08 AM, Samson Tu <[hidden email]> wrote:

On Jun 2, 2017, at 8:29 AM, Anurag Bhavsar <[hidden email]> wrote:

Hey Samson,

The reason I am using protege 3.X OWL API plugin is because there is not much reference code available for OWL api using JAVA, especially creating Ontology in Java not loading a pre-existing ontology.

There are a lot of OWL API code examples. For creating an empty ontology, see [1].

With best regards,
Samson







Please let me know if you could share any codes that you have for reference.

Thanks,
Anurag

On Fri, Jun 2, 2017 at 9:22 AM, Samson Tu <[hidden email]> wrote:
Hi,

http://protege.stanford.edu/plugins/owl/protege#subclassesDisjoint was used in the implementation of Protege 3.x OWL plugin. 

I am not sure whether anyone would remember much about the Protege 3.x OWL API that you are using. I’d strongly encourage you to use the OWL API to manage your ontologies. You can find documentation on Github [1].

Samson





On Jun 2, 2017, at 8:00 AM, Anurag Bhavsar <[hidden email]> wrote:

Hello,

I am getting below error when I am trying to make all sub-classes of my super class disjoint.

Exception in thread "main" java.lang.RuntimeException: Could not find slot http://protege.stanford.edu/plugins/owl/protege#subclassesDisjoint
at edu.stanford.smi.protegex.owl.model.impl.DefaultOWLNamedClass.setSubclassesDisjoint(Unknown Source)
at version1.myOntology.ont1(myOntology.java:482)
at version1.myOntology.main(myOntology.java:47)

Code:

import edu.stanford.smi.protegex.owl.model.OWLModel;
import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
import edu.stanford.smi.protegex.owl.model.*;
import edu.stanford.smi.protegex.owl.model.OWLObjectProperty;
import edu.stanford.smi.protege.exception.OntologyLoadException;
import edu.stanford.smi.protegex.owl.ProtegeOWL;
import edu.stanford.smi.protegex.owl.ui.properties.*;
import edu.stanford.smi.protegex.owl.model.ProtegeSlot;
import edu.stanford.smi.protege.exception.OntologyLoadException;
import edu.stanford.smi.protegex.owl.jena.*;
import edu.stanford.smi.protegex.owl.jena.JenaOWLModel;

public class myOntology {
public static void main(String args[]){ 
OWLModel owlModel = ProtegeOWL.createJenaOWLModel();
owlModel.getNamespaceManager().setDefaultNamespace("http://www.test.com#");
OWLNamedClass mythings = owlModel.createOWLNamedClass("mythings");
OWLNamedClass animal = owlModel.createOWLNamedSubclass("Animals",mythings);
OWLNamedClass human = owlModel.createOWLNamedSubclass("humans",mythings);
mythings.setSubclassesDisjoint(true);
}
}



Thanks,
AB

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: <a href="tel:(650)%20725-3391" value="&#43;16507253391" target="_blank" class=""> 1-650-725-3391
Stanford University                                          fax: <a href="tel:(650)%20725-7944" value="&#43;16507257944" target="_blank" class=""> 1-650-725-7944




_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Error using setSubclassesDisjoint

Anurag Bhavsar
Hey James,

Thanks I looked at the URL's you mentioned, but I wonder how can we use the get mehtods to make a set of subclasses disjoint in one go.

Thanks,
Anurag

On Fri, Jun 2, 2017 at 11:10 AM, James Balhoff <[hidden email]> wrote:
You can use:


then



Best regards,
Jim


On Jun 2, 2017, at 12:44 PM, Anurag Bhavsar <[hidden email]> wrote:

Thanks for your reply. But even these examples dont have a way to make all sub classes disjoint.

On Fri, Jun 2, 2017 at 10:08 AM, Samson Tu <[hidden email]> wrote:

On Jun 2, 2017, at 8:29 AM, Anurag Bhavsar <[hidden email]> wrote:

Hey Samson,

The reason I am using protege 3.X OWL API plugin is because there is not much reference code available for OWL api using JAVA, especially creating Ontology in Java not loading a pre-existing ontology.

There are a lot of OWL API code examples. For creating an empty ontology, see [1].

With best regards,
Samson







Please let me know if you could share any codes that you have for reference.

Thanks,
Anurag

On Fri, Jun 2, 2017 at 9:22 AM, Samson Tu <[hidden email]> wrote:
Hi,

http://protege.stanford.edu/plugins/owl/protege#subclassesDisjoint was used in the implementation of Protege 3.x OWL plugin. 

I am not sure whether anyone would remember much about the Protege 3.x OWL API that you are using. I’d strongly encourage you to use the OWL API to manage your ontologies. You can find documentation on Github [1].

Samson





On Jun 2, 2017, at 8:00 AM, Anurag Bhavsar <[hidden email]> wrote:

Hello,

I am getting below error when I am trying to make all sub-classes of my super class disjoint.

Exception in thread "main" java.lang.RuntimeException: Could not find slot http://protege.stanford.edu/plugins/owl/protege#subclassesDisjoint
at edu.stanford.smi.protegex.owl.model.impl.DefaultOWLNamedClass.setSubclassesDisjoint(Unknown Source)
at version1.myOntology.ont1(myOntology.java:482)
at version1.myOntology.main(myOntology.java:47)

Code:

import edu.stanford.smi.protegex.owl.model.OWLModel;
import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
import edu.stanford.smi.protegex.owl.model.*;
import edu.stanford.smi.protegex.owl.model.OWLObjectProperty;
import edu.stanford.smi.protege.exception.OntologyLoadException;
import edu.stanford.smi.protegex.owl.ProtegeOWL;
import edu.stanford.smi.protegex.owl.ui.properties.*;
import edu.stanford.smi.protegex.owl.model.ProtegeSlot;
import edu.stanford.smi.protege.exception.OntologyLoadException;
import edu.stanford.smi.protegex.owl.jena.*;
import edu.stanford.smi.protegex.owl.jena.JenaOWLModel;

public class myOntology {
public static void main(String args[]){ 
OWLModel owlModel = ProtegeOWL.createJenaOWLModel();
owlModel.getNamespaceManager().setDefaultNamespace("http://www.test.com#");
OWLNamedClass mythings = owlModel.createOWLNamedClass("mythings");
OWLNamedClass animal = owlModel.createOWLNamedSubclass("Animals",mythings);
OWLNamedClass human = owlModel.createOWLNamedSubclass("humans",mythings);
mythings.setSubclassesDisjoint(true);
}
}



Thanks,
AB

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: <a href="tel:(650)%20725-3391" value="+16507253391" target="_blank"> 1-650-725-3391
Stanford University                                          fax: <a href="tel:(650)%20725-7944" value="+16507257944" target="_blank"> 1-650-725-7944




_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user



_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Error using setSubclassesDisjoint

Lorenz Buehmann
As he explained, create an OWLDisjointClassesAxiom with the set of subclasses

Hey James,

Thanks I looked at the URL's you mentioned, but I wonder how can we use the get mehtods to make a set of subclasses disjoint in one go.

Thanks,
Anurag

On Fri, Jun 2, 2017 at 11:10 AM, James Balhoff <[hidden email]> wrote:
You can use:


then



Best regards,
Jim


On Jun 2, 2017, at 12:44 PM, Anurag Bhavsar <[hidden email]> wrote:

Thanks for your reply. But even these examples dont have a way to make all sub classes disjoint.

On Fri, Jun 2, 2017 at 10:08 AM, Samson Tu <[hidden email]> wrote:

On Jun 2, 2017, at 8:29 AM, Anurag Bhavsar <[hidden email]> wrote:

Hey Samson,

The reason I am using protege 3.X OWL API plugin is because there is not much reference code available for OWL api using JAVA, especially creating Ontology in Java not loading a pre-existing ontology.

There are a lot of OWL API code examples. For creating an empty ontology, see [1].

With best regards,
Samson







Please let me know if you could share any codes that you have for reference.

Thanks,
Anurag

On Fri, Jun 2, 2017 at 9:22 AM, Samson Tu <[hidden email]> wrote:
Hi,

http://protege.stanford.edu/plugins/owl/protege#subclassesDisjoint was used in the implementation of Protege 3.x OWL plugin. 

I am not sure whether anyone would remember much about the Protege 3.x OWL API that you are using. I’d strongly encourage you to use the OWL API to manage your ontologies. You can find documentation on Github [1].

Samson





On Jun 2, 2017, at 8:00 AM, Anurag Bhavsar <[hidden email]> wrote:

Hello,

I am getting below error when I am trying to make all sub-classes of my super class disjoint.

Exception in thread "main" java.lang.RuntimeException: Could not find slot http://protege.stanford.edu/plugins/owl/protege#subclassesDisjoint
at edu.stanford.smi.protegex.owl.model.impl.DefaultOWLNamedClass.setSubclassesDisjoint(Unknown Source)
at version1.myOntology.ont1(myOntology.java:482)
at version1.myOntology.main(myOntology.java:47)

Code:

import edu.stanford.smi.protegex.owl.model.OWLModel;
import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
import edu.stanford.smi.protegex.owl.model.*;
import edu.stanford.smi.protegex.owl.model.OWLObjectProperty;
import edu.stanford.smi.protege.exception.OntologyLoadException;
import edu.stanford.smi.protegex.owl.ProtegeOWL;
import edu.stanford.smi.protegex.owl.ui.properties.*;
import edu.stanford.smi.protegex.owl.model.ProtegeSlot;
import edu.stanford.smi.protege.exception.OntologyLoadException;
import edu.stanford.smi.protegex.owl.jena.*;
import edu.stanford.smi.protegex.owl.jena.JenaOWLModel;

public class myOntology {
public static void main(String args[]){ 
OWLModel owlModel = ProtegeOWL.createJenaOWLModel();
owlModel.getNamespaceManager().setDefaultNamespace("http://www.test.com#");
OWLNamedClass mythings = owlModel.createOWLNamedClass("mythings");
OWLNamedClass animal = owlModel.createOWLNamedSubclass("Animals",mythings);
OWLNamedClass human = owlModel.createOWLNamedSubclass("humans",mythings);
mythings.setSubclassesDisjoint(true);
}
}



Thanks,
AB

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: <a href="tel:%28650%29%20725-3391" value="+16507253391" target="_blank" moz-do-not-send="true"> 1-650-725-3391
Stanford University                                          fax: <a href="tel:%28650%29%20725-7944" value="+16507257944" target="_blank" moz-do-not-send="true"> 1-650-725-7944




_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user




_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user