code: function _filterSubject(subject, frame) {
    // check @type (object value means 'any' type, fall through to ducktyping)
    if('@type' in frame &&
      !(frame['@type'].length === 1 && _isObject(frame['@type'][0]))) {
      var types = frame['@type'];
      for(var i = 0; i < types.length; ++i) {
        // any matching @type is a match
        if(jsonld.hasValue(subject, '@type', types[i])) {
          return true;
        }
      }
      return false;
    }
  
    // check ducktype
    for(var key in frame) {
      // only not a duck if @id or non-keyword isn't in subject
      if((key === '@id' || !_isKeyword(key)) && !(key in subject)) {
        return false;
      }
    }
    return true;
  }
docs: Returns true if the given subject matches the given frame.
  
  @param subject the subject to check.
  @param frame the frame to check.
  
  @return true if the subject matches, false if not.