code: @Override
      public void expandTerms(final Document doc, final ProtoNetwork pn) {
          final ProtoNetworkBuilder pnb = new ProtoNetworkBuilder(doc);
          final StatementTable st = pn.getStatementTable();
          final List<TableStatement> stmts = st.getStatements();
          final Map<Integer, Statement> si = st.getIndexedStatements();
  
          final List<Statement> expansions = new ArrayList<Statement>();
          for (int i = 0, n = stmts.size(); i < n; i++) {
              final Statement stmt = si.get(i);
  
              // expand subject term
              expandTerm(stmt.getSubject(), expansions);
  
              if (stmt.getObject() != null) {
                  if (stmt.getObject().getTerm() != null) {
                      // expand the rest of simple statement
                      expandTerm(stmt.getObject().getTerm(), expansions);
                  } else {
                      // expand the rest of nested statement
                      final Term nsub = stmt.getObject().getStatement()
                              .getSubject();
                      final Term nobj = stmt.getObject().getStatement()
                              .getObject().getTerm();
  
                      expandTerm(nsub, expansions);
                      expandTerm(nobj, expansions);
                  }
              }
  
              for (final Statement expansion : expansions) {
                  createEdge(expansion, i, pn, pnb);
              }
  
              expansions.clear();
          }
      }
docs: {@inheritDoc}