anchor.diff:  
       <<"object">> ->
         Links = js_links_machine:collect_schema_links(Sch,true,V),
  +      NewVars = update_vars(Term,V),
  +      EnvVars = lists:map(fun ({Key,_}) -> Key end, NewVars),
         ShallowLinks =
  -	lists:map
  -	  (fun ({link,Props}) ->
  -	       NewVars = update_vars(Term,V),
  +	lists:flatmap
  +	  (fun (Link={link,Props}) ->
   	       NewProps = [{object,Term}|Props],
  -	       {link,[{vars,NewVars}|proplists:delete(vars,NewProps)]}
  +	       NewLink = {link,NewProps},
  +	       Href = link_href(Link),
  +	       Template = uri_template:parse(binary_to_list(Href)),
  +	       TemplateVars = 
  +		 lists:filter(fun (T) ->
  +				  case T of 
  +				    {var,_,_} -> true;
  +				    _ -> false
  +				  end
  +			      end, Template),
  +	       case check_vars_exists(TemplateVars,EnvVars,NewLink) of
  +		 true ->
  +		   [{link,[{vars,NewVars}|proplists:delete(vars,NewProps)]}];
  +		 false ->
  +		   []
  +	       end
   	   end,
   	   Links),
         %%io:format("Shallow links are:~n~p~n",[ShallowLinks]),
  
positive.code:       Other
    end.
  
  link_request_type(Link) ->
    {struct,LinkDef} = link_def(Link),
    case proplists:get_value(<<"method">>,LinkDef) of
  
negative.code:      %%[OldVars,Object,NewVars]),
    NewVars.
  
  check_vars_exists([],EnvVars,Link) ->
    true;
  check_vars_exists([{var,Name,_}|LinkVars],EnvVars,Link) ->
    case not(lists:member(Name,EnvVars)) of
      true ->
        io:format
  	("*** Warning: variable ~p not found when generating link~n~p~n"++
  	   "Variables=~p~n*** Warning: Not generating link.~n",
  	 [Name,jsg_links:print_link(Link),EnvVars]),
        false;
      false ->
        check_vars_exists(LinkVars,EnvVars,Link)
    end.
  
  get_schema(Value={struct,Proplist}) ->
    get_schema(Value,{struct,[]});
  get_schema([Child,Root]) ->
  