Set<String> prop = new HashSet<String>();
           ExtendedIterator rootIterator =
classname.listDeclaredProperties();
        int i=0;
        while (rootIterator.hasNext()){
            OntProperty ontRoot = (OntProperty) rootIterator.next();
            String properties = ontRoot.toString();
            int propertyLength = properties.length();
                int propertyIndex = properties.lastIndexOf("#");
            if (propertyIndex != -1){
                String property = properties.substring(propertyIndex+1,
 propertyLength);
                prop.add(property);
            }
        }

         but this code display a property again and again.... i used to get
a single property multiple times.. how to avoid that?


On Fri, Apr 19, 2013 at 2:48 PM, Andy Seaborne <[email protected]> wrote:

> On 19/04/13 19:21, aar thi wrote:
>
>> hi i'm doing a small project in ontology,  i  need to retrieve all the
>> property names present in a particular class in the ontology. some one
>> help
>> me to do that in jena
>>
>>
> What have you tried?
>
>
>

Reply via email to