Hi, The current W3C recommendation of SPARQL 1.1 supports the CONSTRUCT query form, which returns a single RDF graph specified by a graph template. The result is an RDF graph formed by taking each query solution in the solution sequence, substituting for the variables in the graph template, and combining the triples into a single RDF graph by set union. However, it does not directly generate quads or RDF datasets. In order to eliminate this limitation, I proposed a GSoC 2015 project [1], to extend the grammar of the CONSTRUCT query form and implement the according Jena ARQ components, which will bring more conveniences for the users manipulating RDF datasets with SPARQL.
Now the code has been delivered [2], with some examples here [3]. You're welcome to try them out. Any comments are appropriated. Cheers, Qihong Lin [1] https://docs.google.com/document/d/1KiDlfxMq5ZsU7vj7ZDm10yC96OZgdltwmZAZl56sTw0/edit# [2] https://github.com/confidencesun/jena/tree/JENA-491 [3] https://github.com/confidencesun/jena/blob/JENA-491/jena-arq/src-examples/arq/examples/constructquads/ExampleConstructQuads.java