Higher-order reasoning with graph data