Plugin: how to get the "green circle +" to work for classes instead of instances

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

Plugin: how to get the "green circle +" to work for classes instead of instances

kcason

Hi!

 

I wrote a Protégé plugin that only allows adding a custom subclass axiom after a user selects an individual for the class we want to subclass. This is because the individual selected is part of the subclass expression and must be known ahead of time. For example: if the user selects class System and individual i_My_System then the plugin will create:

System is subclass of (i_My_System hasArms atLeastTwo). This is simplified but hopefully explains my point. This works and the saints rejoice.

 

But, I copied this code for another plugin that I thought required the individual to be known but actually only relies on knowing the class. As long as the user selects a class they should be able to click on the green circle with a plus sign in it and edit the class. But since the code was written to require an individual the green plus button does nothing until an individual is selected.

 

How can I get the green plus button to work for a class instead of an individual? I can supply pictures if that would help explain the situation.

 

Thanks,

 

-Kenny Cason, CISSP

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: Plugin: how to get the "green circle +" to work for classes instead of instances

Csongor Nyulas
Administrator
Hi Kenny,

I am not sure I follow what you are trying to do. Some screen shots would definitely help.
Also, in case your code is public, it would help if we could get a link to the source code repository.

Csongor


On 4/19/19 12:18 PM, Kenny Cason wrote:

Hi!

 

I wrote a Protégé plugin that only allows adding a custom subclass axiom after a user selects an individual for the class we want to subclass. This is because the individual selected is part of the subclass expression and must be known ahead of time. For example: if the user selects class System and individual i_My_System then the plugin will create:

System is subclass of (i_My_System hasArms atLeastTwo). This is simplified but hopefully explains my point. This works and the saints rejoice.

 

But, I copied this code for another plugin that I thought required the individual to be known but actually only relies on knowing the class. As long as the user selects a class they should be able to click on the green circle with a plus sign in it and edit the class. But since the code was written to require an individual the green plus button does nothing until an individual is selected.

 

How can I get the green plus button to work for a class instead of an individual? I can supply pictures if that would help explain the situation.

 

Thanks,

 

-Kenny Cason, CISSP

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


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

Re: Plugin: how to get the "green circle +" to work for classes instead of instances

kcason

Here is a visual that may better explain what I am trying to do.

This is what works:

 

1.       Click on Country class to see it’s individuals

2.       Click on France individual, which activates the + button in 3

3.       Click on the + button and up pops the input form

 

 

This plugin is based off a previous plugin that required an individual to be selected (2) before activating the + button in (3) above.

------------------------------------------------------

Now what I want to do is:

 

1.       Click on Country class, which activates the + button in 3

2.       Click on France individual, which activates the + button in 3

3.       Click on the + button and up pops the input form

 

In other words, I don’t need to select an individual. I want the + button to activate when a class is selected.

 

The plugin is base off a standard Protégé view that is declared as such:

 

public class OWLObjectPropertyAssertionAxiomFrameSection extends AbstractOWLFrameSection<OWLIndividual, OWLObjectPropertyAssertionAxiom, OWLObjectPropertyIndividualPair> {…

 

Please let me know if this makes sense to you and if you have a solution.

Thanks!

 

-Kenny

 

From: protege-dev <[hidden email]> On Behalf Of Csongor Nyulas
Sent: Friday, April 19, 2019 5:12 PM
To: [hidden email]
Subject: Re: [protege-dev] Plugin: how to get the "green circle +" to work for classes instead of instances

 

CAUTION: External Email



Hi Kenny,

I am not sure I follow what you are trying to do. Some screen shots would definitely help.
Also, in case your code is public, it would help if we could get a link to the source code repository.

Csongor

On 4/19/19 12:18 PM, Kenny Cason wrote:

Hi!

 

I wrote a Protégé plugin that only allows adding a custom subclass axiom after a user selects an individual for the class we want to subclass. This is because the individual selected is part of the subclass expression and must be known ahead of time. For example: if the user selects class System and individual i_My_System then the plugin will create:

System is subclass of (i_My_System hasArms atLeastTwo). This is simplified but hopefully explains my point. This works and the saints rejoice.

 

But, I copied this code for another plugin that I thought required the individual to be known but actually only relies on knowing the class. As long as the user selects a class they should be able to click on the green circle with a plus sign in it and edit the class. But since the code was written to require an individual the green plus button does nothing until an individual is selected.

 

How can I get the green plus button to work for a class instead of an individual? I can supply pictures if that would help explain the situation.

 

Thanks,

 

-Kenny Cason, CISSP

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

 


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

Individual.PNG (74K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Plugin: how to get the "green circle +" to work for classes instead of instances

Csongor Nyulas
Administrator
Hi Kenny,

I think the first thing is to decide if the plug-in you are trying to build is an "individual" plug-in or "class" plug-in. At the moment you are building an "individual" plug-in, which gets activated based on the current individual selection. So if you have no individual selected it makes sense that the + button is not active.

A few things to be clarified: Should the + button be activated also when an individual is selected, and/or show different content (or prefill the dialog) based on what individual is selected, or should the plug-in's content be refreshed based on the selected class? What type of axioms are you trying to create?

My guess is that you don't want to extend any of the existing Protege plug-ins that have specific well-defined functionality already, but rather you want to build a plug-in with a quite unique and very specific functionality, so I would look at extending the abstract org.protege.editor.owl.ui.frame.AbstractOWLFrameSection class, with the appropriate classes specified as the generics (e.g. <OWLIndividual, OWLClassAssertionAxiom, OWLClassExpression>, <OWLClass, OWLAxiom, OWLObjectPropertyIndividualPair>, etc.)

BTW, looking at your editor that pops up, I have no idea what kind of axioms you are trying to create. And why the creation of the axiom is conditional. Are you trying to create SWRL rules perhaps?
FYI, here is how the default SWRL rule editor, which is part of Protege extends AbstractOWLFrameSection:
org.protege.editor.owl.ui.frame.SWRLRulesFrameSection extends AbstractOWLFrameSection<OWLOntology, SWRLRule, SWRLRule>

Csongor

On 4/22/19 8:08 AM, Kenny Cason wrote:

Here is a visual that may better explain what I am trying to do.

This is what works:

 

1.       Click on Country class to see it’s individuals

2.       Click on France individual, which activates the + button in 3

3.       Click on the + button and up pops the input form

 

 

This plugin is based off a previous plugin that required an individual to be selected (2) before activating the + button in (3) above.

------------------------------------------------------

Now what I want to do is:

 

1.       Click on Country class, which activates the + button in 3

2.       Click on France individual, which activates the + button in 3

3.       Click on the + button and up pops the input form

 

In other words, I don’t need to select an individual. I want the + button to activate when a class is selected.

 

The plugin is base off a standard Protégé view that is declared as such:

 

public class OWLObjectPropertyAssertionAxiomFrameSection extends AbstractOWLFrameSection<OWLIndividual, OWLObjectPropertyAssertionAxiom, OWLObjectPropertyIndividualPair> {…

 

Please let me know if this makes sense to you and if you have a solution.

Thanks!

 

-Kenny

 

From: protege-dev [hidden email] On Behalf Of Csongor Nyulas
Sent: Friday, April 19, 2019 5:12 PM
To: [hidden email]
Subject: Re: [protege-dev] Plugin: how to get the "green circle +" to work for classes instead of instances

 

CAUTION: External Email



Hi Kenny,

I am not sure I follow what you are trying to do. Some screen shots would definitely help.
Also, in case your code is public, it would help if we could get a link to the source code repository.

Csongor

On 4/19/19 12:18 PM, Kenny Cason wrote:

Hi!

 

I wrote a Protégé plugin that only allows adding a custom subclass axiom after a user selects an individual for the class we want to subclass. This is because the individual selected is part of the subclass expression and must be known ahead of time. For example: if the user selects class System and individual i_My_System then the plugin will create:

System is subclass of (i_My_System hasArms atLeastTwo). This is simplified but hopefully explains my point. This works and the saints rejoice.

 

But, I copied this code for another plugin that I thought required the individual to be known but actually only relies on knowing the class. As long as the user selects a class they should be able to click on the green circle with a plus sign in it and edit the class. But since the code was written to require an individual the green plus button does nothing until an individual is selected.

 

How can I get the green plus button to work for a class instead of an individual? I can supply pictures if that would help explain the situation.

 

Thanks,

 

-Kenny Cason, CISSP

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

 


_______________________________________________
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: Plugin: how to get the "green circle +" to work for classes instead of instances

kcason

 

 

-Kenny

 

From: protege-dev <[hidden email]> On Behalf Of Csongor Nyulas
Sent: Monday, April 22, 2019 1:02 PM
To: [hidden email]
Subject: Re: [protege-dev] Plugin: how to get the "green circle +" to work for classes instead of instances

 

CAUTION: External Email

Hi Csongor,

This is a “class” plugin. There is no need to select an “individual”, but no harm in doing so. It should simply ignore the individual selected.

I am creating a subclass axiom. The subclass axiom is complicated, based on the fields in the input form/editor. That logic has already been proven.

I took your advice and extended the generic AbstractOWLFrameSection and the declaration looks like this:

public class tempFrameSection extends AbstractOWLFrameSection<OWLClass, OWLClassAxiom, OWLClassAxiom> {

Good News: this brings up a generic editor, although I will have to change the presentation to be my editor. I think I can do that.

Bad News: selecting a class still does not allow clicking the + button. An individual must be selected. L

Is the ability to click the + button granted at the FrameSection, or Frame level, or somewhere else?

-Kenny

 

Hi Kenny,

I think the first thing is to decide if the plug-in you are trying to build is an "individual" plug-in or "class" plug-in. At the moment you are building an "individual" plug-in, which gets activated based on the current individual selection. So if you have no individual selected it makes sense that the + button is not active.

A few things to be clarified: Should the + button be activated also when an individual is selected, and/or show different content (or prefill the dialog) based on what individual is selected, or should the plug-in's content be refreshed based on the selected class? What type of axioms are you trying to create?

My guess is that you don't want to extend any of the existing Protege plug-ins that have specific well-defined functionality already, but rather you want to build a plug-in with a quite unique and very specific functionality, so I would look at extending the abstract org.protege.editor.owl.ui.frame.AbstractOWLFrameSection class, with the appropriate classes specified as the generics (e.g. <OWLIndividual, OWLClassAssertionAxiom, OWLClassExpression>, <OWLClass, OWLAxiom, OWLObjectPropertyIndividualPair>, etc.)

BTW, looking at your editor that pops up, I have no idea what kind of axioms you are trying to create. And why the creation of the axiom is conditional. Are you trying to create SWRL rules perhaps?
FYI, here is how the default SWRL rule editor, which is part of Protege extends AbstractOWLFrameSection:
org.protege.editor.owl.ui.frame.SWRLRulesFrameSection extends AbstractOWLFrameSection<OWLOntology, SWRLRule, SWRLRule>

Csongor

On 4/22/19 8:08 AM, Kenny Cason wrote:

Here is a visual that may better explain what I am trying to do.

This is what works:

 

1.       Click on Country class to see it’s individuals

2.       Click on France individual, which activates the + button in 3

3.       Click on the + button and up pops the input form

 

 

This plugin is based off a previous plugin that required an individual to be selected (2) before activating the + button in (3) above.

------------------------------------------------------

Now what I want to do is:

 

1.       Click on Country class, which activates the + button in 3

2.       Click on France individual, which activates the + button in 3

3.       Click on the + button and up pops the input form

 

In other words, I don’t need to select an individual. I want the + button to activate when a class is selected.

 

The plugin is base off a standard Protégé view that is declared as such:

 

public class OWLObjectPropertyAssertionAxiomFrameSection extends AbstractOWLFrameSection<OWLIndividual, OWLObjectPropertyAssertionAxiom, OWLObjectPropertyIndividualPair> {…

 

Please let me know if this makes sense to you and if you have a solution.

Thanks!

 

-Kenny

 

From: protege-dev [hidden email] On Behalf Of Csongor Nyulas
Sent: Friday, April 19, 2019 5:12 PM
To: [hidden email]
Subject: Re: [protege-dev] Plugin: how to get the "green circle +" to work for classes instead of instances

 

CAUTION: External Email




Hi Kenny,

I am not sure I follow what you are trying to do. Some screen shots would definitely help.
Also, in case your code is public, it would help if we could get a link to the source code repository.

Csongor


On 4/19/19 12:18 PM, Kenny Cason wrote:

Hi!

 

I wrote a Protégé plugin that only allows adding a custom subclass axiom after a user selects an individual for the class we want to subclass. This is because the individual selected is part of the subclass expression and must be known ahead of time. For example: if the user selects class System and individual i_My_System then the plugin will create:

System is subclass of (i_My_System hasArms atLeastTwo). This is simplified but hopefully explains my point. This works and the saints rejoice.

 

But, I copied this code for another plugin that I thought required the individual to be known but actually only relies on knowing the class. As long as the user selects a class they should be able to click on the green circle with a plus sign in it and edit the class. But since the code was written to require an individual the green plus button does nothing until an individual is selected.

 

How can I get the green plus button to work for a class instead of an individual? I can supply pictures if that would help explain the situation.

 

Thanks,

 

-Kenny Cason, CISSP

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

 



_______________________________________________
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: Plugin: how to get the "green circle +" to work for classes instead of instances

kcason

Never mind, I think I got it. The View Component must have an OWLFrameList  of the type you want to activate the + button. For example:

 

public class MyCauseEffectEditorViewComponent extends AbstractOWLClassViewComponent {

 

    /**

     *

     */

    private OWLFrameList<OWLClass> list;

 

-Kenny

 

From: protege-dev <[hidden email]> On Behalf Of Kenny Cason
Sent: Monday, April 22, 2019 3:12 PM
To: Developer support for WebProtege and Protege Desktop <[hidden email]>
Subject: Re: [protege-dev] Plugin: how to get the "green circle +" to work for classes instead of instances

 

CAUTION: External Email



 

 

-Kenny

 

From: protege-dev <[hidden email]> On Behalf Of Csongor Nyulas
Sent: Monday, April 22, 2019 1:02 PM
To: [hidden email]
Subject: Re: [protege-dev] Plugin: how to get the "green circle +" to work for classes instead of instances

 

CAUTION: External Email

Hi Csongor,

This is a “class” plugin. There is no need to select an “individual”, but no harm in doing so. It should simply ignore the individual selected.

I am creating a subclass axiom. The subclass axiom is complicated, based on the fields in the input form/editor. That logic has already been proven.

I took your advice and extended the generic AbstractOWLFrameSection and the declaration looks like this:

public class tempFrameSection extends AbstractOWLFrameSection<OWLClass, OWLClassAxiom, OWLClassAxiom> {

Good News: this brings up a generic editor, although I will have to change the presentation to be my editor. I think I can do that.

Bad News: selecting a class still does not allow clicking the + button. An individual must be selected. L

Is the ability to click the + button granted at the FrameSection, or Frame level, or somewhere else?

-Kenny

 

Hi Kenny,

I think the first thing is to decide if the plug-in you are trying to build is an "individual" plug-in or "class" plug-in. At the moment you are building an "individual" plug-in, which gets activated based on the current individual selection. So if you have no individual selected it makes sense that the + button is not active.

A few things to be clarified: Should the + button be activated also when an individual is selected, and/or show different content (or prefill the dialog) based on what individual is selected, or should the plug-in's content be refreshed based on the selected class? What type of axioms are you trying to create?

My guess is that you don't want to extend any of the existing Protege plug-ins that have specific well-defined functionality already, but rather you want to build a plug-in with a quite unique and very specific functionality, so I would look at extending the abstract org.protege.editor.owl.ui.frame.AbstractOWLFrameSection class, with the appropriate classes specified as the generics (e.g. <OWLIndividual, OWLClassAssertionAxiom, OWLClassExpression>, <OWLClass, OWLAxiom, OWLObjectPropertyIndividualPair>, etc.)

BTW, looking at your editor that pops up, I have no idea what kind of axioms you are trying to create. And why the creation of the axiom is conditional. Are you trying to create SWRL rules perhaps?
FYI, here is how the default SWRL rule editor, which is part of Protege extends AbstractOWLFrameSection:
org.protege.editor.owl.ui.frame.SWRLRulesFrameSection extends AbstractOWLFrameSection<OWLOntology, SWRLRule, SWRLRule>

Csongor

On 4/22/19 8:08 AM, Kenny Cason wrote:

Here is a visual that may better explain what I am trying to do.

This is what works:

 

1.       Click on Country class to see it’s individuals

2.       Click on France individual, which activates the + button in 3

3.       Click on the + button and up pops the input form

 

 

This plugin is based off a previous plugin that required an individual to be selected (2) before activating the + button in (3) above.

------------------------------------------------------

Now what I want to do is:

 

1.       Click on Country class, which activates the + button in 3

2.       Click on France individual, which activates the + button in 3

3.       Click on the + button and up pops the input form

 

In other words, I don’t need to select an individual. I want the + button to activate when a class is selected.

 

The plugin is base off a standard Protégé view that is declared as such:

 

public class OWLObjectPropertyAssertionAxiomFrameSection extends AbstractOWLFrameSection<OWLIndividual, OWLObjectPropertyAssertionAxiom, OWLObjectPropertyIndividualPair> {…

 

Please let me know if this makes sense to you and if you have a solution.

Thanks!

 

-Kenny

 

From: protege-dev [hidden email] On Behalf Of Csongor Nyulas
Sent: Friday, April 19, 2019 5:12 PM
To: [hidden email]
Subject: Re: [protege-dev] Plugin: how to get the "green circle +" to work for classes instead of instances

 

CAUTION: External Email



Hi Kenny,

I am not sure I follow what you are trying to do. Some screen shots would definitely help.
Also, in case your code is public, it would help if we could get a link to the source code repository.

Csongor

On 4/19/19 12:18 PM, Kenny Cason wrote:

Hi!

 

I wrote a Protégé plugin that only allows adding a custom subclass axiom after a user selects an individual for the class we want to subclass. This is because the individual selected is part of the subclass expression and must be known ahead of time. For example: if the user selects class System and individual i_My_System then the plugin will create:

System is subclass of (i_My_System hasArms atLeastTwo). This is simplified but hopefully explains my point. This works and the saints rejoice.

 

But, I copied this code for another plugin that I thought required the individual to be known but actually only relies on knowing the class. As long as the user selects a class they should be able to click on the green circle with a plus sign in it and edit the class. But since the code was written to require an individual the green plus button does nothing until an individual is selected.

 

How can I get the green plus button to work for a class instead of an individual? I can supply pictures if that would help explain the situation.

 

Thanks,

 

-Kenny Cason, CISSP

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

 

 

_______________________________________________
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