anchor.diff:           MatchHead1#resource{specification
   					= #specification_ref{id = String, _ = '_'}}
   	end,
  +   query_resource3(Cont, MatchHead2, MatchRelName).
  +query_resource3(Cont, MatchHead, '_') ->
  +	MatchSpec = [{MatchHead, [], ['$_']}],
  +	query_resource4(Cont, MatchSpec);
  +query_resource3(Cont, MatchHead1, {Op, String})
  +		when is_list(String), ((Op == exact) orelse (Op == like)) ->
  +	MatchHead2 = case lists:last(String) of
  +		$% when Op == like ->
  +			MatchHead1#resource{related = [#resource_rel{name
  +					= lists:droplast(String) ++ '_', _ = '_'}]};
  +		_ ->
  +         MatchHead1#resource{related
  +					= [#resource_rel{name = String, _ = '_'}]}
  +	end,
   	MatchSpec = [{MatchHead2, [], ['$_']}],
  -   query_resource3(Cont, MatchSpec).
  -query_resource3(start, MatchSpec) ->
  +   query_resource4(Cont, MatchSpec).
  +query_resource4(start, MatchSpec) ->
   	F = fun() ->
   			mnesia:select(resource, MatchSpec, ?CHUNKSIZE, read)
   	end,
  -	query_resource4(mnesia:ets(F));
  -query_resource3(Cont, _MatchSpec) ->
  +	query_resource5(mnesia:ets(F));
  +query_resource4(Cont, _MatchSpec) ->
   	F = fun() ->
            mnesia:select(Cont)
      end,
  -	query_resource4(mnesia:ets(F)).
  -%% @hidden
  -query_resource4({Resources, Cont}) ->
  +	query_resource5(mnesia:ets(F)).
  +%% @hidden
  +query_resource5({Resources, Cont}) ->
   	{Cont, Resources};
  -query_resource4('$end_of_table') ->
  +query_resource5('$end_of_table') ->
   		{eof, []}.
   
   -type password() :: [50..57 | 97..104 | 106..107 | 109..110 | 112..116 | 119..122].
  
positive.code: 		_ ->
           #resource{id = String, _ = '_'}
  	end,
     query_resource1(Cont, MatchHead, MatchCategory, MatchResSpecId).
  %% @hidden
  query_resource1(Cont, MatchHead, '_', MatchResSpecId) ->
  	query_resource2(Cont, MatchHead, MatchResSpecId);
  query_resource1(Cont, MatchHead1, {Op, String}, MatchResSpecId)
  		when is_list(String), ((Op == exact) orelse (Op == like)) ->
  	MatchHead2 = case lists:last(String) of
  		$% when Op == like ->
  
negative.code: -export([add_offer/1, find_offer/1, get_offers/0, delete_offer/1,
  		query_offer/7]).
  -export([add_resource/1, get_resources/0, get_resource/1, delete_resource/1,
  		query_resource/5]).
  -export([add_policy_table/1, delete_policy_table/1]).
  -export([add_policy/2, get_policy/2, get_policies/1, delete_policy/2]).
  -export([generate_password/0, generate_identity/0]).
  