
-- create triples views

create or replace view vtriples as
select triples.id,
       stype, svalue, show_value(stype, svalue) as stext, 
       predicate, show_value(dt.id, predicate) as ptext, 
       otype, ovalue, show_value(otype, ovalue) as otext,
       to_char(events.tstamp, 'YYYY-MM-DD HH24:MI:SS') as ts
  from triples, datatypes dt, events
  where dtname = 'node'
    and events.id = creation
    and deletion is null
;
