ResourceOrVariable subject = new ResourceOrVariable(
new UriRef("http://example.org/book/book1"));
UriRefOrVariable predicate = new UriRefOrVariable(
new UriRef("http://purl.org/dc/elements/1.1/title"));
ResourceOrVariable object = new ResourceOrVariable(variable);
TriplePattern triplePattern = new SimpleTriplePattern(subject, predicate, object);
Set<TriplePattern> triplePatterns = new HashSet<TriplePattern>();
triplePatterns.add(triplePattern);
SimpleBasicGraphPattern bgp = new SimpleBasicGraphPattern(triplePatterns);
SimpleGroupGraphPattern queryPattern = new SimpleGroupGraphPattern();