tasks/rdfstore/index.js
function(input, frame)
{
   var rval = false;
   
   // frame must not have a specific type
   var type = '@type';
   if(!(type in frame))
   {
      // get frame properties that must exist on input
      var props = Object.keys(frame).filter(function(e)
      {
         // filter non-keywords
         return e.indexOf('@') !== 0;
      });
      if(props.length === 0)
      {
         // input always matches if there are no properties
         rval = true;
      }
      // input must be a subject with all the given properties
      else if(input.constructor === Object && '@id' in input)
      {
         rval = true;
         for(var i in props)
         {
            if(!(props[i] in input))
            {
               rval = false;
               break;
            }
         }
      }
   }
   
   return rval;
}
function(input, frame)
{
   var rval = false;
   
   // frame must not have a specific type
   var type = '@type';
   if(!(type in frame))
   {
      // get frame properties that must exist on input
      var props = Object.keys(frame).filter(function(e)
      {
         // filter non-keywords
         return e.indexOf('@') !== 0;
      });
      if(props.length === 0)
      {
         // input always matches if there are no properties
         rval = true;
      }
      // input must be a subject with all the given properties
      else if(input.constructor === Object && '@id' in input)
      {
         rval = true;
         for(var i in props)
         {
            if(!(props[i] in input))
            {
               rval = false;
               break;
            }
         }
      }
   }
   
   return rval;
}
function ( input , frame ) { var rval = false ; // frame must not have a specific type var type = '@type' ; if ( ! ( type in frame ) ) { // get frame properties that must exist on input var props = Object . keys ( frame ) . filter ( function ( e ) { // filter non-keywords return e . indexOf ( '@' ) !== 0 ; } ) ; if ( props . length === 0 ) { // input always matches if there are no properties rval = true ; } // input must be a subject with all the given properties else if ( input . constructor === Object && '@id' in input ) { rval = true ; for ( var i in props ) { if ( ! ( props [ i ] in input ) ) { rval = false ; break ; } } } } return rval ; }
Returns true if the given input matches the given frame via duck-typing.

@param input the input.
@param frame the frame to check against.

@return true if the input matches the frame.
Returns true if the given input matches the given frame via duck - typing .