CONSTRUCT is an alternative SPARQL result clause to SELECT. Instead of returning a table of result values, CONSTRUCT returns an RDF graph.
So running this query
PREFIX : http://dbpedia.org/resource/ PREFIX onto: http://dbpedia.org/ontology/ CONSTRUCT { :France onto:anthem ?x } WHERE { :France onto:anthem ?x . }
dont foget the < and > arround prefix
inside this java code:
Query query = QueryFactory.create("the query goes here"); QueryExecution qexec = QueryExecutionFactory.sparqlService("http://dbpedia.org/sparql", query); ResultSet results = qexec.execSelect(); ResultSetFormatter.out(System.out, results, query);
it returns HttpException: 406 Unacceptable. But if instead of the contruct block, i choose select ?x
, its just fine. Does jena support construct, how?
trying on http://dbpedia.org/snorql both work well. T