A Holistic Approach for Answering Logical Queries on Knowledge Graphs