fixing document subgraph query