Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-discussion] Create java beans from Protege

Csongor Nyulas csongor.nyulas at
Mon Sep 15 17:44:29 PDT 2008

Hi John,

The code generated by the Protege OWL Java Code Generator is "Java 
bean-like", i.e. although it does not treat boolean datatype properties 
specially, creating isProperty() methods, it will create getProperty and 
setProperty() methods for all properties, including for boolean datatype 
For example, if your class X has 3 properties associated through 
restrictions, let's say isRound (of type boolean), floatValue (of type 
float), hasSrtingValue (of type String), then the code generator will 
indeed create the methods:

Please be aware that the above functions take/return values of the 
specified types of the datatype properties if and only if the above 
properties are declared _functional_. Otherwise they take as argument 
resp. return a collection of boolean/float/String values.

In order the generated API to offer a more complete set of accessing 
functions to the underlying ontological model there are also some other 
convenience methods generated for each property, like the method 
hasProperty(), and for non-functional properties also addProperty(), 
removeProperty() and listProperty(). In the current implemention there 
is no option for disabling the generation of these additional methods, 
and I would recommend to simply ignore them. If this is not possible in 
your case you can change the Protege OWL Java Code Generator (available 
in the SVN repository of the Protege 
to generate only the methods that you need.

I hope this helps,

John Chrysakis wrote:
> Yes, but this feature does not create java bean classes. I need just 
> an automatic way,
> to get all boolean datatype propertes and create the corresponding 
> isProperty() methods and
> the getProperty() setProperty() methods for the rest of the ontology 
> properties...
> any help?
> Many thanks,
> ,,John,,
> On Fri, Sep 12, 2008 at 7:32 PM, Csongor Nyulas 
> <csongor.nyulas at <mailto:csongor.nyulas at>> wrote:
>     Have you tried the Protege OWL Java code generator accessible through
>     the menu:
>     Code -> Generate Protege-OWL Java Code ?
>     Csongor
>     John Chrysakis wrote:
>     > Hello to everybody,
>     >
>     > I am looking for a way to create java beans from Protege.
>     >
>     > OntologyBeanGenerator is suitable for Jase Use. But I need something
>     > more generic and simple.
>     >
>     > I found Jsave (
>     but it
>     > didn't work
>     > for my project files.
>     >
>     > Any ideas?
>     >
>     > Thanks in advance!
>     >
>     ------------------------------------------------------------------------
>     >
>     > _______________________________________________
>     > protege-discussion mailing list
>     > protege-discussion at
>     <mailto:protege-discussion at>
>     >
>     >
>     > Instructions for unsubscribing:
>     >
>     _______________________________________________
>     protege-discussion mailing list
>     protege-discussion at
>     <mailto:protege-discussion at>
>     Instructions for unsubscribing:
> ------------------------------------------------------------------------
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at
> Instructions for unsubscribing: 

More information about the protege-discussion mailing list