anchor.diff:  			ocs_event:notify(delete_resource, Resource, resource)
   	end.
   
  --spec query_resource(Cont, MatchId, MatchCategory, MatchResSpecId) -> Result
  +-spec query_resource(Cont, MatchId, MatchCategory,
  +		MatchResSpecId, MatchRelName) -> Result
   	when
   		Cont :: start | any(),
   		MatchId :: Match,
   		MatchCategory :: Match,
   		MatchResSpecId :: Match,
  +		MatchRelName :: Match,
   		Match :: {exact, string()} | {like, string()} | '_',
   		Result :: {Cont1, [#resource{}]} | {error, Reason},
   		Cont1 :: eof | any(),
   		Reason :: term().
   %% @doc Query resources
  -query_resource(Cont, '_', MatchCategory, MatchResSpecId) ->
  +query_resource(Cont, '_', MatchCategory, MatchResSpecId, MatchRelName) ->
   	MatchHead = #resource{_ = '_'},
  -	query_resource1(Cont, MatchHead, MatchCategory, MatchResSpecId);
  -query_resource(Cont, {Op, String}, MatchCategory, MatchResSpecId)
  +	query_resource1(Cont, MatchHead, MatchCategory,
  +			MatchResSpecId, MatchRelName);
  +query_resource(Cont, {Op, String}, MatchCategory, MatchResSpecId, MatchRelName)
   		when is_list(String), ((Op == exact) orelse (Op == like)) ->
   	MatchHead = case lists:last(String) of
   		$% when Op == like ->
  
positive.code:          MatchHead1#resource{specification
  					= #specification_ref{id = String, _ = '_'}}
  	end,
  	MatchSpec = [{MatchHead2, [], ['$_']}],
     query_resource3(Cont, MatchSpec).
  query_resource3(start, MatchSpec) ->
  	F = fun() ->
  			mnesia:select(resource, MatchSpec, ?CHUNKSIZE, read)
  	end,
  	query_resource4(mnesia:ets(F));
  query_resource3(Cont, _MatchSpec) ->
  	F = fun() ->
           mnesia:select(Cont)
     end,
  	query_resource4(mnesia:ets(F)).
  %% @hidden
  query_resource4({Resources, Cont}) ->
  	{Cont, Resources};
  query_resource4('$end_of_table') ->
  		{eof, []}.
  
  -type password() :: [50..57 | 97..104 | 106..107 | 109..110 | 112..116 | 119..122].
  
negative.code: 		_ ->
           MatchHead1#resource{category = String}
  	end,
     query_resource2(Cont, MatchHead2, MatchResSpecId, MatchRelName).
  query_resource2(Cont, MatchHead, '_', MatchRelName) ->
  	query_resource3(Cont, MatchHead, MatchRelName);
  query_resource2(Cont, MatchHead1, {Op, String}, MatchRelName)
  		when is_list(String), ((Op == exact) orelse (Op == like)) ->
  	MatchHead2 = case lists:last(String) of
  		$% when Op == like ->
  