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] Read Datatype property values

Vivek Anandan rvivekanandan at
Mon Sep 15 05:47:15 PDT 2008

Dear all,

Consider the knowledge
Men (class)
   hasLegs (DataType Property) datatype property value int

   hasHands(DataType Property) datatype property value int

I create an Instanse Mr.X for Men and associate with the two data type
properties for Men Now Mr.X and hasLegs 2  Mr.X hasHands 2

I retieved till Mr.X and got two properties hasHands and hasLegs with the
following code.
How to get the value 2.

Can any one suggest me an idea.
Thanks for the reply.

  FileReader owlFile = new

  JenaOWLModel owlModel = ProtegeOWL.createJenaOWLModelFromReader(owlFile);

  OWLNamedClass totalClass = owlModel.getOWLNamedClass("stack");

  Collection Instance = totalClass.getInstances(false);

  for (Iterator it = Instance.iterator(); it.hasNext();)
  SimpleInstance simInstance = (SimpleInstance);
  String name = simInstance.getName();

  Collection prop = simInstance.getOwnSlots();
  for (Iterator its = prop.iterator(); its.hasNext();)
  DefaultOWLDatatypeProperty propy = (DefaultOWLDatatypeProperty);
  System.out.println("\tDataTypeProperty : "+propy.getBrowserText());
  Collection subProperty = propy.getSubproperties(true);
  for (Iterator itsa = subProperty.iterator(); itsa.hasNext();)
  DefaultOWLDatatypeProperty propSub = (DefaultOWLDatatypeProperty);
  System.out.println("\tDataTypeProperty : "+propSub.getBrowserText());

  catch(Exception ex)

Vivekanandan Ramachandran.

protege-discussion mailing list
protege-discussion at

Instructions for unsubscribing:

Vivekanandan Ramachandran.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the protege-discussion mailing list