use of org.apache.clerezza.commons.rdf.impl.utils.simple.SimpleGraph in project stanbol by apache.
the class AbstractOntologyCollectorImpl method getMergedTc.
private Graph getMergedTc() {
// Takes less memory than the Indexed one
Graph result = new SimpleGraph();
for (OWLOntologyID key : listManagedOntologies()) {
// TODO when implemented, switch to true.
Graph managed = getOntology(key, Graph.class, false);
Set<RDFTerm> exclusions = new HashSet<RDFTerm>();
Iterator<Triple> it = managed.filter(null, RDF.type, OWL.Ontology);
while (it.hasNext()) exclusions.add(it.next().getSubject());
for (Triple t : managed) if (!exclusions.contains(t.getSubject()))
result.add(t);
}
return result;
}
Aggregations