A typical SPARQL query that specifies a graph might look like this:
SELECT ?b ?c WHERE { GRAPH { ?b ?c}
If you have to run a query in a subset of the graphs that you are using you can also set a filter on the iri of the graphs.
eg:
SELECT ?b ?c FROM NAMED FROM NAMED FROM NAMED WHERE { GRAPH ?g { ?b ?c FILTER( ?g= || ?g= ) } }