updating queries to use named graphs