code: @Override
      public void expandStatements(final Document doc, final ProtoNetwork pn,
              final boolean stmtExpand) {
          final ProtoNetworkBuilder pnb = new ProtoNetworkBuilder(doc);
          final ArrayList<ExpansionRule<Statement>> rules = sizedArrayList(2);
          if (stmtExpand) {
              rules.add(distributedRule);
          } else {
              rules.add(extractRule);
          }
          rules.add(reciprocalRule);
  
          final StatementTable st = pn.getStatementTable();
          final List<TableStatement> ts = st.getStatements();
          final Map<Integer, Statement> index = st.getIndexedStatements();
  
          for (int i = 0, n = ts.size(); i < n; i++) {
              final Statement stmt = index.get(i);
  
              if (stmt == null) {
                  continue;
              }
  
              // check each statement expansion rule
              for (ExpansionRule<Statement> rule : rules) {
                  if (!rule.match(stmt)) {
                      continue;
                  }
                  final List<Statement> stmtExp = rule.expand(stmt);
                  for (final Statement exp : stmtExp) {
  
                      if (exp.isSubjectOnly()) {
                          createNode(exp.getSubject(), i, pn, pnb);
                      } else if (exp.isStatementTriple()) {
                          createEdge(exp, i, pn, pnb);
                      } else {
                          throw new UnsupportedOperationException(
                                  "Cannot provide a nested statement as an " +
                                          "expansion.");
                      }
                  }
              }
          }
      }
docs: {@inheritDoc}