Object[] tupleBuffer=retrieval.getTupleBuffer();
while (!retrieval.afterLast()) {
Object roleObject=tupleBuffer[0];
if (roleObject instanceof AtomicRole) {
AtomicRole atomicrole=(AtomicRole)roleObject;
Node node2=(Node)tupleBuffer[2];
if (node2.isActive() && node2.getNodeType()==NodeType.NAMED_NODE && individualsForNodes.containsKey(node2)) {
Individual successor=individualsForNodes.get(node2);
Map<AtomicRole,Map<Individual,Set<Individual>>> relevantRelations;
if (retrieval.getDependencySet().isEmpty())
relevantRelations=knownObjectPropertyRelations;
else
relevantRelations=possibleObjectPropertyRelations;
Map<Individual,Set<Individual>> relationsForRole=relevantRelations.get(atomicrole);
if (relationsForRole==null) {
relationsForRole=new HashMap<Individual, Set<Individual>>();
relevantRelations.put(atomicrole, relationsForRole);
}
Set<Individual> successors=relationsForRole.get(ind);
if (successors==null) {
successors=new HashSet<Individual>();
relationsForRole.put(ind, successors);
}
successors.add(successor);
}
}
retrieval.next();
}
// add more possible relations for complex properties
String indIRI=ind.getIRI();
AtomicConcept conceptForRole;
for (Role objectRole : complexObjectRoles) {
if (objectRole instanceof AtomicRole) {
conceptForRole=AtomicConcept.create("internal:individual-concept#"+((AtomicRole)objectRole).getIRI()+"#"+indIRI);
} else {
conceptForRole=AtomicConcept.create("internal:individual-concept#inv#"+((InverseRole)objectRole).getInverseOf().getIRI()+"#"+indIRI);
}
retrieval=tableau.getExtensionManager().getBinaryExtensionTable().createRetrieval(new boolean[] { true,false },ExtensionTable.View.TOTAL);
retrieval.getBindingsBuffer()[0]=conceptForRole;
retrieval.open();
tupleBuffer=retrieval.getTupleBuffer();
while (!retrieval.afterLast()) {
Node node=(Node)tupleBuffer[1];
if (node.isActive() && node.getNodeType()==NodeType.NAMED_NODE && individualsForNodes.containsKey(node)) {
AtomicRole atomicrole;
Individual first=ind;
Individual second=individualsForNodes.get(node);
if (objectRole instanceof AtomicRole) {
atomicrole=(AtomicRole)objectRole;