title: GRAPH Queries in Jena TDB: CLI works / Code fails
body: <p>I have created a TDB data set and loaded data into it. I want to execute the following query:</p>
  
  <pre><code>prefix skos: &lt;http://www.w3.org/2004/02/skos/core#&gt; 
  SELECT ?s WHERE  { GRAPH ?g { ?s skos:broader ?o }} LIMIT 100
  </code></pre>
  
  <p>In the command line, this query runs and returns the desired result using:</p>
  
  <pre><code>tdbquery --loc=&lt;path_to_dataset&gt; --file &lt;path_to_query_file&gt;
  </code></pre>
  
  <p>However, I am having trouble executing the very same query in Java code:</p>
  
  <pre><code>String pathToRepo = "&lt;path_to_dataset&gt;";
  
  // open the dataset
  dataset = TDBFactory.createDataset(pathToRepo);
  
  model = dataset.getDefaultModel();
  
  String queryString = "PREFIX skos: &lt;http://www.w3.org/2004/02/skos/core#&gt;\n"
                        + "SELECT ?s WHERE  { GRAPH ?g { ?s skos:broader ?o } } LIMIT 100";
  Query query = QueryFactory.create(queryString);
  QueryExecution qe = QueryExecutionFactory.create(query, model);
  ResultSet results = qe.execSelect();
  while (results.hasNext()) {
      QuerySolution result = results.next();
      System.out.println(result.get("s").toString());
  }
  qe.close();
  </code></pre>
  
  <p>The Java code runs but will not return any results.
  Why is this the case? What do I have to change?</p>
  
  <p>The data I use is public you can find it here: <a href="http://webisa.webdatacommons.org/" rel="nofollow noreferrer">http://webisa.webdatacommons.org/</a> (scroll down until you are at Data Dumps). </p>
  
  <p>I am new to Jena TDB, so I hope the question is not too stupid and not too hard to answer. Thank you for your help!</p>