Dear all,

This might be due to my lack of knowledge on SPARQL syntax.

1.
I try to construct a named graph via SPARQL query, but it fails.
so What I did is like following
///////////
Model model = ModelFactory.createDefaultModel();
String queryStr ="CONSTRUCT {GRAPH <http://example.com> {<s1> <p1> <o1>.} }
WHERE{}";
Query query = QueryFactory.create(queryStr);
QueryExecution qe = QueryExecutionFactory.create(query,  resultModel);
/////////

It fails at the third line while it is parsing with this error message:
Exception in thread "main" org.apache.jena.query.QueryParseException:
Encountered " "graph" "GRAPH "" at line 1, column 335.

I am thinking that I am following
https://jena.apache.org/documentation/query/construct-quad.html correctly.

Could you tell me the problem in the query?


2.
Actually I rather want to use INSERT instead of CONSTRUCT, but QueryFactory
cannot parse INSERT. Why is that?

Thanks!


With regards,
Jason Koh
cseweb.ucsd.edu/~jbkoh

Reply via email to