Compact data structures for temporal graphs