}
Model termModel = ModelFactory.createDefaultModel();
if ( true ) { // get all statements about the term
StmtIterator iter = model.listStatements(termRes, (Property) null, (Property) null);
if (iter.hasNext()) {
while (iter.hasNext()) {
com.hp.hpl.jena.rdf.model.Statement sta = iter.nextStatement();
termModel.add(sta);
}
}
}
if ( true ) { // test for subclasses
StmtIterator iter = model.listStatements(null, RDFS.subClassOf, termRes);
if ( iter.hasNext() ) {
while ( iter.hasNext() ) {
com.hp.hpl.jena.rdf.model.Statement sta = iter.nextStatement();
termModel.add(sta);
}
}
}
if ( model instanceof OntModel ) {
OntModel ontModel = (OntModel) model;
ExtendedIterator<Individual> iter = ontModel.listIndividuals(termRes);
if ( iter.hasNext() ) {
while ( iter.hasNext() ) {
Resource idv = (Resource) iter.next();
termModel.add(idv, RDF.type, termRes);
}
}
}