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] Programming with Protege-OWL generated code.

Trudy Cool trudy_cool at
Sun May 4 11:19:03 PDT 2008

Dear Protege Group

I've been evaluating Protege as part of an
institutional architecture.

I had expected certain functionality from the
generated Protege-OWL java code that does not
seem to be there.

Here's my test code (my questions follow) ...

---------------- o 0 o ------------------------

public class OWLAPIDemoApplication {

    public static void main(String[] args) {
        Iterator itr;
    	    FileReader rd = new
    	    OWLModel owlModel =

    	    PizzaFactory pf = new
    	    DefaultMargueritaPizza mp =
    	    itr = mp.getHasTopping().iterator();
    	    while (itr.hasNext()) {
    	      System.out.println("Marguerita Pizza
Topping : " +;

    	    DefaultVegetarianPizza vp =

    	    						System.out.println("Shouldn't it
throw an exception here?");

    	    boolean bOk =
    	    						System.out.println("Or is it
allowed? " + bOk + "!");

    	    itr = vp.getHasTopping().iterator();
    	    while (itr.hasNext()) {
    	        System.out.println("Vegetarian Pizza
Topping : " +;
    	  } catch (java.lang.Exception ex) {

---------------- o 0 o ------------------------

Runtime log ...

INFO: Loading triples
INFO: Start processing ontology: Time: Sun
May 04 13:04:37 COT 2008
INFO: [ProtegeOWLParser] Completed triple loading
after 531 ms
INFO: [TripleChangePostProcessor] Completed lists
after 0 ms
INFO: [TripleChangePostProcessor] Completed
anonymous classes after 16 ms
INFO: [TripleChangePostProcessor] Completed
deprecated classes after 0 ms
INFO: [TripleChangePostProcessor] Completed
properties after 16 ms
INFO: [TripleChangePostProcessor] Completed named
classes after 15 ms
INFO: ... Loading completed after 609 ms
Shouldn't it throw an exception here?
Or is it allowed? true!
Vegetarian Pizza Topping : SimpleInstance(Hamster
of [DefaultOWLNamedClass(HamTopping,
FrameID(5:10149 1))])

---------------- o 0 o ------------------------

1) A MargueritaPizza only exists if there is a
pizza with Mozzarella and Tomato toppings, but
this MargueritaPizza has no toppings.
2) Clearly, I should not be able to put
HamTopping on a Vegetarian Pizza.

So I'd like to ask, if I may:
1)  Am I doing something wrong?
2)  Am I expecting functionality that ought to be
there, but isn't yet?
3)  Am I expecting functionality that ought NOT
to be there, for some reason I haven't
4)  What must I do to get Java classes that
consistently obey the ontological rules?

Thanking you in advance,

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

More information about the protege-discussion mailing list