code: public R getRelationships() {
          R r = new R(factory.getTotalConcepts(), factory.getTotalRoles());
          
          // Collect subsumptions from context index
          for (IntIterator it = contextIndex.keyIterator(); it.hasNext();) {
              int key = it.next();
              Context ctx = contextIndex.get(key);
              int concept = ctx.getConcept();
              CR pred = ctx.getPred();
              CR succ = ctx.getSucc();
              
              int[] predRoles = pred.getRoles();
              for(int i = 0; i < predRoles.length; i++) {
                  IConceptSet cs = pred.lookupConcept(predRoles[i]);
                  for(IntIterator it2 = cs.iterator(); it2.hasNext(); ) {
                      int predC = it2.next();
                      r.store(predC, predRoles[i], concept);
                  }
              }
              
              int[] succRoles = succ.getRoles();
              for(int i = 0; i < succRoles.length; i++) {
                  IConceptSet cs = succ.lookupConcept(succRoles[i]);
                  for(IntIterator it2 = cs.iterator(); it2.hasNext(); ) {
                      int succC = it2.next();
                      r.store(concept, succRoles[i], succC);
                  }
              }
          }
          
          return r;
      }
docs: Collects all the information contained in the concurrent R structures in
  every context and returns a single R structure with all their content.
  
  @return R