anchor.diff: -%% @doc This is the Erlang side of the graph database.
  +%% @doc This is the Erlang API of the graph database.
   %% 
   %% @author Ingo Schramm
   
  
positive.code: vertex_get_edges(V=?VERTEX(Id), Type) ->
      [ E || E=?EDGE(EId,T,A,B) <- vertex_get_edges(V), T =:= Type ].
  
  vertex_get_neighbourhood(V=?VERTEX(Id)) ->
      lists:map(
          fun(?EDGE(EId,T,A,B))->
              if 
                  A =:= Id ->
                      B;
                  true ->
                      A
              end
          end, 
          vertex_get_edges(V)).
  
  % @doc Set a property at a vertex.
  vertex_set_property(?VERTEX(Id), Key, Val) ->
      private_set_property(vertex, Id, Key, Val).
  
  vertex_del_property(?VERTEX(Id), Key) ->
      private_del_property(vertex, Id, Key).
  
  vertex_get_property(?VERTEX(Id), Key) ->
      private_get_property(vertex, Id, Key).
  
  vertex_get_properties(?VERTEX(Id)) ->
      private_get_properties(vertex, Id).
  
  
negative.code:         Error -> Error
      end.
  
  get_other_nodes(Id,Edges) ->
      lists:map(
          fun(?EDGE(EId,T,A,B))->
              if 
                  A =:= Id -> ?VERTEX(B);
                  true     -> ?VERTEX(A)
              end
          end, 
          Edges).
  
  