Added code to extract entity relationships.