[Pellet-users] get value of property

Alexander Becker trennung at weinenvorglueck.de
Wed Jul 23 20:22:24 UTC 2008


Dear all!

I need to fetch the value of a property.
atm, I'm doing it this way:
[code]
private String getSpecificDataPropertyValue(String prop_name, Map<OWLDataPropertyExpression,Set<OWLConstant>> props) {
        
        Set<OWLDataPropertyExpression> keyset = props.keySet();
                
        for( OWLDataPropertyExpression oprop : keyset ) {
            if( oprop.toString().equals(prop_name) ) {
                for( OWLConstant propvalue : props.get(oprop) ) {
                    return propvalue.getLiteral();
                }
            }
        }
        
        return null;
    }
[/code]

But: there must be an easier way to do that. Does someone know another way?
And: I don't want to distinguish between data and object properties. Is ther a general way to fetch properties from an individual without telling if it is a data or an object proerty?

I'm doing that like this:
[code]
Map<OWLDataPropertyExpression,Set<OWLConstant>> ind_data_props = ind.getDataPropertyValues(ontology);
[/code]

Unfortunately, there is no ind.getProperties(), but maybe someone has a good idea on this.

regards, Alex
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer


More information about the Pellet-users mailing list