// Requires OpDatasetNames
Dataset dataset = create() ;
String graphName = "http://example/" ;
Triple triple = SSE.parseTriple("(<x> <y> 123)") ;
Graph g2 = dataset.asDatasetGraph().getGraph(Node.createURI(graphName)) ;
// Graphs only exists if they have a triple in them
g2.add(triple) ;
Query query = QueryFactory.create("SELECT ?g { GRAPH ?g {} }") ;
QueryExecution qExec = QueryExecutionFactory.create(query, dataset) ;