Hi all,

im writing an Ontology based application for mapping information. In simple
terms this is done by defining keywords for classes and instances and
matching the keywords to words in documents.

Now while the mapping of instance - keyword relations is working fine i am
having trouble with class - keyword relations.

With the following code snippet i can retrieve all keywords of instances:
public HashMap<String,Resource> readKeywords(){
        StmtIterator iter = model.listStatements(null , keywordProp,
(RDFNode)null);

        while (iter.hasNext()){
            Statement stmt= iter.next();
            Resource subject = stmt.getSubject();

            if (readKeywordsOf(subject)!=null){
                keywords.putAll(readKeywordsOf(subject));
            }
      }
}

I modeled keywords of classe by using has-restrictions on the class with the
appropiate keyword. I assume the class keywords dont show in the iterator
defined above, because i need to iterate over restrictions and not the
keywordProp. But how do i do that (efficiently if possible) or is there a
better way of relating classes to instances without using has-restrictions.

Any hints and solutions would be much appreciated.

thanks and regards
Lars

Reply via email to