[Pellet-users] Problem with listSubProperties()

saurabh kejriwal saurabh.iitm at yahoo.co.in
Sun Feb 10 14:58:23 UTC 2008


 Hi,
  
I am using Pellet with Jena api. I am using standard Wine Ontology.

Owl fragment:
------------

  <owl:FunctionalProperty rdf:about="#hasBody">
    <rdf:type rdf:resource="&owl;ObjectProperty"/>
    <rdfs:range rdf:resource="#WineBody"/>
    <rdfs:subPropertyOf rdf:resource="#hasWineDescriptor"/>
  </owl:FunctionalProperty>

  <owl:FunctionalProperty rdf:about="#hasColor">
    <rdf:type rdf:resource="&owl;ObjectProperty"/>
    <rdfs:domain rdf:resource="#Wine"/>
    <rdfs:range rdf:resource="#WineColor"/>
    <rdfs:subPropertyOf rdf:resource="#hasWineDescriptor"/>
  </owl:FunctionalProperty>

  <owl:FunctionalProperty rdf:about="#hasFlavor">
    <rdf:type rdf:resource="&owl;ObjectProperty"/>
    <rdfs:range rdf:resource="#WineFlavor"/>
    <rdfs:subPropertyOf rdf:resource="#hasWineDescriptor"/>
  </owl:FunctionalProperty>

  <owl:FunctionalProperty rdf:about="#hasSugar">
    <rdf:type rdf:resource="&owl;ObjectProperty"/>
    <rdfs:range rdf:resource="#WineSugar"/>
    <rdfs:subPropertyOf rdf:resource="#hasWineDescriptor"/>
  </owl:FunctionalProperty>

 When I am using the Pellet Reasoner--

 m = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);

 and the following code for getting the sub property of hasWineDescriptor....

OntProperty p = m.getOntProperty("http://www.w3.org/2001/sw/WebOnt/guide-src/wine#hasWineDescrip\

tor");

 ExtendedIterator j = p.listSubProperties(true);

 while(j.hasNext())
 {
 OntProperty p2 = (OntProperty)j.next();
 System.out.println(p2);
 }

 I am getting no result for direct subproperties of hasWineDescriptor.
 But there are four direct subproperties of hasWineDescriptor property.
1. hasBody
2. hasColor
3. hasFlavor
4. hasSugar

Regards
Saurabh Kejriwal

 
       
---------------------------------
 Meet people who discuss and share your passions.  Join them now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.owldl.com/pipermail/pellet-users/attachments/20080210/dc4a5044/attachment.htm 


More information about the Pellet-users mailing list