(select (filter (bgp (triple ?:s ?:p ?:o)) (regex ?:o "foo" "i")) (?:s ?:p ?:o))