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 gmail.com
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.

  try
  {
  FileReader owlFile = new
FileReader("E:\\Test\\src\\test\\DataStructure.owl");

  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) it.next();
  String name = simInstance.getName();

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

  }
  catch(Exception ex)
  {
  System.out.println(ex.toString());
  }

-- 
Regards,
Vivekanandan Ramachandran.

_______________________________________________
protege-discussion mailing list
protege-discussion at lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/protege-discussion

Instructions for unsubscribing:
http://protege.stanford.edu/doc/faq.html#01a.03




-- 
Regards,
Vivekanandan Ramachandran.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20080915/f5405a4d/attachment.html>


More information about the protege-discussion mailing list