Added edge types and label and refactored the edge query