def transform_sparql_construct(rdf, construct_query):
logging.debug("<STR_LIT>")<EOL>if construct_query[<NUM_LIT:0>] == '<STR_LIT:@>':  <EOL><INDENT>construct_query = file(construct_query[<NUM_LIT:1>:]).read()<EOL><DEDENT>logging.debug("<STR_LIT>", construct_query)<EOL>newgraph = Graph()<EOL>for triple in rdf.query(construct_query):<EOL><INDENT>newgraph.add(triple)<EOL><DEDENT>return newgraph<EOL>
Perform a SPARQL CONSTRUCT query on the RDF data and return a new graph.