Adding a Class Expression similar to the Class Expression Editor

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

Adding a Class Expression similar to the Class Expression Editor

kcason

I want to add the following Class Expression to a known class:

 

(not(hasDog some Dog)) or (hasCat value i_Fluffy)

 

I can build each individual element into OWLClassExpression objects, then create axioms to contain them, then add them to my ontology…

…but the Protégé “Class expression editor” allows me to simply enter the above text, press the Ok button, and all required axioms, etc, are created by Protégé.

 

Is there a Protégé method (or combination of methods) I can call with the above text and have it create all the required axioms and add it to my ontology?

I don’t need a GUI, just a method call in the background of a plugin I’m witting. This would be SO much simpler than trying to create each axiom individually.

I tried dissecting the Class Expression Editor to figure out how it does this but kept going around in circles in the code.

 

Thanks,

 

-Kenny Cason

Radiance Technologies

Cyber Solutions Group

3133 General Hudnell Dr. Ste. 116
San Antonio, TX 78226

[hidden email]

206.550.0049

 


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

Re: Adding a Class Expression similar to the Class Expression Editor

Matthew Horridge-2
Administrator
Hi Kenny,

Take a look at the example here:


It may contain some code (for parsing and input expression) that may be what you’re looking for.

Cheers,

Matthew


On Feb 1, 2019, at 10:25, Kenny Cason <[hidden email]> wrote:

I want to add the following Class Expression to a known class:
 
(not(hasDog some Dog)) or (hasCat value i_Fluffy)
 
I can build each individual element into OWLClassExpression objects, then create axioms to contain them, then add them to my ontology…
…but the Protégé “Class expression editor” allows me to simply enter the above text, press the Ok button, and all required axioms, etc, are created by Protégé.
 
Is there a Protégé method (or combination of methods) I can call with the above text and have it create all the required axioms and add it to my ontology?
I don’t need a GUI, just a method call in the background of a plugin I’m witting. This would be SO much simpler than trying to create each axiom individually.
I tried dissecting the Class Expression Editor to figure out how it does this but kept going around in circles in the code.
 
Thanks,
 
-Kenny Cason
Radiance Technologies
Cyber Solutions Group
3133 General Hudnell Dr. Ste. 116 
San Antonio, TX 78226
<a href="tel:206.550.0049" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">206.550.0049
 
_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev


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

Re: Adding a Class Expression similar to the Class Expression Editor

kcason

That is fabulous! I’ll give it a try.

 

-Kenny

 

From: protege-dev <[hidden email]> On Behalf Of Matthew Horridge
Sent: Friday, February 1, 2019 4:25 PM
To: Developer support for WebProtege and Protege Desktop <[hidden email]>
Subject: Re: [protege-dev] Adding a Class Expression similar to the Class Expression Editor

 

Hi Kenny,

 

Take a look at the example here:

 

 

It may contain some code (for parsing and input expression) that may be what you’re looking for.

 

Cheers,

 

Matthew

 



On Feb 1, 2019, at 10:25, Kenny Cason <[hidden email]> wrote:

 

I want to add the following Class Expression to a known class:

 

(not(hasDog some Dog)) or (hasCat value i_Fluffy)

 

I can build each individual element into OWLClassExpression objects, then create axioms to contain them, then add them to my ontology…

…but the Protégé “Class expression editor” allows me to simply enter the above text, press the Ok button, and all required axioms, etc, are created by Protégé.

 

Is there a Protégé method (or combination of methods) I can call with the above text and have it create all the required axioms and add it to my ontology?

I don’t need a GUI, just a method call in the background of a plugin I’m witting. This would be SO much simpler than trying to create each axiom individually.

I tried dissecting the Class Expression Editor to figure out how it does this but kept going around in circles in the code.

 

Thanks,

 

-Kenny Cason

Radiance Technologies

Cyber Solutions Group

3133 General Hudnell Dr. Ste. 116 
San Antonio, TX 78226

<a href="tel:206.550.0049">206.550.0049

 

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

 


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

Re: Adding a Class Expression similar to the Class Expression Editor

kcason
In reply to this post by kcason

Is there a way to compile and run just this example program for testing? I can use Maven to compile everything but can’t seem to run just this program:

 

$ find . -name Examples.*                                                                                                                                                                                                                                                

./org/semanticweb/owlapi/examples/Examples.class                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                         

kcason@36CRNN2 MINGW64 ~/Desktop/apis/owlapi-version5/contract/target/test-classes                                                                                                                                                                                       

$ java  org.semanticweb.owlapi.examples.Examples                                                                                                                                                                                                                         

java.lang.NoClassDefFoundError: org/semanticweb/owlapi/io/OWLOntologyDocumentTarget                                                                                                                                                                                      

        at java.lang.Class.getDeclaredMethods0(Native Method)                                                                                                                                                                                                            

        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)                                                                                                                                                                                                     

        at java.lang.Class.privateGetMethodRecursive(Unknown Source)                                                                                                                                                                                                     

        at java.lang.Class.getMethod0(Unknown Source)                                                                                                                                                                                                                    

        at java.lang.Class.getMethod(Unknown Source)                                                                                                                                                                                                                     

        at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)                                                                                                                                                                                                 

        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)                                                                                                                                                                                                 

Caused by: java.lang.ClassNotFoundException: org.semanticweb.owlapi.io.OWLOntologyDocumentTarget                                                                                                                                                                        

        at java.net.URLClassLoader.findClass(Unknown Source)                                                                                                                                                                                                            

        at java.lang.ClassLoader.loadClass(Unknown Source)                                                                                                                                                                                                              

        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)                                                                                                                                                                                                   

        at java.lang.ClassLoader.loadClass(Unknown Source)                                                                                                                                                                                                              

        ... 7 more                                                                                                                                                                                                                                                       

Error: A JNI error has occurred, please check your installation and try again                                                                                                                                                                                            

Exception in thread "main"                                                                                                                                                                                                                                               

 

Is there a CLASSPATH variable I’m missing?

 

-Kenny

 

From: protege-dev <[hidden email]> On Behalf Of Kenny Cason
Sent: Friday, February 1, 2019 5:36 PM
To: Developer support for WebProtege and Protege Desktop <[hidden email]>
Subject: Re: [protege-dev] Adding a Class Expression similar to the Class Expression Editor

 

That is fabulous! I’ll give it a try.

 

-Kenny

 

From: protege-dev <[hidden email]> On Behalf Of Matthew Horridge
Sent: Friday, February 1, 2019 4:25 PM
To: Developer support for WebProtege and Protege Desktop <[hidden email]>
Subject: Re: [protege-dev] Adding a Class Expression similar to the Class Expression Editor

 

Hi Kenny,

 

Take a look at the example here:

 

 

It may contain some code (for parsing and input expression) that may be what you’re looking for.

 

Cheers,

 

Matthew

 

 

On Feb 1, 2019, at 10:25, Kenny Cason <[hidden email]> wrote:

 

I want to add the following Class Expression to a known class:

 

(not(hasDog some Dog)) or (hasCat value i_Fluffy)

 

I can build each individual element into OWLClassExpression objects, then create axioms to contain them, then add them to my ontology…

…but the Protégé “Class expression editor” allows me to simply enter the above text, press the Ok button, and all required axioms, etc, are created by Protégé.

 

Is there a Protégé method (or combination of methods) I can call with the above text and have it create all the required axioms and add it to my ontology?

I don’t need a GUI, just a method call in the background of a plugin I’m witting. This would be SO much simpler than trying to create each axiom individually.

I tried dissecting the Class Expression Editor to figure out how it does this but kept going around in circles in the code.

 

Thanks,

 

-Kenny Cason

Radiance Technologies

Cyber Solutions Group

3133 General Hudnell Dr. Ste. 116 
San Antonio, TX 78226

<a href="tel:206.550.0049">206.550.0049

 

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

 


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

Re: Adding a Class Expression similar to the Class Expression Editor

Matthew Horridge-2
Administrator
The example is run as a test case, so it will be run when the tests are executed.

If you want to run the code separately then I’d put it in a main method and use the maven exec plugin [1]

Cheers,

Matthew



On Feb 4, 2019, at 12:19, Kenny Cason <[hidden email]> wrote:

Is there a way to compile and run just this example program for testing? I can use Maven to compile everything but can’t seem to run just this program:
 
$ find . -name Examples.*                                                                                                                                                                                                                                                
./org/semanticweb/owlapi/examples/Examples.class                                                                                                                                                                                                                         
                                                                                                                                                                                                                                                                         
kcason@36CRNN2 MINGW64 ~/Desktop/apis/owlapi-version5/contract/target/test-classes                                                                                                                                                                                       
$ java  org.semanticweb.owlapi.examples.Examples                                                                                                                                                                                                                         
java.lang.NoClassDefFoundError: org/semanticweb/owlapi/io/OWLOntologyDocumentTarget                                                                                                                                                                                      
        at java.lang.Class.getDeclaredMethods0(Native Method)                                                                                                                                                                                                            
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)                                                                                                                                                                                                     
        at java.lang.Class.privateGetMethodRecursive(Unknown Source)                                                                                                                                                                                                     
        at java.lang.Class.getMethod0(Unknown Source)                                                                                                                                                                                                                    
        at java.lang.Class.getMethod(Unknown Source)                                                                                                                                                                                                                     
        at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)                                                                                                                                                                                                 
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)                                                                                                                                                                                                 
Caused by: java.lang.ClassNotFoundException: org.semanticweb.owlapi.io.OWLOntologyDocumentTarget                                                                                                                                                                        
        at java.net.URLClassLoader.findClass(Unknown Source)                                                                                                                                                                                                            
        at java.lang.ClassLoader.loadClass(Unknown Source)                                                                                                                                                                                                              
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)                                                                                                                                                                                                   
        at java.lang.ClassLoader.loadClass(Unknown Source)                                                                                                                                                                                                              
        ... 7 more                                                                                                                                                                                                                                                       
Error: A JNI error has occurred, please check your installation and try again                                                                                                                                                                                            
Exception in thread "main"                                                                                                                                                                                                                                               
 
Is there a CLASSPATH variable I’m missing?
 
-Kenny
 
From: protege-dev <[hidden email]> On Behalf Of Kenny Cason
Sent: Friday, February 1, 2019 5:36 PM
To: Developer support for WebProtege and Protege Desktop <[hidden email]>
Subject: Re: [protege-dev] Adding a Class Expression similar to the Class Expression Editor
 
That is fabulous! I’ll give it a try.
 
-Kenny
 
From: protege-dev <[hidden email]> On Behalf Of Matthew Horridge
Sent: Friday, February 1, 2019 4:25 PM
To: Developer support for WebProtege and Protege Desktop <[hidden email]>
Subject: Re: [protege-dev] Adding a Class Expression similar to the Class Expression Editor
 
Hi Kenny, 
 
Take a look at the example here:
 
 
It may contain some code (for parsing and input expression) that may be what you’re looking for.
 
Cheers,
 
Matthew
 

 

On Feb 1, 2019, at 10:25, Kenny Cason <[hidden email]> wrote:
 
I want to add the following Class Expression to a known class:
 
(not(hasDog some Dog)) or (hasCat value i_Fluffy)
 
I can build each individual element into OWLClassExpression objects, then create axioms to contain them, then add them to my ontology…
…but the Protégé “Class expression editor” allows me to simply enter the above text, press the Ok button, and all required axioms, etc, are created by Protégé.
 
Is there a Protégé method (or combination of methods) I can call with the above text and have it create all the required axioms and add it to my ontology?
I don’t need a GUI, just a method call in the background of a plugin I’m witting. This would be SO much simpler than trying to create each axiom individually.
I tried dissecting the Class Expression Editor to figure out how it does this but kept going around in circles in the code.
 
Thanks,
 
-Kenny Cason
Radiance Technologies
Cyber Solutions Group
3133 General Hudnell Dr. Ste. 116 
San Antonio, TX 78226
<a href="tel:206.550.0049" style="color: purple; text-decoration: underline;" class="">206.550.0049
 
_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
 
_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev


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