
-- create triggers for triples table

create or replace function insert_triple() returns trigger as $$
  declare
    trid bigint;
  begin
    trid := load_triple(new.stname, new.stext, new.ptext, 
                        new.otname, new.otext, new.creation);
    return new;
  end;
$$ language plpgsql;

 
create trigger insert_triple instead of insert on vtriples
  for each row execute procedure insert_triple();
