code: public void resolveReferences() {
          // Resolve annotations to their definitions
          Map<String, AnnotationDefinition> defs = getDefinitionMap();
          final List<Annotation> annos = new ArrayList<Annotation>();
  
          // Get all the annotation used by the document's statement groups
          for (final StatementGroup sg : statementGroups) {
              annos.addAll(sg.getAllAnnotations());
          }
  
          // Resolve the references
          for (final Annotation a : annos) {
              AnnotationDefinition ad = a.getDefinition();
              // Skip annotations without definitions
              if (ad == null) {
                  continue;
              }
  
              final String id = ad.getId();
              AnnotationDefinition documentDefinition = defs.get(id);
  
              // BEL document annotations must reference valid definitions...
              assert documentDefinition != null;
              // ... so sanity check that for now.
  
              // Resolve the reference to the instance
              a.setDefinition(documentDefinition);
          }
  
          // Resolve parameters to their namespaces
          Map<String, Namespace> nspcs = getNamespaceMap();
          final List<Parameter> params = new ArrayList<Parameter>();
  
          // Get all the parameters within the document
          for (final StatementGroup sg : statementGroups) {
              params.addAll(sg.getAllParameters());
          }
  
          // Get the default namespace if present
          final Namespace defaultNS = nspcs.get(DEFAULT_NAMESPACE_PREFIX);
  
          // Resolve the references
          for (final Parameter av : params) {
              Namespace ns = av.getNamespace();
  
              // Skip parameters without namespaces
              if (ns == null) {
                  if (defaultNS != null) {
                      av.setNamespace(defaultNS);
                  }
                  continue;
              }
  
              final String prefix = ns.getPrefix();
              Namespace documentNamespace = nspcs.get(prefix);
  
              // BEL document parameters must reference valid namespaces...
              assert documentNamespace != null;
              // ... so sanity check that for now.
  
              // Resolve the reference to the instance
              av.setNamespace(documentNamespace);
          }
      }
docs: Resolves any property references in use within the document to their
  corresponding instances.