code: func ParsePartialSetDocRuleFromTerm(module *Module, term *Term) (*Rule, error) {
  
  	ref, ok := term.Value.(Ref)
  	if !ok {
  		return nil, fmt.Errorf("%vs cannot be used for rule head", TypeName(term.Value))
  	}
  
  	if len(ref) != 2 {
  		return nil, fmt.Errorf("refs cannot be used for rule")
  	}
  
  	rule := &Rule{
  		Location: term.Location,
  		Head: &Head{
  			Location: term.Location,
  			Name:     ref[0].Value.(Var),
  			Key:      ref[1],
  		},
  		Body: NewBody(
  			NewExpr(BooleanTerm(true).SetLocation(term.Location)).SetLocation(term.Location),
  		),
  		Module: module,
  	}
  
  	return rule, nil
  }
docs: // ParsePartialSetDocRuleFromTerm returns a rule if the term can be interpreted
  // as a partial set document definition.