How to generate code from an Ontology?

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

How to generate code from an Ontology?

jabbarshah
Hi

Hope you are fine. I am learning from the Pizza Ontology example.
I have a question on how to generate code (file attached Pizza code) from the created ontology (image attached) in Protege.


Thank you
Best Regards,
Jabbar

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

Pizza code.txt (222K) Download Attachment
SnapPizza.jpg (226K) Download Attachment
MBA
Reply | Threaded
Open this post in threaded view
|

Re: How to generate code from an Ontology?

MBA
Hi Jabbar, are you saying how to generate the OWL code?




On Wed, May 20, 2020 at 10:13 PM Jabbar Shah <[hidden email]> wrote:
Hi

Hope you are fine. I am learning from the Pizza Ontology example.
I have a question on how to generate code (file attached Pizza code) from the created ontology (image attached) in Protege.


Thank you
Best Regards,
Jabbar
_______________________________________________
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: How to generate code from an Ontology?

jabbarshah
Hello,
Yeah OWL code.

From: protege-user <[hidden email]> on behalf of Mauricio Almeida <[hidden email]>
Sent: Thursday, May 21, 2020 1:17 AM
To: User support for WebProtege and Protege Desktop <[hidden email]>
Subject: Re: [protege-user] How to generate code from an Ontology?
 
Hi Jabbar, are you saying how to generate the OWL code?




On Wed, May 20, 2020 at 10:13 PM Jabbar Shah <[hidden email]> wrote:
Hi

Hope you are fine. I am learning from the Pizza Ontology example.
I have a question on how to generate code (file attached Pizza code) from the created ontology (image attached) in Protege.


Thank you
Best Regards,
Jabbar
_______________________________________________
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: How to generate code from an Ontology?

Michael DeBellis-2
In reply to this post by jabbarshah
The "Pizza code" file (at least from a quick glance) like it is in RDF/XML format. That is the default format for saving an ontology. But somehow the extension is ".txt" Change the extension to ".owl" and it should work. What Protege does for you is to change the code for the ontology as you make edits in the GUI. It's like a word processor where you see one thing on the screen but underneath it's a format like rtf. You should just be able to do a normal save and save it to the rdf/xml format. 

On Wed, May 20, 2020 at 6:13 PM Jabbar Shah <[hidden email]> wrote:
Hi

Hope you are fine. I am learning from the Pizza Ontology example.
I have a question on how to generate code (file attached Pizza code) from the created ontology (image attached) in Protege.


Thank you
Best Regards,
Jabbar
_______________________________________________
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: How to generate code from an Ontology?

Bushra
In reply to this post by jabbarshah
For Java code generation you need to start some Reasoner ( check menu bar options for this)
Then from Tools tab select Generate Java Code. A dialogue box will appear. Fill in the names for your package and ontology factory.
Check the option " use reasoner" at the bottom of this dialogue box.

The code will be generated and saved in protege installation folder.
Then import that code in your eclipse project for further use. 

Hope this helps. 

On Thu, May 21, 2020, 6:13 AM Jabbar Shah <[hidden email]> wrote:
Hi

Hope you are fine. I am learning from the Pizza Ontology example.
I have a question on how to generate code (file attached Pizza code) from the created ontology (image attached) in Protege.


Thank you
Best Regards,
Jabbar
_______________________________________________
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
MBA
Reply | Threaded
Open this post in threaded view
|

Re: How to generate code from an Ontology?

MBA
In reply to this post by jabbarshah
I suppose the most basic way to do this is to use the menu "file -> save as" and choose "RDF/ XML Syntax". After this, just give a name for you file and the path in your computer.
If I understand your question, maybe it helps.



On Wed, May 20, 2020 at 10:19 PM Jabbar Shah <[hidden email]> wrote:
Hello,
Yeah OWL code.

From: protege-user <[hidden email]> on behalf of Mauricio Almeida <[hidden email]>
Sent: Thursday, May 21, 2020 1:17 AM
To: User support for WebProtege and Protege Desktop <[hidden email]>
Subject: Re: [protege-user] How to generate code from an Ontology?
 
Hi Jabbar, are you saying how to generate the OWL code?




On Wed, May 20, 2020 at 10:13 PM Jabbar Shah <[hidden email]> wrote:
Hi

Hope you are fine. I am learning from the Pizza Ontology example.
I have a question on how to generate code (file attached Pizza code) from the created ontology (image attached) in Protege.


Thank you
Best Regards,
Jabbar
_______________________________________________
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: How to generate code from an Ontology?

Michael DeBellis-2
In reply to this post by Bushra
Bushra, I think that Jabbar was asking about how to save the code for the owl file itself, i.e., in RDF/XML Turtle, etc. However, if he was asking about generating Java code, my understanding is that the Generate Java Code menu option although it still seems to work is not supported and not recommended and that instead it is recommended to use something like the Apache Jena library or some other library where you can read in an owl file and process it. At least that is what I recall was the answer I received a while back when I was trying to use that option. . 

Cheers,
Michael

On Wed, May 20, 2020 at 6:25 PM Bushra Abro <[hidden email]> wrote:
For Java code generation you need to start some Reasoner ( check menu bar options for this)
Then from Tools tab select Generate Java Code. A dialogue box will appear. Fill in the names for your package and ontology factory.
Check the option " use reasoner" at the bottom of this dialogue box.

The code will be generated and saved in protege installation folder.
Then import that code in your eclipse project for further use. 

Hope this helps. 

On Thu, May 21, 2020, 6:13 AM Jabbar Shah <[hidden email]> wrote:
Hi

Hope you are fine. I am learning from the Pizza Ontology example.
I have a question on how to generate code (file attached Pizza code) from the created ontology (image attached) in Protege.


Thank you
Best Regards,
Jabbar
_______________________________________________
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