anchor.diff:  %% hassubjectpredicate=predicate
   %% Give all things which have any incoming edge with given predicate
   parse_query([{hassubjectpredicate, Predicate}|Rest], Context, Result) ->
  -    {A, Result1} = add_edge_join("subject_id", Result),
  +    {A, Result1} = add_edge_join("object_id", Result),
       PredicateId = m_predicate:name_to_id_check(Predicate, Context),
       {Arg1, Result2} = add_arg(PredicateId, Result1),
       Result3 = add_where(A ++ ".predicate_id = " ++ Arg1, Result2),
  
positive.code:     parse_query(Rest, Context, Result#search_sql{cats_exclude=Cats2, tables=Tables1});
  
  %% hassubject=[id]
  %% Give all things which have an outgoing edge to Id
  parse_query([{hassubject, Id}|Rest], Context, Result) when is_integer(Id) ->
      parse_query([{hassubject, [Id]}|Rest], Context, Result);
  parse_query([{hassubject, [Id]}|Rest], Context, Result) ->
      {A, Result1} = add_edge_join("subject_id", Result),
      {Arg, Result2} = add_arg(Id, Result1),
      Result3 = add_where(A ++ ".object_id = " ++ Arg, Result2),
      parse_query(Rest, Context, Result3);
  
  %% hassubject=[id,predicate,[alias]]
  %% Give all things which have an outgoing edge to Id with the given predicate
  parse_query([{hassubject, [Id, Predicate]}|Rest], Context, Result) ->
      parse_query([{hassubject, [Id, Predicate, "rsc"]}|Rest], Context, Result);
  parse_query([{hassubject, [Id, Predicate, Alias]}|Rest], Context, Result) ->
      {A, Result1} = add_edge_join(Alias, "subject_id", Result),
      Result2 = case Id of
                    undefined -> Result1;
  
negative.code: %% hasobjectpredicate=predicate
  %% Give all things which have any outgoing edge with given predicate
  parse_query([{hasobjectpredicate, Predicate}|Rest], Context, Result) ->
      {A, Result1} = add_edge_join("subject_id", Result),
      PredicateId = m_predicate:name_to_id_check(Predicate, Context),
      {Arg1, Result2} = add_arg(PredicateId, Result1),
      Result3 = add_where(A ++ ".predicate_id = " ++ Arg1, Result2),
  